diff options
author | Roshan Pius <rpius@google.com> | 2020-06-02 15:23:57 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-06-02 15:23:57 +0000 |
commit | 6b61b75021ae98eab575dbcf9ccd244d0a821a1e (patch) | |
tree | dcd984bed48107e45d29e6fa0ac7797543651f27 /service | |
parent | 0f971ddd9bb7f839ae7b9aded4dad2a4d4a5ec04 (diff) | |
parent | f1dab06d07b415dd29f62d7e83f0c5e924c9d687 (diff) |
Merge "WifiShellCommand: Return 0 for all handled messages" into rvc-dev
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiShellCommand.java | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/service/java/com/android/server/wifi/WifiShellCommand.java b/service/java/com/android/server/wifi/WifiShellCommand.java index 842493c6d..41933abf0 100644 --- a/service/java/com/android/server/wifi/WifiShellCommand.java +++ b/service/java/com/android/server/wifi/WifiShellCommand.java @@ -372,10 +372,10 @@ public class WifiShellCommand extends BasicShellCommandHandler { if (ApConfigUtil.isWpa3SaeSupported(mContext)) { pw.println("wifi_softap_wpa3_sae_supported"); } - break; + return 0; case "settings-reset": mWifiService.factoryReset(SHELL_PACKAGE_NAME); - break; + return 0; case "list-scan-results": List<ScanResult> scanResults = mWifiService.getScanResults(SHELL_PACKAGE_NAME, null); @@ -385,10 +385,10 @@ public class WifiShellCommand extends BasicShellCommandHandler { ScanResultUtil.dumpScanResults(pw, scanResults, SystemClock.elapsedRealtime()); } - break; + return 0; case "start-scan": mWifiService.startScan(SHELL_PACKAGE_NAME, null); - break; + return 0; case "list-networks": ParceledListSlice<WifiConfiguration> networks = mWifiService.getConfiguredNetworks(SHELL_PACKAGE_NAME, null); @@ -414,7 +414,7 @@ public class WifiShellCommand extends BasicShellCommandHandler { securityType)); } } - break; + return 0; case "connect-network": { CountDownLatch countDownLatch = new CountDownLatch(1); IActionListener.Stub actionListener = new IActionListener.Stub() { @@ -436,7 +436,7 @@ public class WifiShellCommand extends BasicShellCommandHandler { // wait for status. countDownLatch.await(500, TimeUnit.MILLISECONDS); setAutoJoin(pw, config.SSID, config.allowAutojoin); - break; + return 0; } case "add-network": { CountDownLatch countDownLatch = new CountDownLatch(1); @@ -459,7 +459,7 @@ public class WifiShellCommand extends BasicShellCommandHandler { // wait for status. countDownLatch.await(500, TimeUnit.MILLISECONDS); setAutoJoin(pw, config.SSID, config.allowAutojoin); - break; + return 0; } case "forget-network": { String networkId = getNextArgRequired(); @@ -482,21 +482,21 @@ public class WifiShellCommand extends BasicShellCommandHandler { actionListener.hashCode()); // wait for status. countDownLatch.await(500, TimeUnit.MILLISECONDS); - break; + return 0; } case "status": printStatus(pw); - break; + return 0; case "set-verbose-logging": { boolean enabled = getNextArgRequiredTrueOrFalse("enabled", "disabled"); mWifiService.enableVerboseLogging(enabled ? 1 : 0); - break; + return 0; } case "add-suggestion": { WifiNetworkSuggestion suggestion = buildSuggestion(pw); mWifiService.addNetworkSuggestions( Arrays.asList(suggestion), SHELL_PACKAGE_NAME, null); - break; + return 0; } case "remove-suggestion": { String ssid = getNextArgRequired(); @@ -512,12 +512,12 @@ public class WifiShellCommand extends BasicShellCommandHandler { } mWifiService.removeNetworkSuggestions( Arrays.asList(suggestion), SHELL_PACKAGE_NAME); - break; + return 0; } case "remove-all-suggestions": mWifiService.removeNetworkSuggestions( Collections.emptyList(), SHELL_PACKAGE_NAME); - break; + return 0; case "list-suggestions": { List<WifiNetworkSuggestion> suggestions = mWifiService.getNetworkSuggestions(SHELL_PACKAGE_NAME); @@ -548,7 +548,7 @@ public class WifiShellCommand extends BasicShellCommandHandler { securityType)); } } - break; + return 0; } case "add-request": { NetworkRequest networkRequest = buildNetworkRequest(pw); @@ -558,7 +558,7 @@ public class WifiShellCommand extends BasicShellCommandHandler { mConnectivityManager.requestNetwork(networkRequest, networkCallback); String ssid = getAllArgs()[1]; sActiveRequests.put(ssid, Pair.create(networkRequest, networkCallback)); - break; + return 0; } case "remove-request": { String ssid = getNextArgRequired(); @@ -570,7 +570,7 @@ public class WifiShellCommand extends BasicShellCommandHandler { } pw.println("Removing request: " + nrAndNc.first); mConnectivityManager.unregisterNetworkCallback(nrAndNc.second); - break; + return 0; } case "remove-all-requests": if (sActiveRequests.isEmpty()) { @@ -583,7 +583,7 @@ public class WifiShellCommand extends BasicShellCommandHandler { mConnectivityManager.unregisterNetworkCallback(nrAndNc.second); } sActiveRequests.clear(); - break; + return 0; case "list-requests": if (sActiveRequests.isEmpty()) { pw.println("No active requests"); @@ -596,7 +596,7 @@ public class WifiShellCommand extends BasicShellCommandHandler { entry.getKey(), entry.getValue().first)); } } - break; + return 0; case "network-requests-set-user-approved": { String packageName = getNextArgRequired(); boolean approved = getNextArgRequiredTrueOrFalse("yes", "no"); @@ -667,11 +667,12 @@ public class WifiShellCommand extends BasicShellCommandHandler { } } catch (IllegalArgumentException e) { pw.println("Invalid args for " + cmd + ": " + e); + return -1; } catch (Exception e) { pw.println("Exception while executing WifiShellCommand: "); e.printStackTrace(pw); + return -1; } - return -1; } private boolean getNextArgRequiredTrueOrFalse(String trueString, String falseString) |