diff options
author | mdjones <mdjones@chromium.org> | 2016-02-10 18:06:28 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-11 02:07:41 +0000 |
commit | 338a3bb9656e66896c4b28dc08a24c28579ee5f5 (patch) | |
tree | 1b13e7c11aad8ab97c1db6b686401163af365e4f | |
parent | afbb0c0daf4d298811631c36cbd3c0e93997300f (diff) | |
download | chromium_src-338a3bb9656e66896c4b28dc08a24c28579ee5f5.zip chromium_src-338a3bb9656e66896c4b28dc08a24c28579ee5f5.tar.gz chromium_src-338a3bb9656e66896c4b28dc08a24c28579ee5f5.tar.bz2 |
Revert of Native SSID extraction moved to platform code on Android (patchset #8 id:140001 of https://codereview.chromium.org/1633733005/ )
Reason for revert:
Causes instant crash on Android KK, L, and M.
Original issue's description:
> On Android, move Wifi SSID extraction to a Java implementation
>
> On some Android devices, the device will restart right
> after the browser is launched. This is due to a kernel bug on
> these devices when using the Linux GetWifiSSID implementation,
> which causes a kernel panic and device restart.
>
> To avoid this, a Java-based implementation is used for Android
> devices, which avoids this. Examples of affected devices include:
> HTC One S
> Lenovo A820
> Asus ZenFone 2
> MediaPad 10 FHD
>
> R=bengr@chromium.org,rch@chromium.org
> BUG=555067
> TEST=Take the problem device, install browser and start it, wait for
> 10 seconds. Make 10 experiments, cleaning data before each run.
> Device should not reboot.
TBR=bengr@chromium.org,rch@chromium.org,rsleevi@chromium.org,ripp@yandex-team.ru
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=555067
Review URL: https://codereview.chromium.org/1688103002
Cr-Commit-Position: refs/heads/master@{#374833}
-rw-r--r-- | net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java | 32 | ||||
-rw-r--r-- | net/android/network_library.cc | 7 | ||||
-rw-r--r-- | net/android/network_library.h | 3 | ||||
-rw-r--r-- | net/android/unittest_support/AndroidManifest.xml | 1 | ||||
-rw-r--r-- | net/base/network_interfaces_android.cc | 15 | ||||
-rw-r--r-- | net/base/network_interfaces_linux.cc | 2 | ||||
-rw-r--r-- | net/net.gypi | 1 |
7 files changed, 0 insertions, 61 deletions
diff --git a/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java b/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java index 0bc1958..96a9320 100644 --- a/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java +++ b/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java @@ -9,8 +9,6 @@ import android.content.Context; import android.content.Intent; import android.net.ConnectivityManager; import android.net.NetworkInfo; -import android.net.wifi.WifiInfo; -import android.net.wifi.WifiManager; import android.security.KeyChain; import android.telephony.TelephonyManager; import android.util.Log; @@ -230,34 +228,4 @@ class AndroidNetworkLibrary { NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo(); return networkInfo.isRoaming(); } - - /* - * Returns the current SSID if the device is connected to a Wi-Fi network. - */ - @CalledByNative - private static String getWifiSSID(Context context) { - WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); - WifiInfo wifiInfo = wifiManager.getConnectionInfo(); - - if (wifiInfo == null) { - return ""; - } - - String ssid = wifiInfo.getSSID(); - - if (ssid == null || "<unknown ssid>".equals(ssid)) { - return ""; - } - - return removeSurroundingQuotes(ssid); - } - - private static String removeSurroundingQuotes(String string) { - if (string.length() > 2 && string.charAt(0) == '\"' - && string.charAt(string.length() - 1) == '\"') { - return string.substring(1, string.length() - 1); - } - - return string; - } } diff --git a/net/android/network_library.cc b/net/android/network_library.cc index 6837ddc..eb2376e 100644 --- a/net/android/network_library.cc +++ b/net/android/network_library.cc @@ -143,13 +143,6 @@ bool GetIsRoaming() { base::android::GetApplicationContext()); } -std::string GetWifiSSID() { - return base::android::ConvertJavaStringToUTF8( - Java_AndroidNetworkLibrary_getWifiSSID( - base::android::AttachCurrentThread(), - base::android::GetApplicationContext())); -} - bool RegisterNetworkLibrary(JNIEnv* env) { return RegisterNativesImpl(env); } diff --git a/net/android/network_library.h b/net/android/network_library.h index 941ec5da..ddfb5e9 100644 --- a/net/android/network_library.h +++ b/net/android/network_library.h @@ -82,9 +82,6 @@ NET_EXPORT std::string GetTelephonySimOperator(); // true, it suggests that use of data may incur extra costs. NET_EXPORT bool GetIsRoaming(); -// Returns the current SSID if device is connected to a Wi-Fi network. -NET_EXPORT std::string GetWifiSSID(); - // Register JNI methods NET_EXPORT bool RegisterNetworkLibrary(JNIEnv* env); diff --git a/net/android/unittest_support/AndroidManifest.xml b/net/android/unittest_support/AndroidManifest.xml index bf1cf4e..d538c50 100644 --- a/net/android/unittest_support/AndroidManifest.xml +++ b/net/android/unittest_support/AndroidManifest.xml @@ -11,7 +11,6 @@ found in the LICENSE file. android:versionName="1.0"> <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" /> - <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/> <uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> diff --git a/net/base/network_interfaces_android.cc b/net/base/network_interfaces_android.cc deleted file mode 100644 index 8f18fd7..0000000 --- a/net/base/network_interfaces_android.cc +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "net/base/network_interfaces.h" - -#include "net/android/network_library.h" - -namespace net { - -std::string GetWifiSSID() { - return android::GetWifiSSID(); -} - -} // namespace net diff --git a/net/base/network_interfaces_linux.cc b/net/base/network_interfaces_linux.cc index 03030c9..8aea321 100644 --- a/net/base/network_interfaces_linux.cc +++ b/net/base/network_interfaces_linux.cc @@ -215,7 +215,6 @@ bool GetNetworkList(NetworkInterfaceList* networks, int policy) { &internal::AddressTrackerLinux::GetInterfaceName); } -#if !defined(OS_ANDROID) std::string GetWifiSSID() { NetworkInterfaceList networks; if (GetNetworkList(&networks, INCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES)) { @@ -224,6 +223,5 @@ std::string GetWifiSSID() { } return ""; } -#endif // !defined(OS_ANDROID) } // namespace net diff --git a/net/net.gypi b/net/net.gypi index e4686d9..52f5735 100644 --- a/net/net.gypi +++ b/net/net.gypi @@ -503,7 +503,6 @@ 'base/network_delegate.h', 'base/network_delegate_impl.cc', 'base/network_delegate_impl.h', - 'base/network_interfaces_android.cc', 'base/network_interfaces_linux.cc', 'base/network_interfaces_mac.cc', 'base/network_interfaces_win.cc', |