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

Commit be7dea4f authored by Jorim Jaggi's avatar Jorim Jaggi Committed by android-build-merger
Browse files

Fix wrong nav bar animation when unlocking from AOD

am: f5304ad7

Change-Id: I19e8db94e2ad70c8d6e267b0a85e6885cf80305b
parents 6b4ef004 f5304ad7
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.content.Context;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.util.MathUtils;
import android.view.View;
import android.view.ViewGroup;
@@ -102,6 +103,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
    protected long mDurationOverride = -1;
    private long mAnimationDelay;
    private Runnable mOnAnimationFinished;
    private boolean mDeferFinishedListener;
    private final Interpolator mInterpolator = new DecelerateInterpolator();
    private boolean mDozing;
    private float mDozeInFrontAlpha;
@@ -446,7 +448,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
        anim.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                if (mOnAnimationFinished != null) {
                if (!mDeferFinishedListener && mOnAnimationFinished != null) {
                    mOnAnimationFinished.run();
                    mOnAnimationFinished = null;
                }
@@ -557,7 +559,12 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
        float animEndValue = -1;
        if (previousAnimator != null) {
            if (animate || alpha == currentAlpha) {
                // We are not done yet! Defer calling the finished listener.
                if (animate) {
                    mDeferFinishedListener = true;
                }
                previousAnimator.cancel();
                mDeferFinishedListener = false;
            } else {
                animEndValue = ViewState.getChildTag(scrim, TAG_END_ALPHA);
            }
+15 −7
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@

package com.android.systemui.statusbar.phone;

import static com.android.keyguard.KeyguardHostView.OnDismissAction;
import static com.android.systemui.statusbar.phone.FingerprintUnlockController.MODE_WAKE_AND_UNLOCK;
import static com.android.systemui.statusbar.phone.FingerprintUnlockController.MODE_WAKE_AND_UNLOCK_PULSING;

import android.content.ComponentCallbacks2;
import android.content.Context;
import android.os.Bundle;
@@ -30,18 +34,15 @@ import android.view.WindowManagerGlobal;
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.keyguard.LatencyTracker;
import com.android.keyguard.ViewMediatorCallback;
import com.android.systemui.DejankUtils;
import com.android.keyguard.LatencyTracker;
import com.android.systemui.Dependency;
import com.android.systemui.SystemUIFactory;
import com.android.systemui.keyguard.DismissCallbackRegistry;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.RemoteInputController;

import static com.android.keyguard.KeyguardHostView.OnDismissAction;
import static com.android.systemui.statusbar.phone.FingerprintUnlockController.*;

import java.util.ArrayList;

/**
@@ -95,6 +96,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
    protected boolean mLastRemoteInputActive;
    private boolean mLastDozing;
    private boolean mLastDeferScrimFadeOut;
    private int mLastFpMode;

    private OnDismissAction mAfterKeyguardGoneAction;
    private final ArrayList<Runnable> mAfterKeyguardGoneRunnables = new ArrayList<>();
@@ -583,6 +585,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
        mLastRemoteInputActive = remoteInputActive;
        mLastDozing = mDozing;
        mLastDeferScrimFadeOut = mDeferScrimFadeOut;
        mLastFpMode = mFingerprintUnlockController.getMode();
        mStatusBar.onKeyguardViewManagerStatesUpdated();
    }

@@ -590,15 +593,20 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
     * @return Whether the navigation bar should be made visible based on the current state.
     */
    protected boolean isNavBarVisible() {
        return (!(mShowing && !mOccluded) && !mDozing || mBouncer.isShowing() || mRemoteInputActive)
                && !mDeferScrimFadeOut;
        int fpMode = mFingerprintUnlockController.getMode();
        boolean keyguardShowing = mShowing && !mOccluded;
        boolean hideWhileDozing = mDozing && fpMode != MODE_WAKE_AND_UNLOCK_PULSING;
        return (!keyguardShowing && !hideWhileDozing || mBouncer.isShowing()
                || mRemoteInputActive) && !mDeferScrimFadeOut;
    }

    /**
     * @return Whether the navigation bar was made visible based on the last known state.
     */
    protected boolean getLastNavBarVisible() {
        return (!(mLastShowing && !mLastOccluded) && !mLastDozing || mLastBouncerShowing
        boolean keyguardShowing = mLastShowing && !mLastOccluded;
        boolean hideWhileDozing = mLastDozing && mLastFpMode != MODE_WAKE_AND_UNLOCK_PULSING;
        return (!keyguardShowing && !hideWhileDozing || mLastBouncerShowing
                || mLastRemoteInputActive) && !mLastDeferScrimFadeOut;
    }