summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2015-04-16 14:57:34 -0700
committerJorim Jaggi <jjaggi@google.com>2015-04-17 13:26:39 -0700
commitf3b3bee12994a24b60bd447dede9e8791151fcc9 (patch)
tree455fc056c10545bc735e7677b0e05799d0f3f9c4 /packages/SystemUI/src/com/android/systemui
parent1dfab471ed50478b4f63552778c949a2f0d37521 (diff)
downloadframeworks_base-f3b3bee12994a24b60bd447dede9e8791151fcc9.zip
frameworks_base-f3b3bee12994a24b60bd447dede9e8791151fcc9.tar.gz
frameworks_base-f3b3bee12994a24b60bd447dede9e8791151fcc9.tar.bz2
Speedup unlock when authenticating with fingerprint
Change-Id: Ib76ff7a2a42cf6fc77848ef799c2a13b77cfebb2
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui')
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java29
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java20
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java5
6 files changed, 51 insertions, 22 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index f16fb5c..b828e78 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -171,6 +171,11 @@ public class KeyguardViewMediator extends SystemUI {
*/
private static final String KEYGUARD_ANALYTICS_SETTING = "keyguard_analytics";
+ /**
+ * How much faster we collapse the lockscreen when authenticating with fingerprint.
+ */
+ private static final float FINGERPRINT_COLLAPSE_SPEEDUP_FACTOR = 1.3f;
+
/** The stream type that the lock sounds are tied to. */
private int mUiSoundsStreamType;
@@ -441,7 +446,8 @@ public class KeyguardViewMediator extends SystemUI {
if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
mViewMediatorCallback.keyguardDone(true);
} else {
- mStatusBarKeyguardViewManager.animateCollapsePanels();
+ mStatusBarKeyguardViewManager.animateCollapsePanels(
+ FINGERPRINT_COLLAPSE_SPEEDUP_FACTOR);
}
};
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index c266467..96e9543 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -511,9 +511,10 @@ public class NotificationPanelView extends PanelView implements
}
@Override
- protected void flingToHeight(float vel, boolean expand, float target) {
+ protected void flingToHeight(float vel, boolean expand, float target,
+ float collapseSpeedUpFactor) {
mHeadsUpTouchHelper.notifyFling(!expand);
- super.flingToHeight(vel, expand, target);
+ super.flingToHeight(vel, expand, target, collapseSpeedUpFactor);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java
index 240438a..f3d4c7f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java
@@ -140,7 +140,7 @@ public class PanelBar extends FrameLayout {
mPanelHolder.setSelectedPanel(mTouchingPanel);
for (PanelView pv : mPanels) {
if (pv != panel) {
- pv.collapse(false /* delayed */);
+ pv.collapse(false /* delayed */, 1.0f /* speedUpFactor */);
}
}
}
@@ -186,11 +186,11 @@ public class PanelBar extends FrameLayout {
(fullyOpenedPanel!=null)?" fullyOpened":"", fullyClosed?" fullyClosed":"");
}
- public void collapseAllPanels(boolean animate, boolean delayed) {
+ public void collapseAllPanels(boolean animate, boolean delayed, float speedUpFactor) {
boolean waiting = false;
for (PanelView pv : mPanels) {
if (animate && !pv.isFullyCollapsed()) {
- pv.collapse(delayed);
+ pv.collapse(delayed, speedUpFactor);
waiting = true;
} else {
pv.resetViews();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
index ddce9d5..3a30429 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -101,6 +101,12 @@ public abstract class PanelView extends FrameLayout {
private boolean mPeekPending;
private boolean mCollapseAfterPeek;
+
+ /**
+ * Speed-up factor to be used when {@link #mFlingCollapseRunnable} runs the next time.
+ */
+ private float mNextCollapseSpeedUpFactor = 1.0f;
+
private boolean mExpanding;
private boolean mGestureWaitForTouchSlop;
private Runnable mPeekRunnable = new Runnable() {
@@ -164,7 +170,7 @@ public abstract class PanelView extends FrameLayout {
postOnAnimation(new Runnable() {
@Override
public void run() {
- collapse(false /* delayed */);
+ collapse(false /* delayed */, 1.0f /* speedUpFactor */);
}
});
}
@@ -563,12 +569,17 @@ public abstract class PanelView extends FrameLayout {
}
protected void fling(float vel, boolean expand) {
+ fling(vel, expand, 1.0f /* collapseSpeedUpFactor */);
+ }
+
+ protected void fling(float vel, boolean expand, float collapseSpeedUpFactor) {
cancelPeek();
float target = expand ? getMaxPanelHeight() : 0.0f;
- flingToHeight(vel, expand, target);
+ flingToHeight(vel, expand, target, collapseSpeedUpFactor);
}
- protected void flingToHeight(float vel, boolean expand, float target) {
+ protected void flingToHeight(float vel, boolean expand, float target,
+ float collapseSpeedUpFactor) {
// Hack to make the expand transition look nice when clear all button is visible - we make
// the animation only to the last notification, and then jump to the maximum panel height so
// clear all just fades in and the decelerating motion is towards the last notification.
@@ -600,7 +611,8 @@ public abstract class PanelView extends FrameLayout {
// Make it shorter if we run a canned animation
if (vel == 0) {
animator.setDuration((long)
- (animator.getDuration() * getCannedFlingDurationFactor()));
+ (animator.getDuration() * getCannedFlingDurationFactor()
+ / collapseSpeedUpFactor));
}
}
animator.addListener(new AnimatorListenerAdapter() {
@@ -745,7 +757,7 @@ public abstract class PanelView extends FrameLayout {
mBar = panelBar;
}
- public void collapse(boolean delayed) {
+ public void collapse(boolean delayed, float speedUpFactor) {
if (DEBUG) logf("collapse: " + this);
if (mPeekPending || mPeekAnimator != null) {
mCollapseAfterPeek = true;
@@ -761,9 +773,10 @@ public abstract class PanelView extends FrameLayout {
mClosing = true;
notifyExpandingStarted();
if (delayed) {
+ mNextCollapseSpeedUpFactor = speedUpFactor;
postDelayed(mFlingCollapseRunnable, 120);
} else {
- fling(0, false /* expand */);
+ fling(0, false /* expand */, speedUpFactor);
}
}
}
@@ -771,7 +784,7 @@ public abstract class PanelView extends FrameLayout {
private final Runnable mFlingCollapseRunnable = new Runnable() {
@Override
public void run() {
- fling(0, false /* expand */);
+ fling(0, false /* expand */, mNextCollapseSpeedUpFactor);
}
};
@@ -975,7 +988,7 @@ public abstract class PanelView extends FrameLayout {
protected final Runnable mPostCollapseRunnable = new Runnable() {
@Override
public void run() {
- collapse(false /* delayed */);
+ collapse(false /* delayed */, 1.0f /* speedUpFactor */);
}
};
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 7f65f73..b6dbfce 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -1981,14 +1981,20 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
}
public void animateCollapsePanels(int flags) {
- animateCollapsePanels(flags, false /* force */, false /* delayed */);
+ animateCollapsePanels(flags, false /* force */, false /* delayed */,
+ 1.0f /* speedUpFactor */);
}
public void animateCollapsePanels(int flags, boolean force) {
- animateCollapsePanels(flags, force, false /* delayed*/);
+ animateCollapsePanels(flags, force, false /* delayed */, 1.0f /* speedUpFactor */);
}
public void animateCollapsePanels(int flags, boolean force, boolean delayed) {
+ animateCollapsePanels(flags, force, delayed, 1.0f /* speedUpFactor */);
+ }
+
+ public void animateCollapsePanels(int flags, boolean force, boolean delayed,
+ float speedUpFactor) {
if (!force &&
(mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED)) {
runPostCollapseRunnables();
@@ -2012,7 +2018,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
mStatusBarWindowManager.setStatusBarFocusable(false);
mStatusBarWindow.cancelExpandHelper();
- mStatusBarView.collapseAllPanels(true /* animate */, delayed);
+ mStatusBarView.collapseAllPanels(true /* animate */, delayed, speedUpFactor);
}
}
@@ -2055,7 +2061,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
public void animateCollapseQuickSettings() {
if (mState == StatusBarState.SHADE) {
- mStatusBarView.collapseAllPanels(true, false /* delayed */);
+ mStatusBarView.collapseAllPanels(true, false /* delayed */, 1.0f /* speedUpFactor */);
}
}
@@ -2068,7 +2074,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
}
// Ensure the panel is fully collapsed (just in case; bug 6765842, 7260868)
- mStatusBarView.collapseAllPanels(/*animate=*/ false, false /* delayed*/);
+ mStatusBarView.collapseAllPanels(/*animate=*/ false, false /* delayed*/,
+ 1.0f /* speedUpFactor */);
mNotificationPanel.closeQs();
@@ -2158,7 +2165,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
mStatusBarWindowState = state;
if (DEBUG_WINDOW_STATE) Log.d(TAG, "Status bar " + windowStateToString(state));
if (!showing && mState == StatusBarState.SHADE) {
- mStatusBarView.collapseAllPanels(false /* animate */, false /* delayed */);
+ mStatusBarView.collapseAllPanels(false /* animate */, false /* delayed */,
+ 1.0f /* speedUpFactor */);
}
}
if (mNavigationBarView != null
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 6369d5e..194a19a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -441,7 +441,8 @@ public class StatusBarKeyguardViewManager {
mPhoneStatusBar.keyguardGoingAway();
}
- public void animateCollapsePanels() {
- mPhoneStatusBar.animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE, true /* force */);
+ public void animateCollapsePanels(float speedUpFactor) {
+ mPhoneStatusBar.animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE, true /* force */,
+ false /* delayed */, speedUpFactor);
}
}