AOD: Block when fingerprint is already authenticated but waiting for goingToSleep to complete

Improves an issue where immediately triggering fingerprint after
the devices goes to sleep results in a lot of flickering.

There's still flicker however if the fingerprint authenticates after we've requested the AOD
display state, but before it has actually been applied.

Bug: 62887179
Test: Go to Home. Lock screen. Immediately unlock via fingerprint. Verify that the AOD screen does not even show.
Change-Id: Ib6425eee803a8c7e02f9621a571e562e825af57f
This commit is contained in:
Adrian Roos
2017-07-07 19:02:34 +02:00
parent feb5dc3b26
commit 710a0b1362
5 changed files with 22 additions and 0 deletions

View File

@@ -32,6 +32,7 @@ public interface DozeHost {
boolean isPowerSaveActive();
boolean isPulsingBlocked();
boolean isProvisioned();
boolean isBlockingDoze();
void startPendingIntentDismissingKeyguard(PendingIntent intent);
void abortPulsing();

View File

@@ -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);
}

View File

@@ -263,6 +263,12 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback {
Trace.endSection();
}
public boolean hasPendingAuthentication() {
return mPendingAuthenticatedUserId != -1
&& mUpdateMonitor.isUnlockingWithFingerprintAllowed()
&& mPendingAuthenticatedUserId == KeyguardUpdateMonitor.getCurrentUser();
}
public int getMode() {
return mMode;
}

View File

@@ -5398,6 +5398,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);

View File

@@ -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");