OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 j_network_monitor_( | 178 j_network_monitor_( |
179 jni(), | 179 jni(), |
180 jni()->CallStaticObjectMethod( | 180 jni()->CallStaticObjectMethod( |
181 *j_network_monitor_class_, | 181 *j_network_monitor_class_, |
182 GetStaticMethodID( | 182 GetStaticMethodID( |
183 jni(), | 183 jni(), |
184 *j_network_monitor_class_, | 184 *j_network_monitor_class_, |
185 "init", | 185 "init", |
186 "(Landroid/content/Context;)Lorg/webrtc/NetworkMonitor;"), | 186 "(Landroid/content/Context;)Lorg/webrtc/NetworkMonitor;"), |
187 application_context_)) { | 187 application_context_)) { |
188 ASSERT(application_context_ != nullptr); | 188 RTC_DCHECK(application_context_ != nullptr); |
189 CHECK_EXCEPTION(jni()) << "Error during NetworkMonitor.init"; | 189 CHECK_EXCEPTION(jni()) << "Error during NetworkMonitor.init"; |
190 if (android_sdk_int_ <= 0) { | 190 if (android_sdk_int_ <= 0) { |
191 jmethodID m = GetStaticMethodID(jni(), *j_network_monitor_class_, | 191 jmethodID m = GetStaticMethodID(jni(), *j_network_monitor_class_, |
192 "androidSdkInt", "()I"); | 192 "androidSdkInt", "()I"); |
193 android_sdk_int_ = jni()->CallStaticIntMethod(*j_network_monitor_class_, m); | 193 android_sdk_int_ = jni()->CallStaticIntMethod(*j_network_monitor_class_, m); |
194 CHECK_EXCEPTION(jni()) << "Error during NetworkMonitor.androidSdkInt"; | 194 CHECK_EXCEPTION(jni()) << "Error during NetworkMonitor.androidSdkInt"; |
195 } | 195 } |
196 } | 196 } |
197 | 197 |
198 void AndroidNetworkMonitor::Start() { | 198 void AndroidNetworkMonitor::Start() { |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 JOW(void, NetworkMonitor_nativeNotifyOfNetworkDisconnect)( | 427 JOW(void, NetworkMonitor_nativeNotifyOfNetworkDisconnect)( |
428 JNIEnv* jni, jobject j_monitor, jlong j_native_monitor, | 428 JNIEnv* jni, jobject j_monitor, jlong j_native_monitor, |
429 jlong network_handle) { | 429 jlong network_handle) { |
430 AndroidNetworkMonitor* network_monitor = | 430 AndroidNetworkMonitor* network_monitor = |
431 reinterpret_cast<AndroidNetworkMonitor*>(j_native_monitor); | 431 reinterpret_cast<AndroidNetworkMonitor*>(j_native_monitor); |
432 network_monitor->OnNetworkDisconnected( | 432 network_monitor->OnNetworkDisconnected( |
433 static_cast<NetworkHandle>(network_handle)); | 433 static_cast<NetworkHandle>(network_handle)); |
434 } | 434 } |
435 | 435 |
436 } // namespace webrtc_jni | 436 } // namespace webrtc_jni |
OLD | NEW |