diff options
| author | 2024-05-16 08:18:24 +0000 | |
|---|---|---|
| committer | 2024-05-17 09:29:53 +0000 | |
| commit | a8f6500d6d148ad1e87667af02cdadc0ed37ad62 (patch) | |
| tree | 3b4b7c6f1a50789084bc8a6d9b286e831d375b4c | |
| parent | 13aea129213eeedc3339c8aebd774397a9d55b7d (diff) | |
Refine biometric dangling notification
- Update string resources
- Make the notification not able to be cleared by "clear all" button
Bug: 331804186
Test: atest FaceInternalEnumerateClientTest
FingerprintInternalEnumerateClientTest
BiometricDanglingReceiverTest
Test: Manual trigger dangling force re-enroll
Flag: NONE
Change-Id: I25c1e621f9464c7f0f7a895cf7294c752950b262
| -rw-r--r-- | core/res/res/values/strings.xml | 4 | ||||
| -rw-r--r-- | services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index e11e0360f149..bef5542f30a2 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -6442,9 +6442,9 @@ ul.</string> <!-- Fingerprint dangling notification title --> <string name="fingerprint_dangling_notification_title">Set up Fingerprint Unlock again</string> <!-- Fingerprint dangling notification content for only 1 fingerprint deleted --> - <string name="fingerprint_dangling_notification_msg_1"><xliff:g id="fingerprint">%s</xliff:g> wasn\'t working well and was deleted to improve performance</string> + <string name="fingerprint_dangling_notification_msg_1"><xliff:g id="fingerprint">%s</xliff:g> wasn\'t working well and was deleted</string> <!-- Fingerprint dangling notification content for more than 1 fingerprints deleted --> - <string name="fingerprint_dangling_notification_msg_2"><xliff:g id="fingerprint">%1$s</xliff:g> and <xliff:g id="fingerprint">%2$s</xliff:g> weren\'t working well and were deleted to improve performance</string> + <string name="fingerprint_dangling_notification_msg_2"><xliff:g id="fingerprint">%1$s</xliff:g> and <xliff:g id="fingerprint">%2$s</xliff:g> weren\'t working well and were deleted</string> <!-- Fingerprint dangling notification content for only 1 fingerprint deleted and no fingerprint left--> <string name="fingerprint_dangling_notification_msg_all_deleted_1"><xliff:g id="fingerprint">%s</xliff:g> wasn\'t working well and was deleted. Set it up again to unlock your phone with fingerprint.</string> <!-- Fingerprint dangling notification content for more than 1 fingerprints deleted and no fingerprint left --> diff --git a/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java b/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java index eaa5e2a6befb..53e6bdb2ab5f 100644 --- a/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java +++ b/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java @@ -238,7 +238,7 @@ public class BiometricNotificationUtils { showNotificationHelper(context, name, title, content, setupPendingIntent, setupAction, notNowAction, Notification.CATEGORY_SYSTEM, channel, tag, - Notification.VISIBILITY_SECRET, false); + Notification.VISIBILITY_SECRET, false, Notification.FLAG_NO_CLEAR); } private static String getFingerprintDanglingContentString(Context context, @@ -296,13 +296,13 @@ public class BiometricNotificationUtils { String notificationTag, int visibility, boolean listenToDismissEvent) { showNotificationHelper(context, name, title, content, pendingIntent, null /* positiveAction */, null /* negativeAction */, category, channelName, - notificationTag, visibility, listenToDismissEvent); + notificationTag, visibility, listenToDismissEvent, 0); } private static void showNotificationHelper(Context context, String name, String title, String content, PendingIntent pendingIntent, Notification.Action positiveAction, Notification.Action negativeAction, String category, String channelName, - String notificationTag, int visibility, boolean listenToDismissEvent) { + String notificationTag, int visibility, boolean listenToDismissEvent, int flags) { Slog.v(TAG," listenToDismissEvent = " + listenToDismissEvent); final PendingIntent dismissIntent = PendingIntent.getActivityAsUser(context, 0 /* requestCode */, DISMISS_FRR_INTENT, PendingIntent.FLAG_IMMUTABLE /* flags */, @@ -324,6 +324,9 @@ public class BiometricNotificationUtils { .setContentIntent(pendingIntent) .setVisibility(visibility); + if (flags > 0) { + builder.setFlag(flags, true); + } if (positiveAction != null) { builder.addAction(positiveAction); } |