Fix an issue LauncherApps couldn’t get onPackageRemoved Callback
The system apps which registered listener in LauncherApps couldn't get
ACTION_PACKAGE_REMOVED_INTERNAL broadcast because they are not in
allowlist of package visibility. They must see all applications so
modify the code if the appId is smaller than 10000 it should be always
allowed.
Bug: 196910947
Test: Register a listener of a system app to LauncherAppsService and
verify if can get the broadcast.
Change-Id: I39f4365cfa09ffa9afeccd13a8703846db357cbf
This commit is contained in:
committed by
Patrick Baumann
parent
f9a3f5cd88
commit
fdb68fbfce
@@ -1263,7 +1263,7 @@ public class LauncherAppsService extends SystemService {
|
||||
|
||||
/** Returns whether or not the given appId is in allow list */
|
||||
private static boolean isCallingAppIdAllowed(int[] appIdAllowList, @AppIdInt int appId) {
|
||||
if (appIdAllowList == null) {
|
||||
if (appIdAllowList == null || appId < Process.FIRST_APPLICATION_UID) {
|
||||
return true;
|
||||
}
|
||||
return Arrays.binarySearch(appIdAllowList, appId) > -1;
|
||||
|
||||
Reference in New Issue
Block a user