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

Commit dc77fbca authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I955f9dfa,Ibfbb9d67 into nyc-mr1-dev

* changes:
  Only show optimizing storage dialog if dex opt dialog was shown
  Only do slow unlock transition if real home is not running
parents 35788672 2578becc
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -16,12 +16,8 @@

package com.android.keyguard;

import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.util.AttributeSet;
import android.view.RenderNode;
import android.view.RenderNodeAnimator;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
@@ -144,7 +140,8 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {
        setTranslationY(0);
        AppearAnimationUtils.startTranslationYAnimation(this, 0 /* delay */, 280 /* duration */,
                mDisappearYTranslation, mDisappearAnimationUtils.getInterpolator());
        DisappearAnimationUtils disappearAnimationUtils = mKeyguardUpdateMonitor.isUserUnlocked()
        DisappearAnimationUtils disappearAnimationUtils = mKeyguardUpdateMonitor
                .needsSlowUnlockTransition()
                        ? mDisappearAnimationUtils
                        : mDisappearAnimationUtilsLocked;
        disappearAnimationUtils.startAnimation2d(mViews,
+7 −6
Original line number Diff line number Diff line
@@ -408,9 +408,9 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit

    @Override
    public boolean startDisappearAnimation(final Runnable finishRunnable) {
        float durationMultiplier = mKeyguardUpdateMonitor.isUserUnlocked()
                ? 1f
                : DISAPPEAR_MULTIPLIER_LOCKED;
        float durationMultiplier = mKeyguardUpdateMonitor.needsSlowUnlockTransition()
                ? DISAPPEAR_MULTIPLIER_LOCKED
                : 1f;
        mLockPatternView.clearPattern();
        enableClipping(false);
        setTranslationY(0);
@@ -419,9 +419,10 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
                -mDisappearAnimationUtils.getStartTranslation(),
                mDisappearAnimationUtils.getInterpolator());

        DisappearAnimationUtils disappearAnimationUtils = mKeyguardUpdateMonitor.isUserUnlocked()
                ? mDisappearAnimationUtils
                : mDisappearAnimationUtilsLocked;
        DisappearAnimationUtils disappearAnimationUtils = mKeyguardUpdateMonitor
                .needsSlowUnlockTransition()
                        ? mDisappearAnimationUtilsLocked
                        : mDisappearAnimationUtils;
        disappearAnimationUtils.startAnimation2d(mLockPatternView.getCellStates(),
                () -> {
                    enableClipping(true);
+21 −4
Original line number Diff line number Diff line
@@ -34,9 +34,12 @@ import android.app.PendingIntent;
import android.app.admin.DevicePolicyManager;
import android.app.trust.TrustManager;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.database.ContentObserver;
import android.graphics.Bitmap;
import android.hardware.fingerprint.FingerprintManager;
@@ -159,6 +162,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {

    private static final int DEFAULT_CHARGING_VOLTAGE_MICRO_VOLT = 5000000;

    private static final ComponentName FALLBACK_HOME_COMPONENT = new ComponentName(
            "com.android.settings", "com.android.settings.FallbackHome");

    private static KeyguardUpdateMonitor sInstance;

    private final Context mContext;
@@ -177,7 +183,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
    private boolean mGoingToSleep;
    private boolean mBouncer;
    private boolean mBootCompleted;
    private boolean mUserUnlocked;
    private boolean mNeedsSlowUnlockTransition;
    private boolean mHasLockscreenWallpaper;

    // Device provisioning state
@@ -572,8 +578,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
                && !hasFingerprintUnlockTimedOut(sCurrentUser);
    }

    public boolean isUserUnlocked() {
        return mUserUnlocked;
    public boolean needsSlowUnlockTransition() {
        return mNeedsSlowUnlockTransition;
    }

    public StrongAuthTracker getStrongAuthTracker() {
@@ -1444,7 +1450,18 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
    private void handleKeyguardReset() {
        if (DEBUG) Log.d(TAG, "handleKeyguardReset");
        updateFingerprintListeningState();
        mUserUnlocked = mUserManager.isUserUnlocked(getCurrentUser());
        mNeedsSlowUnlockTransition = resolveNeedsSlowUnlockTransition();
    }

    private boolean resolveNeedsSlowUnlockTransition() {
        if (mUserManager.isUserUnlocked(getCurrentUser())) {
            return false;
        }
        Intent homeIntent = new Intent(Intent.ACTION_MAIN)
                .addCategory(Intent.CATEGORY_HOME);
        ResolveInfo resolveInfo = mContext.getPackageManager().resolveActivity(homeIntent,
                0 /* flags */);
        return FALLBACK_HOME_COMPONENT.equals(resolveInfo.getComponentInfo().getComponentName());
    }

    /**
+5 −5
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
        mSkipFirstFrame = skipFirstFrame;
        mOnAnimationFinished = onAnimationFinished;

        if (mKeyguardUpdateMonitor.isUserUnlocked()) {
        if (!mKeyguardUpdateMonitor.needsSlowUnlockTransition()) {
            scheduleUpdate();

            // No need to wait for the next frame to be drawn for this case - onPreDraw will execute
@@ -241,9 +241,9 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
    }

    private float getScrimInFrontAlpha() {
        return mKeyguardUpdateMonitor.isUserUnlocked()
                ? SCRIM_IN_FRONT_ALPHA
                : SCRIM_IN_FRONT_ALPHA_LOCKED;
        return mKeyguardUpdateMonitor.needsSlowUnlockTransition()
                ? SCRIM_IN_FRONT_ALPHA_LOCKED
                : SCRIM_IN_FRONT_ALPHA;
    }
    private void scheduleUpdate() {
        if (mUpdatePending) return;
@@ -405,7 +405,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
    }

    private Interpolator getInterpolator() {
        if (mAnimateKeyguardFadingOut && !mKeyguardUpdateMonitor.isUserUnlocked()) {
        if (mAnimateKeyguardFadingOut && mKeyguardUpdateMonitor.needsSlowUnlockTransition()) {
            return KEYGUARD_FADE_OUT_INTERPOLATOR_LOCKED;
        } else if (mAnimateKeyguardFadingOut) {
            return KEYGUARD_FADE_OUT_INTERPOLATOR;
+1 −1
Original line number Diff line number Diff line
@@ -291,7 +291,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
    public void hide(long startTime, long fadeoutDuration) {
        mShowing = false;

        if (!KeyguardUpdateMonitor.getInstance(mContext).isUserUnlocked()) {
        if (KeyguardUpdateMonitor.getInstance(mContext).needsSlowUnlockTransition()) {
            fadeoutDuration = KEYGUARD_DISMISS_DURATION_LOCKED;
        }
        long uptimeMillis = SystemClock.uptimeMillis();
Loading