Merge "AOD: Block when fingerprint is already authenticated but waiting for goingToSleep to complete" into oc-dr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
eacef7a03a
@@ -32,6 +32,7 @@ public interface DozeHost {
|
||||
boolean isPowerSaveActive();
|
||||
boolean isPulsingBlocked();
|
||||
boolean isProvisioned();
|
||||
boolean isBlockingDoze();
|
||||
|
||||
void startPendingIntentDismissingKeyguard(PendingIntent intent);
|
||||
void abortPulsing();
|
||||
|
||||
@@ -209,6 +209,7 @@ public class DozeTriggers implements DozeMachine.Part {
|
||||
private void checkTriggersAtInit() {
|
||||
if (mUiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_CAR
|
||||
|| mDozeHost.isPowerSaveActive()
|
||||
|| mDozeHost.isBlockingDoze()
|
||||
|| !mDozeHost.isProvisioned()) {
|
||||
mMachine.requestState(DozeMachine.State.FINISH);
|
||||
}
|
||||
|
||||
@@ -269,6 +269,12 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback {
|
||||
Trace.endSection();
|
||||
}
|
||||
|
||||
public boolean hasPendingAuthentication() {
|
||||
return mPendingAuthenticatedUserId != -1
|
||||
&& mUpdateMonitor.isUnlockingWithFingerprintAllowed()
|
||||
&& mPendingAuthenticatedUserId == KeyguardUpdateMonitor.getCurrentUser();
|
||||
}
|
||||
|
||||
public int getMode() {
|
||||
return mMode;
|
||||
}
|
||||
|
||||
@@ -5400,6 +5400,15 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
&& mDeviceProvisionedController.isCurrentUserSetup();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlockingDoze() {
|
||||
if (mFingerprintUnlockController.hasPendingAuthentication()) {
|
||||
Log.i(TAG, "Blocking AOD because fingerprint has authenticated");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startPendingIntentDismissingKeyguard(PendingIntent intent) {
|
||||
StatusBar.this.startPendingIntentDismissingKeyguard(intent);
|
||||
|
||||
@@ -76,6 +76,11 @@ class DozeHostFake implements DozeHost {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlockingDoze() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startPendingIntentDismissingKeyguard(PendingIntent intent) {
|
||||
throw new RuntimeException("not implemented");
|
||||
|
||||
Reference in New Issue
Block a user