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

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

Fix issues with light status bar and fp wake-and-unlock

- When wake-and-unlocking, make sure to skip the light status bar
transition.
- Fix race condition with window manager when unlocking when device
is interactive for supplying the timings for the light status bar
transition.
- Fix media artwork when wake-and-unlocking while pulsing.

Bug: 23365544
Change-Id: I209ca1e6684811f5f313354ca1614a0ebd49388c
parent 8a8885b9
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -183,8 +183,11 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback {
                mStatusBarKeyguardViewManager.animateCollapsePanels(
                        FINGERPRINT_COLLAPSE_SPEEDUP_FACTOR);
                break;
            case MODE_WAKE_AND_UNLOCK:
            case MODE_WAKE_AND_UNLOCK_PULSING:
                mPhoneStatusBar.updateMediaMetaData(false /* metaDataChanged */);
                // Fall through.
            case MODE_WAKE_AND_UNLOCK:
                mStatusBarWindowManager.setStatusBarFocusable(false);
                mDozeScrimController.abortPulsing();
                mKeyguardViewMediator.onWakeAndUnlocking();
                mScrimController.setWakeAndUnlocking();
+45 −29
Original line number Diff line number Diff line
@@ -1694,7 +1694,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        final boolean hasArtwork = artworkBitmap != null;

        if ((hasArtwork || DEBUG_MEDIA_FAKE_ARTWORK)
                && (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED)) {
                && (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED)
                && mFingerprintUnlockController.getMode()
                        != FingerprintUnlockController.MODE_WAKE_AND_UNLOCK_PULSING) {
            // time to show some art!
            if (mBackdrop.getVisibility() != View.VISIBLE) {
                mBackdrop.setVisibility(View.VISIBLE);
@@ -1749,10 +1751,17 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                if (DEBUG_MEDIA) {
                    Log.v(TAG, "DEBUG_MEDIA: Fading out album artwork");
                }
                if (mFingerprintUnlockController.getMode()
                        == FingerprintUnlockController.MODE_WAKE_AND_UNLOCK_PULSING) {

                    // We are unlocking directly - no animation!
                    mBackdrop.setVisibility(View.GONE);
                } else {
                    mBackdrop.animate()
                            // Never let the alpha become zero - otherwise the RenderNode
                            // won't draw anything and uninitialized memory will show through
                        // if mScrimSrcModeEnabled. Note that 0.001 is rounded down to 0 in libhwui.
                            // if mScrimSrcModeEnabled. Note that 0.001 is rounded down to 0 in
                            // libhwui.
                            .alpha(0.002f)
                            .setInterpolator(mBackdropInterpolator)
                            .setDuration(300)
@@ -1769,7 +1778,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                    if (mKeyguardFadingAway) {
                        mBackdrop.animate()

                            // Make it disappear faster, as the focus should be on the activity behind.
                                // Make it disappear faster, as the focus should be on the activity
                                // behind.
                                .setDuration(mKeyguardFadingAwayDuration / 2)
                                .setStartDelay(mKeyguardFadingAwayDelay)
                                .setInterpolator(mLinearInterpolator)
@@ -1778,6 +1788,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                }
            }
        }
    }

    private int adjustDisableFlags(int state) {
        if (!mLaunchTransitionFadingAway && !mKeyguardFadingAway
@@ -2436,8 +2447,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                        || mStatusBarMode == MODE_LIGHTS_OUT_TRANSPARENT);
                boolean allowLight = isTransparentBar && !mBatteryController.isPowerSave();
                boolean light = (vis & View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR) != 0;

                mIconController.setIconsDark(allowLight && light);
                boolean animate = mFingerprintUnlockController == null
                        || (mFingerprintUnlockController.getMode()
                                != FingerprintUnlockController.MODE_WAKE_AND_UNLOCK_PULSING
                        && mFingerprintUnlockController.getMode()
                                != FingerprintUnlockController.MODE_WAKE_AND_UNLOCK);
                mIconController.setIconsDark(allowLight && light, animate);
            }
            // restore the recents bit
            if (wasRecentsVisible) {
@@ -4029,8 +4044,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
    public void appTransitionStarting(long startTime, long duration) {

        // Use own timings when Keyguard is going away, see keyguardGoingAway and
        // setKeyguardFadingAway
        if (!mKeyguardFadingAway) {
        // setKeyguardFadingAway. When duration is 0, skip this one because no animation is really
        // playing.
        if (!mKeyguardFadingAway && duration > 0) {
            mIconController.appTransitionStarting(startTime, duration);
        }
        if (mIconPolicy != null) {
+4 −2
Original line number Diff line number Diff line
@@ -335,8 +335,10 @@ public class StatusBarIconController implements Tunable {
        }
    }

    public void setIconsDark(boolean dark) {
        if (mTransitionPending) {
    public void setIconsDark(boolean dark, boolean animate) {
        if (!animate) {
            setIconTintInternal(dark ? 1.0f : 0.0f);
        } else if (mTransitionPending) {
            deferIconTintChange(dark ? 1.0f : 0.0f);
        } else if (mTransitionDeferring) {
            animateIconTint(dark ? 1.0f : 0.0f,
+3 −1
Original line number Diff line number Diff line
@@ -72,7 +72,9 @@ public class StatusBarController extends BarController {
                        if (statusbar != null) {
                            long startTime = calculateStatusBarTransitionStartTime(openAnimation,
                                    closeAnimation);
                            statusbar.appTransitionStarting(startTime, TRANSITION_DURATION);
                            long duration = closeAnimation != null || openAnimation != null
                                    ? TRANSITION_DURATION : 0;
                            statusbar.appTransitionStarting(startTime, duration);
                        }
                    } catch (RemoteException e) {
                        Slog.e(mTag, "RemoteException when app transition is starting", e);