" locksettings set-password [--old OLD_CREDENTIAL] NEW_PASSWORD\n" +
" locksettings clear [--old OLD_CREDENTIAL]\n" +
" locksettings verify [--old OLD_CREDENTIAL]\n" +
+ " locksettings set-disabled DISABLED\n" +
+ " locksettings get-disabled\n" +
"\n" +
"flags: \n" +
" --user USER_ID: specify the user, default value is current user\n" +
"\n" +
"locksettings clear: clears the unlock credential\n" +
"\n" +
- "locksettings verify: verifies the credential and unlocks the user\n";
+ "locksettings verify: verifies the credential and unlocks the user\n" +
+ "\n" +
+ "locksettings set-disabled: sets whether the lock screen should be disabled\n" +
+ "\n" +
+ "locksettings get-disabled: retrieves whether the lock screen is disabled\n";
public static void main(String[] args) {
(new LockSettingsCmd()).run(args);
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;
case COMMAND_VERIFY:
runVerify();
break;
+ case COMMAND_GET_DISABLED:
+ runGetDisabled();
+ break;
default:
getErrPrintWriter().println("Unknown command: " + cmd);
break;
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);