Merge "Longer bouncer delay and simpler delay logic" into qt-r1-dev
This commit is contained in:
@@ -933,6 +933,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
|
|||||||
== LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN;
|
== LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean userNeedsStrongAuth() {
|
||||||
|
return mStrongAuthTracker.getStrongAuthForUser(getCurrentUser())
|
||||||
|
!= LockPatternUtils.StrongAuthTracker.STRONG_AUTH_NOT_REQUIRED;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean needsSlowUnlockTransition() {
|
public boolean needsSlowUnlockTransition() {
|
||||||
return mNeedsSlowUnlockTransition;
|
return mNeedsSlowUnlockTransition;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ import com.android.systemui.statusbar.phone.ScrimState;
|
|||||||
import com.android.systemui.statusbar.phone.ShadeController;
|
import com.android.systemui.statusbar.phone.ShadeController;
|
||||||
import com.android.systemui.statusbar.phone.StatusBar;
|
import com.android.systemui.statusbar.phone.StatusBar;
|
||||||
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
||||||
|
import com.android.systemui.statusbar.phone.UnlockMethodCache;
|
||||||
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
|
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
|
||||||
import com.android.systemui.util.InjectionInflationController;
|
import com.android.systemui.util.InjectionInflationController;
|
||||||
import com.android.systemui.util.leak.GarbageMonitor;
|
import com.android.systemui.util.leak.GarbageMonitor;
|
||||||
@@ -130,8 +131,8 @@ public class SystemUIFactory {
|
|||||||
KeyguardBouncer.BouncerExpansionCallback expansionCallback) {
|
KeyguardBouncer.BouncerExpansionCallback expansionCallback) {
|
||||||
return new KeyguardBouncer(context, callback, lockPatternUtils, container,
|
return new KeyguardBouncer(context, callback, lockPatternUtils, container,
|
||||||
dismissCallbackRegistry, FalsingManagerFactory.getInstance(context),
|
dismissCallbackRegistry, FalsingManagerFactory.getInstance(context),
|
||||||
expansionCallback, KeyguardUpdateMonitor.getInstance(context),
|
expansionCallback, UnlockMethodCache.getInstance(context),
|
||||||
new Handler(Looper.getMainLooper()));
|
KeyguardUpdateMonitor.getInstance(context), new Handler(Looper.getMainLooper()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ScrimController createScrimController(ScrimView scrimBehind, ScrimView scrimInFront,
|
public ScrimController createScrimController(ScrimView scrimBehind, ScrimView scrimInFront,
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ import java.io.PrintWriter;
|
|||||||
public class KeyguardBouncer {
|
public class KeyguardBouncer {
|
||||||
|
|
||||||
private static final String TAG = "KeyguardBouncer";
|
private static final String TAG = "KeyguardBouncer";
|
||||||
static final long BOUNCER_FACE_DELAY = 800;
|
static final long BOUNCER_FACE_DELAY = 1200;
|
||||||
static final float ALPHA_EXPANSION_THRESHOLD = 0.95f;
|
static final float ALPHA_EXPANSION_THRESHOLD = 0.95f;
|
||||||
static final float EXPANSION_HIDDEN = 1f;
|
static final float EXPANSION_HIDDEN = 1f;
|
||||||
static final float EXPANSION_VISIBLE = 0f;
|
static final float EXPANSION_VISIBLE = 0f;
|
||||||
@@ -68,6 +68,7 @@ public class KeyguardBouncer {
|
|||||||
private final Handler mHandler;
|
private final Handler mHandler;
|
||||||
private final BouncerExpansionCallback mExpansionCallback;
|
private final BouncerExpansionCallback mExpansionCallback;
|
||||||
private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
|
private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
|
||||||
|
private final UnlockMethodCache mUnlockMethodCache;
|
||||||
private final KeyguardUpdateMonitorCallback mUpdateMonitorCallback =
|
private final KeyguardUpdateMonitorCallback mUpdateMonitorCallback =
|
||||||
new KeyguardUpdateMonitorCallback() {
|
new KeyguardUpdateMonitorCallback() {
|
||||||
@Override
|
@Override
|
||||||
@@ -95,7 +96,7 @@ public class KeyguardBouncer {
|
|||||||
public KeyguardBouncer(Context context, ViewMediatorCallback callback,
|
public KeyguardBouncer(Context context, ViewMediatorCallback callback,
|
||||||
LockPatternUtils lockPatternUtils, ViewGroup container,
|
LockPatternUtils lockPatternUtils, ViewGroup container,
|
||||||
DismissCallbackRegistry dismissCallbackRegistry, FalsingManager falsingManager,
|
DismissCallbackRegistry dismissCallbackRegistry, FalsingManager falsingManager,
|
||||||
BouncerExpansionCallback expansionCallback,
|
BouncerExpansionCallback expansionCallback, UnlockMethodCache unlockMethodCache,
|
||||||
KeyguardUpdateMonitor keyguardUpdateMonitor, Handler handler) {
|
KeyguardUpdateMonitor keyguardUpdateMonitor, Handler handler) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mCallback = callback;
|
mCallback = callback;
|
||||||
@@ -106,6 +107,7 @@ public class KeyguardBouncer {
|
|||||||
mDismissCallbackRegistry = dismissCallbackRegistry;
|
mDismissCallbackRegistry = dismissCallbackRegistry;
|
||||||
mExpansionCallback = expansionCallback;
|
mExpansionCallback = expansionCallback;
|
||||||
mHandler = handler;
|
mHandler = handler;
|
||||||
|
mUnlockMethodCache = unlockMethodCache;
|
||||||
mKeyguardUpdateMonitor.registerCallback(mUpdateMonitorCallback);
|
mKeyguardUpdateMonitor.registerCallback(mUpdateMonitorCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +170,8 @@ public class KeyguardBouncer {
|
|||||||
|
|
||||||
// Split up the work over multiple frames.
|
// Split up the work over multiple frames.
|
||||||
DejankUtils.removeCallbacks(mResetRunnable);
|
DejankUtils.removeCallbacks(mResetRunnable);
|
||||||
if (mKeyguardUpdateMonitor.isFaceDetectionRunning()) {
|
if (mUnlockMethodCache.isUnlockingWithFacePossible() && !needsFullscreenBouncer()
|
||||||
|
&& !mKeyguardUpdateMonitor.userNeedsStrongAuth()) {
|
||||||
mHandler.postDelayed(mShowRunnable, BOUNCER_FACE_DELAY);
|
mHandler.postDelayed(mShowRunnable, BOUNCER_FACE_DELAY);
|
||||||
} else {
|
} else {
|
||||||
DejankUtils.postAfterTraversal(mShowRunnable);
|
DejankUtils.postAfterTraversal(mShowRunnable);
|
||||||
|
|||||||
@@ -82,6 +82,8 @@ public class KeyguardBouncerTest extends SysuiTestCase {
|
|||||||
@Mock
|
@Mock
|
||||||
private KeyguardUpdateMonitor mKeyguardUpdateMonitor;
|
private KeyguardUpdateMonitor mKeyguardUpdateMonitor;
|
||||||
@Mock
|
@Mock
|
||||||
|
private UnlockMethodCache mUnlockMethodCache;
|
||||||
|
@Mock
|
||||||
private Handler mHandler;
|
private Handler mHandler;
|
||||||
|
|
||||||
private KeyguardBouncer mBouncer;
|
private KeyguardBouncer mBouncer;
|
||||||
@@ -96,7 +98,7 @@ public class KeyguardBouncerTest extends SysuiTestCase {
|
|||||||
when(mKeyguardHostView.getHeight()).thenReturn(500);
|
when(mKeyguardHostView.getHeight()).thenReturn(500);
|
||||||
mBouncer = new KeyguardBouncer(getContext(), mViewMediatorCallback,
|
mBouncer = new KeyguardBouncer(getContext(), mViewMediatorCallback,
|
||||||
mLockPatternUtils, container, mDismissCallbackRegistry, mFalsingManager,
|
mLockPatternUtils, container, mDismissCallbackRegistry, mFalsingManager,
|
||||||
mExpansionCallback, mKeyguardUpdateMonitor, mHandler) {
|
mExpansionCallback, mUnlockMethodCache, mKeyguardUpdateMonitor, mHandler) {
|
||||||
@Override
|
@Override
|
||||||
protected void inflateView() {
|
protected void inflateView() {
|
||||||
super.inflateView();
|
super.inflateView();
|
||||||
@@ -377,7 +379,7 @@ public class KeyguardBouncerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testShow_delaysIfFaceAuthIsRunning() {
|
public void testShow_delaysIfFaceAuthIsRunning() {
|
||||||
when(mKeyguardUpdateMonitor.isFaceDetectionRunning()).thenReturn(true);
|
when(mUnlockMethodCache.isUnlockingWithFacePossible()).thenReturn(true);
|
||||||
mBouncer.show(true /* reset */);
|
mBouncer.show(true /* reset */);
|
||||||
|
|
||||||
ArgumentCaptor<Runnable> showRunnable = ArgumentCaptor.forClass(Runnable.class);
|
ArgumentCaptor<Runnable> showRunnable = ArgumentCaptor.forClass(Runnable.class);
|
||||||
|
|||||||
Reference in New Issue
Block a user