OLD | NEW |
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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 class AndroidNetworkMonitor : public rtc::NetworkMonitorBase { | 38 class AndroidNetworkMonitor : public rtc::NetworkMonitorBase { |
39 public: | 39 public: |
40 AndroidNetworkMonitor(); | 40 AndroidNetworkMonitor(); |
41 | 41 |
42 static void SetAndroidContext(JNIEnv* jni, jobject context); | 42 static void SetAndroidContext(JNIEnv* jni, jobject context); |
43 | 43 |
44 void Start() override; | 44 void Start() override; |
45 void Stop() override; | 45 void Stop() override; |
46 | 46 |
| 47 bool GetAllNetworkInfos( |
| 48 std::vector<rtc::NetworkInformation>* network_infos) override; |
| 49 //void OnNetworkAvailable(const rtc::NetworkInformation& network_info) overrid
e; |
| 50 |
47 private: | 51 private: |
48 JNIEnv* jni() { return AttachCurrentThreadIfNeeded(); } | 52 JNIEnv* jni() { return AttachCurrentThreadIfNeeded(); } |
49 | 53 |
50 ScopedGlobalRef<jclass> j_network_monitor_class_; | 54 ScopedGlobalRef<jclass> j_network_monitor_class_; |
51 ScopedGlobalRef<jobject> j_network_monitor_; | 55 ScopedGlobalRef<jobject> j_network_monitor_; |
52 rtc::ThreadChecker thread_checker_; | 56 rtc::ThreadChecker thread_checker_; |
53 static jobject application_context_; | 57 static jobject application_context_; |
54 }; | 58 }; |
55 | 59 |
56 class AndroidNetworkMonitorFactory : public rtc::NetworkMonitorFactory { | 60 class AndroidNetworkMonitorFactory : public rtc::NetworkMonitorFactory { |
57 public: | 61 public: |
58 AndroidNetworkMonitorFactory() {} | 62 AndroidNetworkMonitorFactory() {} |
59 | 63 |
60 rtc::NetworkMonitorInterface* CreateNetworkMonitor() override { | 64 rtc::NetworkMonitorInterface* CreateNetworkMonitor() override { |
61 return new AndroidNetworkMonitor(); | 65 return new AndroidNetworkMonitor(); |
62 } | 66 } |
63 }; | 67 }; |
64 | 68 |
65 } // namespace webrtc_jni | 69 } // namespace webrtc_jni |
66 | 70 |
67 #endif // TALK_APP_WEBRTC_JAVA_JNI_ANDROIDNETWORKMONITOR_JNI_H_ | 71 #endif // TALK_APP_WEBRTC_JAVA_JNI_ANDROIDNETWORKMONITOR_JNI_H_ |
OLD | NEW |