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

Commit 60ee7fde authored by Selim Cinek's avatar Selim Cinek
Browse files

Made sure the lock icon is invisible while hunned

Previously the lock icon could become visible briefly
after keyguard went away or when the bouncer was showing
non-scrimmed. This is now fixed.

Bug: 134543453
Test: atest SystemUITests
Change-Id: I6fa8318945439314dbccd06731906365a4a36060
parent 3b077cbf
Loading
Loading
Loading
Loading
+17 −10
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ import com.android.systemui.statusbar.phone.ScrimController.ScrimVisibility;
import com.android.systemui.statusbar.policy.AccessibilityController;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.KeyguardMonitor;
import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener;
import com.android.systemui.statusbar.policy.UserInfoController.OnUserInfoChangedListener;

import java.lang.annotation.Retention;
@@ -67,7 +68,8 @@ import javax.inject.Named;
public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChangedListener,
        StatusBarStateController.StateListener, ConfigurationController.ConfigurationListener,
        UnlockMethodCache.OnUnlockMethodChangedListener,
        NotificationWakeUpCoordinator.WakeUpListener, ViewTreeObserver.OnPreDrawListener {
        NotificationWakeUpCoordinator.WakeUpListener, ViewTreeObserver.OnPreDrawListener,
        OnHeadsUpChangedListener {

    private static final int STATE_LOCKED = 0;
    private static final int STATE_LOCK_OPEN = 1;
@@ -82,6 +84,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
    private final KeyguardMonitor mKeyguardMonitor;
    private final KeyguardBypassController mBypassController;
    private final NotificationWakeUpCoordinator mWakeUpCoordinator;
    private final HeadsUpManagerPhone mHeadsUpManager;

    private int mLastState = 0;
    private boolean mForceUpdate;
@@ -94,7 +97,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
    private boolean mDocked;
    private int mIconColor;
    private float mDozeAmount;
    private boolean mBouncerShowing;
    private boolean mBouncerShowingScrimmed;
    private boolean mWakeAndUnlockRunning;
    private boolean mKeyguardShowing;
    private boolean mShowingLaunchAffordance;
@@ -155,7 +158,8 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
            KeyguardBypassController bypassController,
            NotificationWakeUpCoordinator wakeUpCoordinator,
            KeyguardMonitor keyguardMonitor,
            @Nullable DockManager dockManager) {
            @Nullable DockManager dockManager,
            HeadsUpManagerPhone headsUpManager) {
        super(context, attrs);
        mContext = context;
        mUnlockMethodCache = UnlockMethodCache.getInstance(context);
@@ -167,6 +171,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
        mWakeUpCoordinator = wakeUpCoordinator;
        mKeyguardMonitor = keyguardMonitor;
        mDockManager = dockManager;
        mHeadsUpManager = headsUpManager;
    }

    @Override
@@ -296,12 +301,14 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
        boolean onAodNotPulsingOrDocked = mDozing && (!mPulsing || mDocked);
        boolean invisible = onAodNotPulsingOrDocked || mWakeAndUnlockRunning
                || mShowingLaunchAffordance;
        if (mBypassController.getBypassEnabled()
                && mStatusBarStateController.getState() == StatusBarState.KEYGUARD
                && !mWakeUpCoordinator.getNotificationsFullyHidden()
                && !mBouncerShowing) {
        if (mBypassController.getBypassEnabled() && !mBouncerShowingScrimmed) {
            if (mHeadsUpManager.isHeadsUpGoingAway()
                    || mHeadsUpManager.hasPinnedHeadsUp()
                    || (mStatusBarStateController.getState() == StatusBarState.KEYGUARD
                    && !mWakeUpCoordinator.getNotificationsFullyHidden())) {
                invisible = true;
            }
        }
        boolean wasInvisible = getVisibility() == INVISIBLE;
        if (invisible != wasInvisible) {
            setVisibility(invisible ? INVISIBLE : VISIBLE);
@@ -408,8 +415,8 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
        }
    }

    public void setBouncerShowing(boolean bouncerShowing) {
        mBouncerShowing = bouncerShowing;
    public void setBouncerShowingScrimmed(boolean bouncerShowing) {
        mBouncerShowingScrimmed = bouncerShowing;
        if (mBypassController.getBypassEnabled()) {
            update();
        }
+1 −1
Original line number Diff line number Diff line
@@ -3576,7 +3576,7 @@ public class StatusBar extends SystemUI implements DemoMode,
        mBouncerShowing = bouncerShowing;
        mKeyguardBypassController.setBouncerShowing(bouncerShowing);
        mPulseExpansionHandler.setBouncerShowing(bouncerShowing);
        mStatusBarWindow.setBouncerShowing(bouncerShowing);
        mStatusBarWindow.setBouncerShowingScrimmed(isBouncerShowingScrimmed());
        if (mStatusBarView != null) mStatusBarView.setBouncerShowing(bouncerShowing);
        updateHideIconsForBouncer(true /* animate */);
        mCommandQueue.recomputeDisableFlags(mDisplayId, true /* animate */);
+2 −2
Original line number Diff line number Diff line
@@ -525,9 +525,9 @@ public class StatusBarWindowView extends FrameLayout {
        mBypassController = bypassController;
    }

    public void setBouncerShowing(boolean bouncerShowing) {
    public void setBouncerShowingScrimmed(boolean bouncerShowing) {
        if (mLockIcon != null) {
            mLockIcon.setBouncerShowing(bouncerShowing);
            mLockIcon.setBouncerShowingScrimmed(bouncerShowing);
        }
    }