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

Commit 79c0355e authored by Ed Mancebo's avatar Ed Mancebo Committed by Gerrit Code Review
Browse files

Reapply custom lockscreen when switching to swipe mode

When switching back to swipe mode we call clearLock which resets the
password quality to unspecified.  This causes the custom lockscreen to
not show.  We reset the custom lockscreen so that the password quality
is updated accordingly.

Change-Id: I7793a110f1301a3eca8c84687e26780f0f82991a
issue-id: YAM-136
parent 799423dd
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -25,9 +25,11 @@ import android.app.Fragment;
import android.app.FragmentManager;
import android.app.PendingIntent;
import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.UserInfo;
import android.os.Bundle;
import android.os.Process;
@@ -558,6 +560,19 @@ public class ChooseLockGeneric extends SettingsActivity {
                mChooseLockSettingsHelper.utils().clearLock(false);
                mChooseLockSettingsHelper.utils().setLockScreenDisabled(disabled);
                maybeShowRedactionInterstitial();
                if (!disabled) {
                    // If there is a third party keyguard component set and the lockscreen is
                    // still enabled (i.e. swipe) then we want to be in PASSWORD_QUALITY_UNSECURED
                    // mode.  Reapply component to make this happen.
                    ComponentName cn = mLockPatternUtils.getThirdPartyKeyguardComponent();
                    if (cn != null) {
                        try {
                            mLockPatternUtils.setThirdPartyKeyguard(cn);
                        } catch (PackageManager.NameNotFoundException | SecurityException e) {
                            Log.w(TAG, "Failed to reset third party keyguard: " + cn, e);
                        }
                    }
                }
                getActivity().setResult(Activity.RESULT_OK);
                finish();
            } else {