Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: talk/app/webrtc/java/jni/androidnetworkmonitor_jni.h

Issue 1594673002: Get the adapter type information from Android OS. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 static void SetAndroidContext(JNIEnv* jni, jobject context); 71 static void SetAndroidContext(JNIEnv* jni, jobject context);
72 72
73 void Start() override; 73 void Start() override;
74 void Stop() override; 74 void Stop() override;
75 75
76 int BindSocketToNetwork(int socket_fd, 76 int BindSocketToNetwork(int socket_fd,
77 const rtc::IPAddress& address) override; 77 const rtc::IPAddress& address) override;
78 void OnNetworkAvailable(const NetworkInformation& network_info); 78 void OnNetworkAvailable(const NetworkInformation& network_info);
79 79
80 rtc::AdapterType GetAdapterType(const std::string& if_name) override;
81
80 private: 82 private:
83 void UpdateNetworkInfos();
84 void GetAllNetworkInfos(std::vector<NetworkInformation>* network_infos);
Taylor Brandstetter 2016/01/20 01:51:57 This method could simply return an std::vector, an
honghaiz3 2016/01/21 21:38:36 Thanks! Good to know that.
81 JNIEnv* jni() { return AttachCurrentThreadIfNeeded(); } 85 JNIEnv* jni() { return AttachCurrentThreadIfNeeded(); }
82 86
83 void OnNetworkAvailable_w(const NetworkInformation& network_info); 87 void OnNetworkAvailable_w(const NetworkInformation& network_info);
84 88
85 ScopedGlobalRef<jclass> j_network_monitor_class_; 89 ScopedGlobalRef<jclass> j_network_monitor_class_;
86 ScopedGlobalRef<jobject> j_network_monitor_; 90 ScopedGlobalRef<jobject> j_network_monitor_;
87 rtc::ThreadChecker thread_checker_; 91 rtc::ThreadChecker thread_checker_;
88 static jobject application_context_; 92 static jobject application_context_;
89 bool started_ = false; 93 bool started_ = false;
94 std::map<std::string, rtc::AdapterType> adapter_types_;
pthatcher1 2016/01/19 02:13:07 What is the key here?
honghaiz3 2016/01/21 21:38:36 Interface name. changed name.
90 std::map<rtc::IPAddress, NetworkInformation> network_info_by_address_; 95 std::map<rtc::IPAddress, NetworkInformation> network_info_by_address_;
91 }; 96 };
92 97
93 class AndroidNetworkMonitorFactory : public rtc::NetworkMonitorFactory { 98 class AndroidNetworkMonitorFactory : public rtc::NetworkMonitorFactory {
94 public: 99 public:
95 AndroidNetworkMonitorFactory() {} 100 AndroidNetworkMonitorFactory() {}
96 101
97 rtc::NetworkMonitorInterface* CreateNetworkMonitor() override; 102 rtc::NetworkMonitorInterface* CreateNetworkMonitor() override;
98 }; 103 };
99 104
100 } // namespace webrtc_jni 105 } // namespace webrtc_jni
101 106
102 #endif // TALK_APP_WEBRTC_JAVA_JNI_ANDROIDNETWORKMONITOR_JNI_H_ 107 #endif // TALK_APP_WEBRTC_JAVA_JNI_ANDROIDNETWORKMONITOR_JNI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698