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

Commit 15ef6e23 authored by Michal Karpinski's avatar Michal Karpinski Committed by Android (Google) Code Review
Browse files

Merge "Never generate synthetic AppInfo activity for any system app"

parents b2117bbc 6d5795f3
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -316,17 +316,22 @@ public class LauncherAppsService extends SystemService {

            final int callingUid = injectBinderCallingUid();
            final ArrayList<ResolveInfo> result = new ArrayList<>(launcherActivities.getList());
            final PackageManagerInternal pmInt =
                    LocalServices.getService(PackageManagerInternal.class);
            if (packageName != null) {
                // If target package has launcher activities, then return those launcher
                // activities. Otherwise, return hidden activity that forwards user to app
                // details page.
                // If this hidden app should not be shown, return the original list.
                // Otherwise, inject hidden activity that forwards user to app details page.
                if (result.size() > 0) {
                    return launcherActivities;
                }
                ApplicationInfo appInfo = pmInt.getApplicationInfo(packageName, /*flags*/ 0,
                        callingUid, user.getIdentifier());
                if (shouldShowHiddenApp(appInfo)) {
                    ResolveInfo info = getHiddenAppActivityInfo(packageName, callingUid, user);
                    if (info != null) {
                        result.add(info);
                    }
                }
                return new ParceledListSlice<>(result);
            }

@@ -336,8 +341,6 @@ public class LauncherAppsService extends SystemService {
                for (ResolveInfo info : result) {
                    visiblePackages.add(info.activityInfo.packageName);
                }
                final PackageManagerInternal pmInt =
                        LocalServices.getService(PackageManagerInternal.class);
                List<ApplicationInfo> installedPackages = pmInt.getInstalledApplications(0,
                        user.getIdentifier(), callingUid);
                for (ApplicationInfo applicationInfo : installedPackages) {