diff options
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui')
10 files changed, 49 insertions, 29 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java index d78800f..d2c60ef 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java @@ -80,7 +80,8 @@ public class KeyguardService extends Service { @Override // Binder interface public void keyguardDone(boolean authenticated, boolean wakeup) { checkPermission(); - mKeyguardViewMediator.keyguardDone(authenticated, wakeup); + // TODO: Remove wakeup + mKeyguardViewMediator.keyguardDone(authenticated); } @Override // Binder interface diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index c1df788..9ad83bf 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -465,13 +465,14 @@ public class KeyguardViewMediator extends SystemUI { mUpdateMonitor.isUnlockingWithFingerprintAllowed(); if (mStatusBarKeyguardViewManager.isBouncerShowing()) { if (unlockingWithFingerprintAllowed) { - mStatusBarKeyguardViewManager.notifyKeyguardAuthenticated(); + mStatusBarKeyguardViewManager.notifyKeyguardAuthenticated( + false /* strongAuth */); } } else { if (wakeAndUnlocking && mShowing && unlockingWithFingerprintAllowed) { mWakeAndUnlocking = true; mStatusBarKeyguardViewManager.setWakeAndUnlocking(); - keyguardDone(true, true); + keyguardDone(true); } else if (mShowing && mDeviceInteractive) { if (wakeAndUnlocking) { mStatusBarKeyguardViewManager.notifyDeviceWakeUpRequested(); @@ -490,9 +491,12 @@ public class KeyguardViewMediator extends SystemUI { KeyguardViewMediator.this.userActivity(); } - public void keyguardDone(boolean authenticated) { + public void keyguardDone(boolean strongAuth) { if (!mKeyguardDonePending) { - KeyguardViewMediator.this.keyguardDone(authenticated, true); + KeyguardViewMediator.this.keyguardDone(true /* authenticated */); + } + if (strongAuth) { + mUpdateMonitor.reportSuccessfulStrongAuthUnlockAttempt(); } } @@ -506,12 +510,15 @@ public class KeyguardViewMediator extends SystemUI { } @Override - public void keyguardDonePending() { + public void keyguardDonePending(boolean strongAuth) { mKeyguardDonePending = true; mHideAnimationRun = true; mStatusBarKeyguardViewManager.startPreHideAnimation(null /* finishRunnable */); mHandler.sendEmptyMessageDelayed(KEYGUARD_DONE_PENDING_TIMEOUT, KEYGUARD_DONE_PENDING_TIMEOUT_MS); + if (strongAuth) { + mUpdateMonitor.reportSuccessfulStrongAuthUnlockAttempt(); + } } @Override @@ -524,7 +531,7 @@ public class KeyguardViewMediator extends SystemUI { if (mKeyguardDonePending) { // Somebody has called keyguardDonePending before, which means that we are // authenticated - KeyguardViewMediator.this.keyguardDone(true /* authenticated */, true /* wakeUp */); + KeyguardViewMediator.this.keyguardDone(true /* authenticated */); } } @@ -552,9 +559,12 @@ public class KeyguardViewMediator extends SystemUI { public int getBouncerPromptReason() { int currentUser = ActivityManager.getCurrentUser(); if ((mUpdateMonitor.getUserTrustIsManaged(currentUser) - || mUpdateMonitor.isUnlockWithFingerPrintPossible(currentUser)) + || mUpdateMonitor.isUnlockWithFingerprintPossible(currentUser)) && !mTrustManager.hasUserAuthenticatedSinceBoot(currentUser)) { return KeyguardSecurityView.PROMPT_REASON_RESTART; + } else if (mUpdateMonitor.isUnlockWithFingerprintPossible(currentUser) + && mUpdateMonitor.hasFingerprintUnlockTimedOut(currentUser)) { + return KeyguardSecurityView.PROMPT_REASON_TIMEOUT; } return KeyguardSecurityView.PROMPT_REASON_NONE; } @@ -1189,10 +1199,10 @@ public class KeyguardViewMediator extends SystemUI { } }; - public void keyguardDone(boolean authenticated, boolean wakeup) { - if (DEBUG) Log.d(TAG, "keyguardDone(" + authenticated + ")"); + public void keyguardDone(boolean authenticated) { + if (DEBUG) Log.d(TAG, "keyguardDone(" + authenticated +")"); EventLog.writeEvent(70000, 2); - Message msg = mHandler.obtainMessage(KEYGUARD_DONE, authenticated ? 1 : 0, wakeup ? 1 : 0); + Message msg = mHandler.obtainMessage(KEYGUARD_DONE, authenticated ? 1 : 0); mHandler.sendMessage(msg); } @@ -1235,14 +1245,11 @@ public class KeyguardViewMediator extends SystemUI { handleNotifyStartedWakingUp(); break; case KEYGUARD_DONE: - handleKeyguardDone(msg.arg1 != 0, msg.arg2 != 0); + handleKeyguardDone(msg.arg1 != 0); break; case KEYGUARD_DONE_DRAWING: handleKeyguardDoneDrawing(); break; - case KEYGUARD_DONE_AUTHENTICATING: - keyguardDone(true, true); - break; case SET_OCCLUDED: handleSetOccluded(msg.arg1 != 0); break; @@ -1272,7 +1279,7 @@ public class KeyguardViewMediator extends SystemUI { * @see #keyguardDone * @see #KEYGUARD_DONE */ - private void handleKeyguardDone(boolean authenticated, boolean wakeup) { + private void handleKeyguardDone(boolean authenticated) { if (DEBUG) Log.d(TAG, "handleKeyguardDone"); synchronized (this) { resetKeyguardDonePendingLocked(); @@ -1585,6 +1592,7 @@ public class KeyguardViewMediator extends SystemUI { synchronized (this) { if (DEBUG) Log.d(TAG, "handleNotifyScreenTurnedOff"); mStatusBarKeyguardViewManager.onScreenTurnedOff(); + mWakeAndUnlocking = false; } } diff --git a/packages/SystemUI/src/com/android/systemui/qs/UsageTracker.java b/packages/SystemUI/src/com/android/systemui/qs/UsageTracker.java index f36019b..e64f6a0 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/UsageTracker.java +++ b/packages/SystemUI/src/com/android/systemui/qs/UsageTracker.java @@ -21,7 +21,6 @@ import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; -import android.content.SharedPreferences; import com.android.systemui.Prefs; import com.android.systemui.R; diff --git a/packages/SystemUI/src/com/android/systemui/recents/Recents.java b/packages/SystemUI/src/com/android/systemui/recents/Recents.java index 8c2ac88..f1550a0 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/Recents.java +++ b/packages/SystemUI/src/com/android/systemui/recents/Recents.java @@ -20,7 +20,6 @@ import android.app.Activity; import android.app.ActivityManager; import android.app.ActivityOptions; import android.app.ITaskStackListener; -import android.appwidget.AppWidgetProviderInfo; import android.content.ActivityNotFoundException; import android.content.BroadcastReceiver; import android.content.Context; diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java index b47fb30..d0876fa 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java @@ -33,7 +33,6 @@ import android.view.View; import android.view.ViewStub; import android.widget.Toast; -import com.android.internal.logging.MetricsConstants; import com.android.internal.logging.MetricsLogger; import com.android.systemui.Prefs; import com.android.systemui.R; diff --git a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java index 298a1cc..d5c9253 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +++ b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java @@ -20,10 +20,8 @@ import android.app.ActivityManager; import android.app.ActivityManagerNative; import android.app.ActivityOptions; import android.app.AppGlobals; -import android.app.IActivityContainer; import android.app.IActivityManager; import android.app.ITaskStackListener; -import android.app.SearchManager; import android.appwidget.AppWidgetHost; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProviderInfo; @@ -54,15 +52,12 @@ import android.os.ParcelFileDescriptor; import android.os.RemoteException; import android.os.SystemProperties; import android.os.UserHandle; -import android.os.UserManager; import android.provider.Settings; import android.util.Log; import android.util.MutableBoolean; import android.util.Pair; import android.util.SparseArray; import android.view.Display; -import android.view.DisplayInfo; -import android.view.SurfaceControl; import android.view.WindowManager; import android.view.accessibility.AccessibilityManager; @@ -71,7 +66,6 @@ import com.android.systemui.Prefs; import com.android.systemui.R; import com.android.systemui.recents.Constants; import com.android.systemui.recents.Recents; -import com.android.systemui.recents.RecentsAppWidgetHost; import java.io.IOException; import java.util.ArrayList; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java index 4878cd9..f1b8873 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java @@ -647,6 +647,11 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL public void onFingerprintRunningStateChanged(boolean running) { mLockIcon.update(); } + + @Override + public void onStrongAuthTimeoutExpiredChanged(int userId) { + mLockIcon.update(); + } }; public void setKeyguardIndicationController( diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java index 37f563e..8b96e5f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java @@ -26,6 +26,8 @@ import android.view.accessibility.AccessibilityEvent; import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardHostView; import com.android.keyguard.KeyguardSecurityView; +import com.android.keyguard.KeyguardUpdateMonitor; +import com.android.keyguard.KeyguardUpdateMonitorCallback; import com.android.keyguard.R; import com.android.keyguard.ViewMediatorCallback; import com.android.systemui.DejankUtils; @@ -47,6 +49,13 @@ public class KeyguardBouncer { private ViewGroup mRoot; private boolean mShowingSoon; private int mBouncerPromptReason; + private KeyguardUpdateMonitorCallback mUpdateMonitorCallback = + new KeyguardUpdateMonitorCallback() { + @Override + public void onStrongAuthTimeoutExpiredChanged(int userId) { + mBouncerPromptReason = mCallback.getBouncerPromptReason(); + } + }; public KeyguardBouncer(Context context, ViewMediatorCallback callback, LockPatternUtils lockPatternUtils, StatusBarWindowManager windowManager, @@ -56,6 +65,7 @@ public class KeyguardBouncer { mLockPatternUtils = lockPatternUtils; mContainer = container; mWindowManager = windowManager; + KeyguardUpdateMonitor.getInstance(mContext).registerCallback(mUpdateMonitorCallback); } public void show(boolean resetSecuritySelection) { @@ -247,8 +257,8 @@ public class KeyguardBouncer { return mKeyguardView.interceptMediaKey(event); } - public void notifyKeyguardAuthenticated() { + public void notifyKeyguardAuthenticated(boolean strongAuth) { ensureView(); - mKeyguardView.finish(); + mKeyguardView.finish(strongAuth); } } 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 1bdcf03..3c1272d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -480,8 +480,8 @@ public class StatusBarKeyguardViewManager { * Notifies that the user has authenticated by other means than using the bouncer, for example, * fingerprint. */ - public void notifyKeyguardAuthenticated() { - mBouncer.notifyKeyguardAuthenticated(); + public void notifyKeyguardAuthenticated(boolean strongAuth) { + mBouncer.notifyKeyguardAuthenticated(strongAuth); } public void setWakeAndUnlocking() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java index bd537f7..d646d0d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java @@ -143,6 +143,11 @@ public class UnlockMethodCache { public void onFaceUnlockStateChanged(boolean running, int userId) { update(false /* updateAlways */); } + + @Override + public void onStrongAuthTimeoutExpiredChanged(int userId) { + update(false /* updateAlways */); + } }; public boolean isTrustManaged() { |