diff options
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiNetworkFactory.java | 8 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/WifiShellCommand.java | 10 |
2 files changed, 13 insertions, 5 deletions
diff --git a/service/java/com/android/server/wifi/WifiNetworkFactory.java b/service/java/com/android/server/wifi/WifiNetworkFactory.java index 271bbefc4..26e602354 100644 --- a/service/java/com/android/server/wifi/WifiNetworkFactory.java +++ b/service/java/com/android/server/wifi/WifiNetworkFactory.java @@ -645,11 +645,11 @@ public class WifiNetworkFactory extends NetworkFactory { return; } if (Objects.equals(mActiveSpecificNetworkRequest, networkRequest)) { - Log.i(TAG, "App released request, cancelling " + Log.i(TAG, "App released active request, cancelling " + mActiveSpecificNetworkRequest); teardownForActiveRequest(); } else if (Objects.equals(mConnectedSpecificNetworkRequest, networkRequest)) { - Log.i(TAG, "App released request, cancelling " + Log.i(TAG, "App released connected request, cancelling " + mConnectedSpecificNetworkRequest); teardownForConnectedNetwork(); } else { @@ -985,6 +985,10 @@ public class WifiNetworkFactory extends NetworkFactory { // Invoked at the termination of current active request processing. private void teardownForActiveRequest() { + if (mPendingConnectionSuccess) { + Log.i(TAG, "Disconnecting from network on reset"); + disconnectAndRemoveNetworkFromWifiConfigManager(mUserSelectedNetwork); + } cleanupActiveRequest(); // ensure there is no connected request in progress. if (mConnectedSpecificNetworkRequest == null) { diff --git a/service/java/com/android/server/wifi/WifiShellCommand.java b/service/java/com/android/server/wifi/WifiShellCommand.java index 1ec56b4ab..64b29f2ac 100644 --- a/service/java/com/android/server/wifi/WifiShellCommand.java +++ b/service/java/com/android/server/wifi/WifiShellCommand.java @@ -470,9 +470,13 @@ public class WifiShellCommand extends BasicShellCommandHandler { pw.println("Wifi is connected to " + info.getSSID()); pw.println("WifiInfo: " + info); Network network = mWifiService.getCurrentNetwork(); - NetworkCapabilities capabilities = - mConnectivityManager.getNetworkCapabilities(network); - pw.println("NetworkCapabilities: " + capabilities); + try { + NetworkCapabilities capabilities = + mConnectivityManager.getNetworkCapabilities(network); + pw.println("NetworkCapabilities: " + capabilities); + } catch (SecurityException e) { + // ignore on unrooted shell. + } } else { pw.println("Wifi is not connected"); } |