From 3c2dc2896feccb1c1d5e96d1739e8bcc5e5b7885 Mon Sep 17 00:00:00 2001 From: Pardis Beikzadeh Date: Wed, 1 Apr 2020 16:47:27 -0700 Subject: [PATCH] Post cancelAsUser to mHandler. This is to fix a java.lang.SecurityException: Caller android:1010157 cannot post for pkg android in user 10 that was coming from this line. Bug: 153016511 Test: Manual - did make, flash, ran a test app to repro the SecurityException to verify it does not. Change-Id: Icb1bb9982a7fb4b377b0b6773c19a146c5ea8f63 --- .../com/android/server/biometrics/face/FaceService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/biometrics/face/FaceService.java b/services/core/java/com/android/server/biometrics/face/FaceService.java index f222f39a3b851..78d2e5b6cef76 100644 --- a/services/core/java/com/android/server/biometrics/face/FaceService.java +++ b/services/core/java/com/android/server/biometrics/face/FaceService.java @@ -379,8 +379,10 @@ public class FaceService extends BiometricServiceBase { checkPermission(MANAGE_BIOMETRIC); updateActiveGroup(userId, opPackageName); - mNotificationManager.cancelAsUser(NOTIFICATION_TAG, NOTIFICATION_ID, - UserHandle.CURRENT); + mHandler.post(() -> { + mNotificationManager.cancelAsUser(NOTIFICATION_TAG, NOTIFICATION_ID, + UserHandle.CURRENT); + }); final boolean restricted = isRestricted(); final EnrollClientImpl client = new EnrollClientImpl(getContext(), mDaemonWrapper,