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

Commit e1736e55 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Allow devices without SECURE_LOCK to *clear* PINs"

parents 5db4c839 dfd866da
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -680,7 +680,7 @@ public class LockPatternUtils {
     */
    public boolean setLockCredential(@NonNull LockscreenCredential newCredential,
            @NonNull LockscreenCredential savedCredential, int userHandle) {
        if (!hasSecureLockScreen()) {
        if (!hasSecureLockScreen() && newCredential.getType() != CREDENTIAL_TYPE_NONE) {
            throw new UnsupportedOperationException(
                    "This operation requires the lock screen feature.");
        }
@@ -775,7 +775,7 @@ public class LockPatternUtils {

    /** Update the encryption password if it is enabled **/
    private void updateEncryptionPassword(final int type, final byte[] password) {
        if (!hasSecureLockScreen()) {
        if (!hasSecureLockScreen() && password != null && password.length != 0) {
            throw new UnsupportedOperationException(
                    "This operation requires the lock screen feature.");
        }
@@ -1575,7 +1575,7 @@ public class LockPatternUtils {
     */
    public boolean setLockCredentialWithToken(@NonNull LockscreenCredential credential,
            long tokenHandle, byte[] token, int userHandle) {
        if (!hasSecureLockScreen()) {
        if (!hasSecureLockScreen() && credential.getType() != CREDENTIAL_TYPE_NONE) {
            throw new UnsupportedOperationException(
                    "This operation requires the lock screen feature.");
        }
+7 −3
Original line number Diff line number Diff line
@@ -1090,7 +1090,9 @@ public class LockSettingsService extends ILockSettings.Stub {
    public void setSeparateProfileChallengeEnabled(int userId, boolean enabled,
            LockscreenCredential managedUserPassword) {
        checkWritePermission(userId);
        if (!mHasSecureLockScreen) {
        if (!mHasSecureLockScreen
                && managedUserPassword != null
                && managedUserPassword.getType() != CREDENTIAL_TYPE_NONE) {
            throw new UnsupportedOperationException(
                    "This operation requires secure lock screen feature.");
        }
@@ -1560,7 +1562,8 @@ public class LockSettingsService extends ILockSettings.Stub {
    public boolean setLockCredential(LockscreenCredential credential,
            LockscreenCredential savedCredential, int userId) {

        if (!mHasSecureLockScreen) {
        if (!mHasSecureLockScreen
                && credential != null && credential.getType() != CREDENTIAL_TYPE_NONE) {
            throw new UnsupportedOperationException(
                    "This operation requires secure lock screen feature");
        }
@@ -3423,7 +3426,8 @@ public class LockSettingsService extends ILockSettings.Stub {
        @Override
        public boolean setLockCredentialWithToken(LockscreenCredential credential, long tokenHandle,
                byte[] token, int userId) {
            if (!mHasSecureLockScreen) {
        if (!mHasSecureLockScreen
                && credential != null && credential.getType() != CREDENTIAL_TYPE_NONE) {
                throw new UnsupportedOperationException(
                        "This operation requires secure lock screen feature.");
            }