Dismiss Keyguard correctly

When authenticating with fingerprint, we didn't go through the
dismiss action, and thus launching intents was broken when
authenticating with fingerprint from the bouncer. Also fixed a crash.

Bug: 21695578
Change-Id: I61f74b5b63d4d6ddf7f8f3ce96feb63b9644cd52
This commit is contained in:
Jorim Jaggi
2015-06-08 14:48:28 -07:00
parent d56958c440
commit 5cc86599ce
4 changed files with 17 additions and 2 deletions

View File

@@ -455,7 +455,7 @@ public class KeyguardViewMediator extends SystemUI {
@Override
public void onFingerprintAuthenticated(int userId) {
if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
mViewMediatorCallback.keyguardDone(true);
mStatusBarKeyguardViewManager.notifyKeyguardAuthenticated();
} else {
mStatusBarKeyguardViewManager.animateCollapsePanels(
FINGERPRINT_COLLAPSE_SPEEDUP_FACTOR);

View File

@@ -228,4 +228,9 @@ public class KeyguardBouncer {
ensureView();
return mKeyguardView.interceptMediaKey(event);
}
public void notifyKeyguardAuthenticated() {
ensureView();
mKeyguardView.finish();
}
}

View File

@@ -2776,7 +2776,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
Runnable cancelRunnable = new Runnable() {
@Override
public void run() {
callback.onActivityStarted(ActivityManager.START_CANCELED);
if (callback != null) {
callback.onActivityStarted(ActivityManager.START_CANCELED);
}
}
};
executeRunnableDismissingKeyguard(runnable, cancelRunnable, dismissShade, afterKeyguardGone);

View File

@@ -447,4 +447,12 @@ public class StatusBarKeyguardViewManager {
mPhoneStatusBar.animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE, true /* force */,
false /* delayed */, speedUpFactor);
}
/**
* Notifies that the user has authenticated by other means than using the bouncer, for example,
* fingerprint.
*/
public void notifyKeyguardAuthenticated() {
mBouncer.notifyKeyguardAuthenticated();
}
}