Hide Udfps Overlay together with system transitions

Prevent the UDFPS overlay from showing when system dialogs are
expected to be closed. Since the UDFPS affordances are not
actually shown in the application's window, we should nicely
hide the UDFPS overlay together with the system transitions.

1) Adds IUdfpsOverlayControllerCallback for SysUI to notify
   FingerprintService of per-session events.
2) Adds AcquisitionClient#onUserCanceled, which notifies the
   caller of ERROR_USER_CANCELED, and then cancels the HAL
   request

Bug: 178403701
Test: Enroll, swipe up. UDFPS affordances animate away together
      with the activity. BiometricScheduler logs also indicate
      enrollment canceled.
Test: atest AcquisitionClientTest
Test: atest UdfpsControllerTest

Change-Id: I0b2c9eb20ef0686e426ea12896769e4df077cadb
This commit is contained in:
Kevin Chyn
2021-03-05 11:30:07 -08:00
parent 58fd45573d
commit 4c4961ab26
13 changed files with 226 additions and 20 deletions

View File

@@ -15,6 +15,8 @@
*/
package android.hardware.fingerprint;
import android.hardware.fingerprint.IUdfpsOverlayControllerCallback;
/**
* Interface for interacting with the under-display fingerprint sensor (UDFPS) overlay.
* @hide
@@ -28,7 +30,7 @@ oneway interface IUdfpsOverlayController {
const int REASON_AUTH_FPM_OTHER = 5; // Other FingerprintManager usage
// Shows the overlay.
void showUdfpsOverlay(int sensorId, int reason);
void showUdfpsOverlay(int sensorId, int reason, IUdfpsOverlayControllerCallback callback);
// Hides the overlay.
void hideUdfpsOverlay(int sensorId);

View File

@@ -0,0 +1,24 @@
/*
* Copyright (C) 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.hardware.fingerprint;
/**
* @hide
*/
oneway interface IUdfpsOverlayControllerCallback {
// Notify system_server if the user cancels a UDFPS-related operation (enroll, auth)
void onUserCanceled();
}