private static final String COMMAND_SET_PASSWORD = "set-password";
private static final String COMMAND_CLEAR = "clear";
private static final String COMMAND_SP = "sp";
+ private static final String COMMAND_SET_DISABLED = "set-disabled";
private int mCurrentUserId;
private final LockPatternUtils mLockPatternUtils;
case COMMAND_SP:
runEnableSp();
break;
+ case COMMAND_SET_DISABLED:
+ runSetDisabled();
+ break;
default:
getErrPrintWriter().println("Unknown command: " + cmd);
break;
getOutPrintWriter().println("Lock credential cleared");
}
+ private void runSetDisabled() throws RemoteException {
+ final boolean disabled = Boolean.parseBoolean(mNew);
+ mLockPatternUtils.setLockScreenDisabled(disabled, mCurrentUserId);
+ getOutPrintWriter().println("Lock screen disabled set to " + disabled);
+ }
+
private boolean checkCredential() throws RemoteException, RequestThrottledException {
final boolean havePassword = mLockPatternUtils.isLockPasswordEnabled(mCurrentUserId);
final boolean havePattern = mLockPatternUtils.isLockPatternEnabled(mCurrentUserId);