Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +9 −0 Original line number Diff line number Diff line Loading @@ -456,6 +456,15 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, } } /** * Whether the current user has a UDFP enrolled. */ public boolean hasUdfpsEnrolled() { // TODO: (b/171392825) right now only checks whether the UDFPS sensor exists on this device // but not whether user has enrolled or not return mUdfpsController != null; } private void showDialog(SomeArgs args, boolean skipAnimation, Bundle savedState) { mCurrentDialogArgs = args; final @BiometricAuthenticator.Modality int type = args.argi1; Loading packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java +6 −4 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import com.android.internal.logging.UiEvent; import com.android.internal.logging.UiEventLogger; import com.android.internal.logging.UiEventLoggerImpl; import com.android.internal.logging.nano.MetricsProto; import com.android.systemui.biometrics.AuthController; import com.android.systemui.plugins.SensorManagerPlugin; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.util.sensors.AsyncSensorManager; Loading Loading @@ -98,7 +99,8 @@ public class DozeSensors { DozeSensors(Context context, AsyncSensorManager sensorManager, DozeParameters dozeParameters, AmbientDisplayConfiguration config, WakeLock wakeLock, Callback callback, Consumer<Boolean> proxCallback, DozeLog dozeLog, ProximitySensor proximitySensor, SecureSettings secureSettings) { ProximitySensor proximitySensor, SecureSettings secureSettings, AuthController authController) { mContext = context; mSensorManager = sensorManager; mConfig = config; Loading Loading @@ -152,9 +154,9 @@ public class DozeSensors { dozeLog), new TriggerSensor( findSensorWithType(config.udfpsLongPressSensorType()), Settings.Secure.DOZE_PULSE_ON_LONG_PRESS, false /* settingDef */, true /* configured */, "doze_pulse_on_auth", true /* settingDef */, authController.hasUdfpsEnrolled() /* configured */, DozeLog.REASON_SENSOR_UDFPS_LONG_PRESS, true /* reports touch coordinates */, true /* touchscreen */, Loading packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java +2 −2 Original line number Diff line number Diff line Loading @@ -177,7 +177,7 @@ public class DozeTriggers implements DozeMachine.Part { mAllowPulseTriggers = true; mDozeSensors = new DozeSensors(context, mSensorManager, dozeParameters, config, wakeLock, this::onSensor, this::onProximityFar, dozeLog, proximitySensor, secureSettings); secureSettings, authController); mUiModeManager = mContext.getSystemService(UiModeManager.class); mDockManager = dockManager; mProxCheck = proxCheck; Loading Loading @@ -286,7 +286,7 @@ public class DozeTriggers implements DozeMachine.Part { } else if (isPickup) { gentleWakeUp(pulseReason); } else if (isUdfpsLongPress) { gentleWakeUp(pulseReason); requestPulse(DozeLog.REASON_SENSOR_UDFPS_LONG_PRESS, true, null); // Since the gesture won't be received by the UDFPS view, manually inject an // event. mAuthController.onAodInterrupt((int) screenX, (int) screenY); Loading packages/SystemUI/tests/src/com/android/systemui/doze/DozeSensorsTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import android.testing.TestableLooper.RunWithLooper; import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import com.android.systemui.biometrics.AuthController; import com.android.systemui.doze.DozeSensors.TriggerSensor; import com.android.systemui.plugins.SensorManagerPlugin; import com.android.systemui.statusbar.phone.DozeParameters; Loading Loading @@ -84,6 +85,8 @@ public class DozeSensorsTest extends SysuiTestCase { @Mock private DozeLog mDozeLog; @Mock private AuthController mAuthController; @Mock private ProximitySensor mProximitySensor; private FakeSettings mFakeSettings = new FakeSettings(); private SensorManagerPlugin.SensorEventListener mWakeLockScreenListener; Loading Loading @@ -156,7 +159,7 @@ public class DozeSensorsTest extends SysuiTestCase { TestableDozeSensors() { super(getContext(), mSensorManager, mDozeParameters, mAmbientDisplayConfiguration, mWakeLock, mCallback, mProxCallback, mDozeLog, mProximitySensor, mFakeSettings); mProximitySensor, mFakeSettings, mAuthController); for (TriggerSensor sensor : mSensors) { if (sensor instanceof PluginSensor && ((PluginSensor) sensor).mPluginSensor.getType() Loading packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -196,6 +196,7 @@ public class DozeTriggersTest extends SysuiTestCase { final int screenY = 100; final int reason = DozeLog.REASON_SENSOR_UDFPS_LONG_PRESS; mTriggers.onSensor(reason, screenX, screenY, null); verify(mHost).extendPulse(reason); verify(mAuthController).onAodInterrupt(eq(screenX), eq(screenY)); } Loading Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +9 −0 Original line number Diff line number Diff line Loading @@ -456,6 +456,15 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, } } /** * Whether the current user has a UDFP enrolled. */ public boolean hasUdfpsEnrolled() { // TODO: (b/171392825) right now only checks whether the UDFPS sensor exists on this device // but not whether user has enrolled or not return mUdfpsController != null; } private void showDialog(SomeArgs args, boolean skipAnimation, Bundle savedState) { mCurrentDialogArgs = args; final @BiometricAuthenticator.Modality int type = args.argi1; Loading
packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java +6 −4 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import com.android.internal.logging.UiEvent; import com.android.internal.logging.UiEventLogger; import com.android.internal.logging.UiEventLoggerImpl; import com.android.internal.logging.nano.MetricsProto; import com.android.systemui.biometrics.AuthController; import com.android.systemui.plugins.SensorManagerPlugin; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.util.sensors.AsyncSensorManager; Loading Loading @@ -98,7 +99,8 @@ public class DozeSensors { DozeSensors(Context context, AsyncSensorManager sensorManager, DozeParameters dozeParameters, AmbientDisplayConfiguration config, WakeLock wakeLock, Callback callback, Consumer<Boolean> proxCallback, DozeLog dozeLog, ProximitySensor proximitySensor, SecureSettings secureSettings) { ProximitySensor proximitySensor, SecureSettings secureSettings, AuthController authController) { mContext = context; mSensorManager = sensorManager; mConfig = config; Loading Loading @@ -152,9 +154,9 @@ public class DozeSensors { dozeLog), new TriggerSensor( findSensorWithType(config.udfpsLongPressSensorType()), Settings.Secure.DOZE_PULSE_ON_LONG_PRESS, false /* settingDef */, true /* configured */, "doze_pulse_on_auth", true /* settingDef */, authController.hasUdfpsEnrolled() /* configured */, DozeLog.REASON_SENSOR_UDFPS_LONG_PRESS, true /* reports touch coordinates */, true /* touchscreen */, Loading
packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java +2 −2 Original line number Diff line number Diff line Loading @@ -177,7 +177,7 @@ public class DozeTriggers implements DozeMachine.Part { mAllowPulseTriggers = true; mDozeSensors = new DozeSensors(context, mSensorManager, dozeParameters, config, wakeLock, this::onSensor, this::onProximityFar, dozeLog, proximitySensor, secureSettings); secureSettings, authController); mUiModeManager = mContext.getSystemService(UiModeManager.class); mDockManager = dockManager; mProxCheck = proxCheck; Loading Loading @@ -286,7 +286,7 @@ public class DozeTriggers implements DozeMachine.Part { } else if (isPickup) { gentleWakeUp(pulseReason); } else if (isUdfpsLongPress) { gentleWakeUp(pulseReason); requestPulse(DozeLog.REASON_SENSOR_UDFPS_LONG_PRESS, true, null); // Since the gesture won't be received by the UDFPS view, manually inject an // event. mAuthController.onAodInterrupt((int) screenX, (int) screenY); Loading
packages/SystemUI/tests/src/com/android/systemui/doze/DozeSensorsTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import android.testing.TestableLooper.RunWithLooper; import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import com.android.systemui.biometrics.AuthController; import com.android.systemui.doze.DozeSensors.TriggerSensor; import com.android.systemui.plugins.SensorManagerPlugin; import com.android.systemui.statusbar.phone.DozeParameters; Loading Loading @@ -84,6 +85,8 @@ public class DozeSensorsTest extends SysuiTestCase { @Mock private DozeLog mDozeLog; @Mock private AuthController mAuthController; @Mock private ProximitySensor mProximitySensor; private FakeSettings mFakeSettings = new FakeSettings(); private SensorManagerPlugin.SensorEventListener mWakeLockScreenListener; Loading Loading @@ -156,7 +159,7 @@ public class DozeSensorsTest extends SysuiTestCase { TestableDozeSensors() { super(getContext(), mSensorManager, mDozeParameters, mAmbientDisplayConfiguration, mWakeLock, mCallback, mProxCallback, mDozeLog, mProximitySensor, mFakeSettings); mProximitySensor, mFakeSettings, mAuthController); for (TriggerSensor sensor : mSensors) { if (sensor instanceof PluginSensor && ((PluginSensor) sensor).mPluginSensor.getType() Loading
packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -196,6 +196,7 @@ public class DozeTriggersTest extends SysuiTestCase { final int screenY = 100; final int reason = DozeLog.REASON_SENSOR_UDFPS_LONG_PRESS; mTriggers.onSensor(reason, screenX, screenY, null); verify(mHost).extendPulse(reason); verify(mAuthController).onAodInterrupt(eq(screenX), eq(screenY)); } Loading