Add onUiReady to AlternativeTouchProvider

Test: Verified that onUiReady correctly flows through the provider.
Fixes: 231170060
Change-Id: I3c7d92e11693957e10596e111cb4ef9f5dc7fd85
This commit is contained in:
Joshua McCloskey
2022-05-02 22:58:24 +00:00
parent c49ba33ac0
commit 5f37070884
3 changed files with 19 additions and 4 deletions

View File

@@ -22,6 +22,8 @@ package com.android.systemui.biometrics
interface AlternateUdfpsTouchProvider {
/**
* onPointerDown:
*
* This operation is used to notify the Fingerprint HAL that
* a fingerprint has been detected on the device's screen.
*
@@ -39,4 +41,14 @@ interface AlternateUdfpsTouchProvider {
* See fingerprint/ISession#onPointerUp for more details.
*/
fun onPointerUp(pointerId: Long)
/**
* onUiReady:
*
* This operation is used by the callee to notify the Fingerprint HAL that SystemUI is
* correctly configured for the fingerprint capture.
*
* See fingerprint/ISession#onUiReady for more details.
*/
fun onUiReady()
}

View File

@@ -804,7 +804,11 @@ public class UdfpsController implements DozeReceiver {
final UdfpsView view = mOverlay.getOverlayView();
if (view != null) {
view.startIllumination(() -> {
mFingerprintManager.onUiReady(requestId, mSensorId);
if (mAlternateTouchProvider != null) {
mAlternateTouchProvider.onUiReady();
} else {
mFingerprintManager.onUiReady(requestId, mSensorId);
}
mLatencyTracker.onActionEnd(LatencyTracker.ACTION_UDFPS_ILLUMINATE);
});
}

View File

@@ -590,9 +590,8 @@ public class UdfpsControllerTest extends SysuiTestCase {
verify(mLatencyTracker, never()).onActionEnd(eq(LatencyTracker.ACTION_UDFPS_ILLUMINATE));
// AND onIlluminatedRunnable notifies FingerprintManager about onUiReady
mOnIlluminatedRunnableCaptor.getValue().run();
InOrder inOrder = inOrder(mFingerprintManager, mLatencyTracker);
inOrder.verify(mFingerprintManager).onUiReady(
eq(TEST_REQUEST_ID), eq(mUdfpsController.mSensorId));
InOrder inOrder = inOrder(mAlternateTouchProvider, mLatencyTracker);
inOrder.verify(mAlternateTouchProvider).onUiReady();
inOrder.verify(mLatencyTracker).onActionEnd(eq(LatencyTracker.ACTION_UDFPS_ILLUMINATE));
}