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

Commit d41083ad authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Attempt to fix invisible Keyguard #2

Bug: 17439581
Change-Id: Ib38d9be3271081b33c23b3b17b2ed7790c71729b
parent 2418d738
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ public abstract class PanelView extends FrameLayout {
    private String mViewName;
    private float mInitialTouchY;
    private float mInitialTouchX;
    private boolean mTouchDisabled;

    private Interpolator mLinearOutSlowInInterpolator;
    private Interpolator mFastOutSlowInInterpolator;
@@ -207,9 +208,13 @@ public abstract class PanelView extends FrameLayout {
        event.offsetLocation(-deltaX, -deltaY);
    }

    public void setTouchDisabled(boolean disabled) {
        mTouchDisabled = disabled;
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (mInstantExpanding) {
        if (mInstantExpanding || mTouchDisabled) {
            return false;
        }

+16 −0
Original line number Diff line number Diff line
@@ -404,6 +404,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
    private int mNavigationBarMode;
    private Boolean mScreenOn;

    // The second field is a bit different from the first one because it only listens to screen on/
    // screen of events from Keyguard. We need this so we don't have a race condition with the
    // broadcast. In the future, we should remove the first field altogether and rename the second
    // field.
    private boolean mScreenOnFromKeyguard;

    private ViewMediatorCallback mKeyguardViewMediatorCallback;
    private ScrimController mScrimController;

@@ -3466,6 +3472,13 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
    public void showKeyguard() {
        setBarState(StatusBarState.KEYGUARD);
        updateKeyguardState(false /* goingToFullShade */, false /* fromShadeLocked */);
        if (!mScreenOnFromKeyguard) {

            // If the screen is off already, we need to disable touch events because these might
            // collapse the panel after we expanded it, and thus we would end up with a blank
            // Keyguard.
            mNotificationPanel.setTouchDisabled(true);
        }
        instantExpandNotificationsPanel();
        mLeaveOpenOnKeyguardHide = false;
        if (mDraggedDownRow != null) {
@@ -3870,12 +3883,15 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
    }

    public void onScreenTurnedOff() {
        mScreenOnFromKeyguard = false;
        mStackScroller.setAnimationsEnabled(false);
    }

    public void onScreenTurnedOn() {
        mScreenOnFromKeyguard = true;
        mStackScroller.setAnimationsEnabled(true);
        mNotificationPanel.onScreenTurnedOn();
        mNotificationPanel.setTouchDisabled(false);
    }

    /**