summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardPINView.java11
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java13
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java25
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java2
5 files changed, 38 insertions, 23 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardPINView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardPINView.java
index 4f5152aca6f3..779289429e2f 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardPINView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardPINView.java
@@ -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,9 +140,10 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {
setTranslationY(0);
AppearAnimationUtils.startTranslationYAnimation(this, 0 /* delay */, 280 /* duration */,
mDisappearYTranslation, mDisappearAnimationUtils.getInterpolator());
- DisappearAnimationUtils disappearAnimationUtils = mKeyguardUpdateMonitor.isUserUnlocked()
- ? mDisappearAnimationUtils
- : mDisappearAnimationUtilsLocked;
+ DisappearAnimationUtils disappearAnimationUtils = mKeyguardUpdateMonitor
+ .needsSlowUnlockTransition()
+ ? mDisappearAnimationUtils
+ : mDisappearAnimationUtilsLocked;
disappearAnimationUtils.startAnimation2d(mViews,
new Runnable() {
@Override
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java
index 84b90c44c1a6..506f77d443c6 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java
@@ -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);
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 56f37414a0e6..e169c0d072db 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -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());
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
index 73a95c201bce..35e084db9cd7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -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;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
index def4bc3c5790..664e1030d8a1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -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();