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

Commit 81b4778d authored by Aaron Liu's avatar Aaron Liu Committed by Android Build Coastguard Worker
Browse files

DO NOT MERGE Ensure finish lockscreen when usersetup incomplete

Ensure that when the usersetup for the user is not complete, we do not
want to go to lockscreen, even if lockscreen is not disabled.

Bug: 222446076
Test: add Unit test,
Test: Wipe device, auth sim pin in setup, observe that lockscreen is
not there.
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:01ea2f91df5a1c67da2546d83beeee75c2c1ef94)
Merged-In: I8e33db8eb6e2c917966cab3d6a4f982670473040
Change-Id: I8e33db8eb6e2c917966cab3d6a4f982670473040
parent 4ae79c14
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -76,6 +76,7 @@ import com.android.systemui.Interpolators;
import com.android.systemui.R;
import com.android.systemui.R;
import com.android.systemui.SystemUIFactory;
import com.android.systemui.SystemUIFactory;
import com.android.systemui.shared.system.SysUiStatsLog;
import com.android.systemui.shared.system.SysUiStatsLog;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.util.InjectionInflationController;
import com.android.systemui.util.InjectionInflationController;


@@ -137,6 +138,7 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
    private boolean mIsDragging;
    private boolean mIsDragging;
    private float mStartTouchY = -1;
    private float mStartTouchY = -1;
    private boolean mDisappearAnimRunning;
    private boolean mDisappearAnimRunning;
    private final DeviceProvisionedController mDeviceProvisionedController;


    private final WindowInsetsAnimation.Callback mWindowInsetsAnimationCallback =
    private final WindowInsetsAnimation.Callback mWindowInsetsAnimationCallback =
            new WindowInsetsAnimation.Callback(DISPATCH_MODE_STOP) {
            new WindowInsetsAnimation.Callback(DISPATCH_MODE_STOP) {
@@ -261,6 +263,7 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
        mKeyguardStateController = Dependency.get(KeyguardStateController.class);
        mKeyguardStateController = Dependency.get(KeyguardStateController.class);
        mSecondaryLockScreenController = new AdminSecondaryLockScreenController(context, this,
        mSecondaryLockScreenController = new AdminSecondaryLockScreenController(context, this,
                mUpdateMonitor, mCallback, new Handler(Looper.myLooper()));
                mUpdateMonitor, mCallback, new Handler(Looper.myLooper()));
       mDeviceProvisionedController = Dependency.get(DeviceProvisionedController.class);
    }
    }


    public void setSecurityCallback(SecurityCallback callback) {
    public void setSecurityCallback(SecurityCallback callback) {
@@ -726,8 +729,11 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
                case SimPuk:
                case SimPuk:
                    // Shortcut for SIM PIN/PUK to go to directly to user's security screen or home
                    // Shortcut for SIM PIN/PUK to go to directly to user's security screen or home
                    SecurityMode securityMode = mSecurityModel.getSecurityMode(targetUserId);
                    SecurityMode securityMode = mSecurityModel.getSecurityMode(targetUserId);
                    if (securityMode == SecurityMode.None || mLockPatternUtils.isLockScreenDisabled(
                    boolean isLockscreenDisabled = mLockPatternUtils.isLockScreenDisabled(
                            KeyguardUpdateMonitor.getCurrentUser())) {
                            KeyguardUpdateMonitor.getCurrentUser())
                            || !mDeviceProvisionedController.isUserSetup(targetUserId);

                    if (securityMode == SecurityMode.None && isLockscreenDisabled) {
                        finish = true;
                        finish = true;
                        eventSubtype = BOUNCER_DISMISS_SIM;
                        eventSubtype = BOUNCER_DISMISS_SIM;
                        uiEvent = BouncerUiEvent.BOUNCER_DISMISS_SIM;
                        uiEvent = BouncerUiEvent.BOUNCER_DISMISS_SIM;