Better handle notification uid resolution for missing pkgs

system_process can post and cancel notifications on behalf
of apps (e.g. AccountManagerService posting a 'please
log into this account' notification).  The cancellation
signal for these notifications can happen after the app
has been removed (indeed, the app removal might be the reason
the system tries to cancel the notification). If the system
tries to cancel a notification for a package that does not
exist, log and return instead of throwing a SecurityException. A
SecurityException will still be thrown if an app tries to post
a notification for an app that doesn't exist.

Test: atest
Fixes: 138922329
Change-Id: Id315ebe7ae86f877ba62cfbe07efd14ac354a4d1
2 files changed