From a422c09e020082710fbaddcef58cb3bc84a51d7e Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Thu, 13 Jun 2019 10:08:19 -0700 Subject: [PATCH] Do not execute face auth when notification There's a big power cost and very high likelihood of failing Test: manual Test: atest StatusBarTest Fixes: 134551789 Change-Id: I6593797316e6e24180ad79a37aed2de8aa12fd96 --- .../src/com/android/systemui/statusbar/phone/StatusBar.java | 5 ++--- .../com/android/systemui/statusbar/phone/StatusBarTest.java | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index a572e8fc37925..1351b018b5f9f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -3947,9 +3947,8 @@ public class StatusBar extends SystemUI implements DemoMode, mStatusBarWindow.suppressWakeUpGesture(true); } - boolean passiveAuthInterrupt = reason == DozeLog.PULSE_REASON_NOTIFICATION || ( - reason == DozeLog.PULSE_REASON_SENSOR_WAKE_LOCK_SCREEN - && mWakeLockScreenPerformsAuth); + boolean passiveAuthInterrupt = reason == DozeLog.PULSE_REASON_SENSOR_WAKE_LOCK_SCREEN + && mWakeLockScreenPerformsAuth; // Set the state to pulsing, so ScrimController will know what to do once we ask it to // execute the transition. The pulse callback will then be invoked when the scrims // are black, indicating that StatusBar is ready to present the rest of the UI. diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java index 5e381ffd2b269..cffd57b35f04f 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java @@ -639,10 +639,10 @@ public class StatusBarTest extends SysuiTestCase { @Test public void testPulseWhileDozing_notifyAuthInterrupt() { HashSet reasonsWantingAuth = new HashSet<>( - Collections.singletonList(DozeLog.PULSE_REASON_NOTIFICATION)); + Collections.singletonList(DozeLog.PULSE_REASON_SENSOR_WAKE_LOCK_SCREEN)); HashSet reasonsSkippingAuth = new HashSet<>( Arrays.asList(DozeLog.PULSE_REASON_INTENT, - DozeLog.PULSE_REASON_SENSOR_WAKE_LOCK_SCREEN, + DozeLog.PULSE_REASON_NOTIFICATION, DozeLog.PULSE_REASON_SENSOR_SIGMOTION, DozeLog.REASON_SENSOR_PICKUP, DozeLog.REASON_SENSOR_DOUBLE_TAP, @@ -661,6 +661,7 @@ public class StatusBarTest extends SysuiTestCase { return null; }).when(mDozeScrimController).pulse(any(), anyInt()); + mStatusBar.mDozeServiceHost.mWakeLockScreenPerformsAuth = true; for (int i = 0; i < DozeLog.REASONS; i++) { reset(mKeyguardUpdateMonitor); mStatusBar.mDozeServiceHost.pulseWhileDozing(mock(DozeHost.PulseCallback.class), i);