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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 case NETWORK_4G: | 77 case NETWORK_4G: |
78 case NETWORK_3G: | 78 case NETWORK_3G: |
79 case NETWORK_2G: | 79 case NETWORK_2G: |
80 case NETWORK_UNKNOWN_CELLULAR: | 80 case NETWORK_UNKNOWN_CELLULAR: |
81 return rtc::ADAPTER_TYPE_CELLULAR; | 81 return rtc::ADAPTER_TYPE_CELLULAR; |
82 case NETWORK_BLUETOOTH: | 82 case NETWORK_BLUETOOTH: |
83 // There is no corresponding mapping for bluetooth networks. | 83 // There is no corresponding mapping for bluetooth networks. |
84 // Map it to VPN for now. | 84 // Map it to VPN for now. |
85 return rtc::ADAPTER_TYPE_VPN; | 85 return rtc::ADAPTER_TYPE_VPN; |
86 default: | 86 default: |
87 RTC_DCHECK(false) << "Invalid network type " << network_type; | 87 RTC_NOTREACHED() << "Invalid network type " << network_type; |
88 return rtc::ADAPTER_TYPE_UNKNOWN; | 88 return rtc::ADAPTER_TYPE_UNKNOWN; |
89 } | 89 } |
90 } | 90 } |
91 | 91 |
92 static rtc::IPAddress GetIPAddressFromJava(JNIEnv* jni, jobject j_ip_address) { | 92 static rtc::IPAddress GetIPAddressFromJava(JNIEnv* jni, jobject j_ip_address) { |
93 jclass j_ip_address_class = GetObjectClass(jni, j_ip_address); | 93 jclass j_ip_address_class = GetObjectClass(jni, j_ip_address); |
94 jfieldID j_address_id = GetFieldID(jni, j_ip_address_class, "address", "[B"); | 94 jfieldID j_address_id = GetFieldID(jni, j_ip_address_class, "address", "[B"); |
95 jbyteArray j_addresses = | 95 jbyteArray j_addresses = |
96 static_cast<jbyteArray>(GetObjectField(jni, j_ip_address, j_address_id)); | 96 static_cast<jbyteArray>(GetObjectField(jni, j_ip_address, j_address_id)); |
97 size_t address_length = jni->GetArrayLength(j_addresses); | 97 size_t address_length = jni->GetArrayLength(j_addresses); |
(...skipping 329 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 |