Loading services/core/java/com/android/server/pm/LauncherAppsService.java +29 −18 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.app.AppDetailsActivity; import android.app.AppGlobals; import android.app.IApplicationThread; import android.app.PendingIntent; import android.app.admin.DevicePolicyManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; Loading Loading @@ -115,6 +116,7 @@ public class LauncherAppsService extends SystemService { private final ShortcutServiceInternal mShortcutServiceInternal; private final PackageCallbackList<IOnAppsChangedListener> mListeners = new PackageCallbackList<IOnAppsChangedListener>(); private final DevicePolicyManager mDpm; private final MyPackageMonitor mPackageMonitor = new MyPackageMonitor(); Loading @@ -133,6 +135,7 @@ public class LauncherAppsService extends SystemService { LocalServices.getService(ShortcutServiceInternal.class)); mShortcutServiceInternal.addListener(mPackageMonitor); mCallbackHandler = BackgroundThread.getHandler(); mDpm = (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE); } @VisibleForTesting Loading Loading @@ -319,6 +322,17 @@ public class LauncherAppsService extends SystemService { } final int callingUid = injectBinderCallingUid(); final long ident = injectClearCallingIdentity(); try { if (mUm.getUserInfo(user.getIdentifier()).isManagedProfile()) { // Managed profile should not show hidden apps return launcherActivities; } if (mDpm.getDeviceOwnerComponentOnAnyUser() != null) { // Device owner devices should not show hidden apps return launcherActivities; } final ArrayList<ResolveInfo> result = new ArrayList<>(launcherActivities.getList()); final PackageManagerInternal pmInt = LocalServices.getService(PackageManagerInternal.class); Loading @@ -338,9 +352,6 @@ public class LauncherAppsService extends SystemService { } return new ParceledListSlice<>(result); } long ident = injectClearCallingIdentity(); try { final HashSet<String> visiblePackages = new HashSet<>(); for (ResolveInfo info : result) { visiblePackages.add(info.activityInfo.packageName); Loading Loading
services/core/java/com/android/server/pm/LauncherAppsService.java +29 −18 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.app.AppDetailsActivity; import android.app.AppGlobals; import android.app.IApplicationThread; import android.app.PendingIntent; import android.app.admin.DevicePolicyManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; Loading Loading @@ -115,6 +116,7 @@ public class LauncherAppsService extends SystemService { private final ShortcutServiceInternal mShortcutServiceInternal; private final PackageCallbackList<IOnAppsChangedListener> mListeners = new PackageCallbackList<IOnAppsChangedListener>(); private final DevicePolicyManager mDpm; private final MyPackageMonitor mPackageMonitor = new MyPackageMonitor(); Loading @@ -133,6 +135,7 @@ public class LauncherAppsService extends SystemService { LocalServices.getService(ShortcutServiceInternal.class)); mShortcutServiceInternal.addListener(mPackageMonitor); mCallbackHandler = BackgroundThread.getHandler(); mDpm = (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE); } @VisibleForTesting Loading Loading @@ -319,6 +322,17 @@ public class LauncherAppsService extends SystemService { } final int callingUid = injectBinderCallingUid(); final long ident = injectClearCallingIdentity(); try { if (mUm.getUserInfo(user.getIdentifier()).isManagedProfile()) { // Managed profile should not show hidden apps return launcherActivities; } if (mDpm.getDeviceOwnerComponentOnAnyUser() != null) { // Device owner devices should not show hidden apps return launcherActivities; } final ArrayList<ResolveInfo> result = new ArrayList<>(launcherActivities.getList()); final PackageManagerInternal pmInt = LocalServices.getService(PackageManagerInternal.class); Loading @@ -338,9 +352,6 @@ public class LauncherAppsService extends SystemService { } return new ParceledListSlice<>(result); } long ident = injectClearCallingIdentity(); try { final HashSet<String> visiblePackages = new HashSet<>(); for (ResolveInfo info : result) { visiblePackages.add(info.activityInfo.packageName); Loading