Add get-disabled shell command to locksettings
Added shell command that outputs whether the lock screen is disabled.
Test: Ran "adb shell locksettings get-disabled" while phone had lock
screen and when it did not.
Change-Id: I3532e41e2ee4770bd0801dd431fdbc884c2bafa4
diff --git a/services/core/java/com/android/server/locksettings/LockSettingsShellCommand.java b/services/core/java/com/android/server/locksettings/LockSettingsShellCommand.java
index d39679d..4d2cf32 100644
--- a/services/core/java/com/android/server/locksettings/LockSettingsShellCommand.java
+++ b/services/core/java/com/android/server/locksettings/LockSettingsShellCommand.java
@@ -37,6 +37,7 @@
private static final String COMMAND_SP = "sp";
private static final String COMMAND_SET_DISABLED = "set-disabled";
private static final String COMMAND_VERIFY = "verify";
+ private static final String COMMAND_GET_DISABLED = "get-disabled";
private int mCurrentUserId;
private final LockPatternUtils mLockPatternUtils;
@@ -80,6 +81,9 @@
case COMMAND_VERIFY:
runVerify();
break;
+ case COMMAND_GET_DISABLED:
+ runGetDisabled();
+ break;
default:
getErrPrintWriter().println("Unknown command: " + cmd);
break;
@@ -156,6 +160,11 @@
getOutPrintWriter().println("Lock screen disabled set to " + disabled);
}
+ private void runGetDisabled() {
+ boolean isLockScreenDisabled = mLockPatternUtils.isLockScreenDisabled(mCurrentUserId);
+ getOutPrintWriter().println(isLockScreenDisabled);
+ }
+
private boolean checkCredential() throws RemoteException {
final boolean havePassword = mLockPatternUtils.isLockPasswordEnabled(mCurrentUserId);
final boolean havePattern = mLockPatternUtils.isLockPatternEnabled(mCurrentUserId);