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
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index e11e036..bef5542 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -6442,9 +6442,9 @@
     <!-- 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 eaa5e2a..53e6bdb 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 @@
 
         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 @@
             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 @@
                 .setContentIntent(pendingIntent)
                 .setVisibility(visibility);
 
+        if (flags > 0) {
+            builder.setFlag(flags, true);
+        }
         if (positiveAction != null) {
             builder.addAction(positiveAction);
         }