Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6544099f authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

CTS doesn't like swiping.

It sounds like CTS prefers having the "none" lockscreen instead of
a "swipe" lockscreen, so give it what it wants.  This brings us back
to matching the original behavior of the NYC test.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.DirectBootHostTest#testDirectBootNative
Bug: 36789738
Change-Id: Ibc392362dda22b3df0bc98aa525c65fe70eeb861
parent 60e0c195
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ class LockSettingsShellCommand extends ShellCommand {
    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;
@@ -72,6 +73,9 @@ class LockSettingsShellCommand extends ShellCommand {
                case COMMAND_SP:
                    runEnableSp();
                    break;
                case COMMAND_SET_DISABLED:
                    runSetDisabled();
                    break;
                default:
                    getErrPrintWriter().println("Unknown command: " + cmd);
                    break;
@@ -132,6 +136,12 @@ class LockSettingsShellCommand extends ShellCommand {
        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);