Loading services/core/java/com/android/server/pm/PackageManagerService.java +14 −12 Original line number Original line Diff line number Diff line Loading @@ -7173,8 +7173,20 @@ public class PackageManagerService extends IPackageManager.Stub { int userId) { int userId) { if (!sUserManager.exists(userId)) return null; if (!sUserManager.exists(userId)) return null; mFlags = flags; mFlags = flags; return super.queryIntent(intent, resolvedType, List<ResolveInfo> list = super.queryIntent(intent, resolvedType, (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0, userId); (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0, userId); // Remove protected Application components int callingUid = Binder.getCallingUid(); if (callingUid != Process.SYSTEM_UID && (getFlagsForUid(callingUid) & ApplicationInfo.FLAG_SYSTEM) == 0) { Iterator<ResolveInfo> itr = list.iterator(); while (itr.hasNext()) { if (itr.next().activityInfo.applicationInfo.protect) { itr.remove(); } } } return list; } } public List<ResolveInfo> queryIntentForPackage(Intent intent, String resolvedType, public List<ResolveInfo> queryIntentForPackage(Intent intent, String resolvedType, Loading Loading @@ -7580,18 +7592,8 @@ public class PackageManagerService extends IPackageManager.Stub { if (!sUserManager.exists(userId)) if (!sUserManager.exists(userId)) return null; return null; mFlags = flags; mFlags = flags; List<ResolveInfo> list = super.queryIntent(intent, resolvedType, return super.queryIntent(intent, resolvedType, (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0, userId); (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0, userId); // Remove protected Application components if (Binder.getCallingUid() != Process.SYSTEM_UID) { Iterator<ResolveInfo> itr = list.iterator(); while (itr.hasNext()) { if (itr.next().activityInfo.applicationInfo.protect) { itr.remove(); } } } return list; } } public List<ResolveInfo> queryIntentForPackage(Intent intent, String resolvedType, public List<ResolveInfo> queryIntentForPackage(Intent intent, String resolvedType, Loading Loading
services/core/java/com/android/server/pm/PackageManagerService.java +14 −12 Original line number Original line Diff line number Diff line Loading @@ -7173,8 +7173,20 @@ public class PackageManagerService extends IPackageManager.Stub { int userId) { int userId) { if (!sUserManager.exists(userId)) return null; if (!sUserManager.exists(userId)) return null; mFlags = flags; mFlags = flags; return super.queryIntent(intent, resolvedType, List<ResolveInfo> list = super.queryIntent(intent, resolvedType, (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0, userId); (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0, userId); // Remove protected Application components int callingUid = Binder.getCallingUid(); if (callingUid != Process.SYSTEM_UID && (getFlagsForUid(callingUid) & ApplicationInfo.FLAG_SYSTEM) == 0) { Iterator<ResolveInfo> itr = list.iterator(); while (itr.hasNext()) { if (itr.next().activityInfo.applicationInfo.protect) { itr.remove(); } } } return list; } } public List<ResolveInfo> queryIntentForPackage(Intent intent, String resolvedType, public List<ResolveInfo> queryIntentForPackage(Intent intent, String resolvedType, Loading Loading @@ -7580,18 +7592,8 @@ public class PackageManagerService extends IPackageManager.Stub { if (!sUserManager.exists(userId)) if (!sUserManager.exists(userId)) return null; return null; mFlags = flags; mFlags = flags; List<ResolveInfo> list = super.queryIntent(intent, resolvedType, return super.queryIntent(intent, resolvedType, (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0, userId); (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0, userId); // Remove protected Application components if (Binder.getCallingUid() != Process.SYSTEM_UID) { Iterator<ResolveInfo> itr = list.iterator(); while (itr.hasNext()) { if (itr.next().activityInfo.applicationInfo.protect) { itr.remove(); } } } return list; } } public List<ResolveInfo> queryIntentForPackage(Intent intent, String resolvedType, public List<ResolveInfo> queryIntentForPackage(Intent intent, String resolvedType, Loading