diff options
author | Roshan Pius <rpius@google.com> | 2020-03-09 12:15:05 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2020-03-09 13:06:06 -0700 |
commit | 1fc832135db1f2940f6e3b8ca676eefecd085515 (patch) | |
tree | 749bcd894750a9d06907c6db03c493c1efbf31cf | |
parent | 87aca9ea9950cb34833559cd84cee28c3e3f84e3 (diff) |
WifiShellCommand: Add a shell command for wifi settings reset
This helps in easy resetting of settings between CtsVerifier tests.
Bug: 150236894
Test: Manually ran these commands between wifi CtsVerifier tests.
Change-Id: I4aba9cf0213ee4f0bcb544e9dc60db9d38eeb8c1
-rw-r--r-- | service/java/com/android/server/wifi/WifiShellCommand.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/WifiShellCommand.java b/service/java/com/android/server/wifi/WifiShellCommand.java index b5198ddf9..53acd66a0 100644 --- a/service/java/com/android/server/wifi/WifiShellCommand.java +++ b/service/java/com/android/server/wifi/WifiShellCommand.java @@ -45,6 +45,7 @@ import java.util.concurrent.TimeUnit; * commands, which is checked using {@link #checkRootPermission()}. */ public class WifiShellCommand extends BasicShellCommandHandler { + private static String SHELL_PACKAGE_NAME = "com.android.shell"; private final ClientModeImpl mClientModeImpl; private final WifiLockManager mWifiLockManager; private final WifiNetworkSuggestionsManager mWifiNetworkSuggestionsManager; @@ -361,7 +362,7 @@ public class WifiShellCommand extends BasicShellCommandHandler { + " or 'disabled'"); return -1; } - mWifiService.setWifiEnabled("com.android.shell", enabled); + mWifiService.setWifiEnabled(SHELL_PACKAGE_NAME, enabled); return 0; } case "get-softap-supported-features": @@ -373,6 +374,9 @@ public class WifiShellCommand extends BasicShellCommandHandler { pw.println("wifi_softap_wpa3_sae_supported"); } break; + case "wifi-settings-reset": + mWifiService.factoryReset(SHELL_PACKAGE_NAME); + break; default: return handleDefaultCommands(cmd); } @@ -495,6 +499,8 @@ public class WifiShellCommand extends BasicShellCommandHandler { pw.println(" get-softap-supported-features"); pw.println(" Gets softap supported features. Will print 'wifi_softap_acs_supported'"); pw.println(" and/or 'wifi_softap_wpa3_sae_supported', each on a separate line."); + pw.println(" wifi-settings-reset"); + pw.println(" Initiates wifi settings reset'"); pw.println(); } } |