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

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

Issue 1668673003: Do not notify networkconnect if the connection type is unknown. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: merge and also check connection type is not NONE Created 4 years, 10 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
« no previous file with comments | « talk/app/webrtc/java/android/org/webrtc/NetworkMonitorAutoDetect.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 if (enum_name == "CONNECTION_NONE") { 67 if (enum_name == "CONNECTION_NONE") {
68 return NetworkType::NETWORK_NONE; 68 return NetworkType::NETWORK_NONE;
69 } 69 }
70 ASSERT(false); 70 ASSERT(false);
71 return NetworkType::NETWORK_UNKNOWN; 71 return NetworkType::NETWORK_UNKNOWN;
72 } 72 }
73 73
74 static rtc::AdapterType AdapterTypeFromNetworkType(NetworkType network_type) { 74 static rtc::AdapterType AdapterTypeFromNetworkType(NetworkType network_type) {
75 switch (network_type) { 75 switch (network_type) {
76 case NETWORK_UNKNOWN: 76 case NETWORK_UNKNOWN:
77 LOG(LS_WARNING) << "Unknown network type"; 77 RTC_DCHECK(false) << "Unknown network type";
78 return rtc::ADAPTER_TYPE_UNKNOWN; 78 return rtc::ADAPTER_TYPE_UNKNOWN;
79 case NETWORK_ETHERNET: 79 case NETWORK_ETHERNET:
80 return rtc::ADAPTER_TYPE_ETHERNET; 80 return rtc::ADAPTER_TYPE_ETHERNET;
81 case NETWORK_WIFI: 81 case NETWORK_WIFI:
82 return rtc::ADAPTER_TYPE_WIFI; 82 return rtc::ADAPTER_TYPE_WIFI;
83 case NETWORK_4G: 83 case NETWORK_4G:
84 case NETWORK_3G: 84 case NETWORK_3G:
85 case NETWORK_2G: 85 case NETWORK_2G:
86 return rtc::ADAPTER_TYPE_CELLULAR; 86 return rtc::ADAPTER_TYPE_CELLULAR;
87 case NETWORK_BLUETOOTH: 87 case NETWORK_BLUETOOTH:
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 JOW(void, NetworkMonitor_nativeNotifyOfNetworkDisconnect)( 375 JOW(void, NetworkMonitor_nativeNotifyOfNetworkDisconnect)(
376 JNIEnv* jni, jobject j_monitor, jlong j_native_monitor, 376 JNIEnv* jni, jobject j_monitor, jlong j_native_monitor,
377 jint network_handle) { 377 jint network_handle) {
378 AndroidNetworkMonitor* network_monitor = 378 AndroidNetworkMonitor* network_monitor =
379 reinterpret_cast<AndroidNetworkMonitor*>(j_native_monitor); 379 reinterpret_cast<AndroidNetworkMonitor*>(j_native_monitor);
380 network_monitor->OnNetworkDisconnected( 380 network_monitor->OnNetworkDisconnected(
381 static_cast<NetworkHandle>(network_handle)); 381 static_cast<NetworkHandle>(network_handle));
382 } 382 }
383 383
384 } // namespace webrtc_jni 384 } // namespace webrtc_jni
OLDNEW
« no previous file with comments | « talk/app/webrtc/java/android/org/webrtc/NetworkMonitorAutoDetect.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698