Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ab1d831 authored by Nate Myren's avatar Nate Myren
Browse files

Clear calling identity when checking if NLS is trusted

This method is sometimes called on binder threads, and checks privileged
APIs

Fixes: 319601292
Test: CallExtrasTest#testCsPutIntExtra
Change-Id: I8ac8aa3ad26d487cb7183626a6c88a564a5a7c4c
parent cd230552
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -12103,6 +12103,7 @@ public class NotificationManagerService extends SystemService {
                return true;
            }
            long token = Binder.clearCallingIdentity();
            try {
                if (mPackageManager.checkUidPermission(RECEIVE_SENSITIVE_NOTIFICATIONS, uid)
                        == PERMISSION_GRANTED || mPackageManagerInternal.isPlatformSigned(pkg)) {
@@ -12129,6 +12130,8 @@ public class NotificationManagerService extends SystemService {
                }
            } catch (RemoteException e) {
                Slog.e(TAG, "Failed to check trusted status of listener", e);
            } finally {
                Binder.restoreCallingIdentity(token);
            }
            return false;
        }