Loading api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -10827,6 +10827,8 @@ package android.content { field public static final int FLAG_ACTIVITY_NO_USER_ACTION = 262144; // 0x40000 field public static final int FLAG_ACTIVITY_PREVIOUS_IS_TOP = 16777216; // 0x1000000 field public static final int FLAG_ACTIVITY_REORDER_TO_FRONT = 131072; // 0x20000 field public static final int FLAG_ACTIVITY_REQUIRE_DEFAULT = 512; // 0x200 field public static final int FLAG_ACTIVITY_REQUIRE_NON_BROWSER = 1024; // 0x400 field public static final int FLAG_ACTIVITY_RESET_TASK_IF_NEEDED = 2097152; // 0x200000 field public static final int FLAG_ACTIVITY_RETAIN_IN_RECENTS = 8192; // 0x2000 field public static final int FLAG_ACTIVITY_SINGLE_TOP = 536870912; // 0x20000000 core/java/android/content/Intent.java +15 −0 Original line number Diff line number Diff line Loading @@ -6477,6 +6477,21 @@ public class Intent implements Parcelable, Cloneable { */ public static final int FLAG_ACTIVITY_MATCH_EXTERNAL = 0x00000800; /** * If set in an intent passed to {@link Context#startActivity Context.startActivity()}, this * flag will only launch the intent if it resolves to a result that is not a browser. If no such * result exists, an {@link ActivityNotFoundException} will be thrown. */ public static final int FLAG_ACTIVITY_REQUIRE_NON_BROWSER = 0x00000400; /** * If set in an intent passed to {@link Context#startActivity Context.startActivity()}, this * flag will only launch the intent if it resolves to a single result. If no such result exists * or if the system chooser would otherwise be displayed, an {@link ActivityNotFoundException} * will be thrown. */ public static final int FLAG_ACTIVITY_REQUIRE_DEFAULT = 0x00000200; /** * If set, when sending a broadcast only registered receivers will be * called -- no BroadcastReceiver components will be launched. Loading services/core/java/android/content/pm/PackageManagerInternal.java +21 −1 Original line number Diff line number Diff line Loading @@ -69,6 +69,25 @@ public abstract class PackageManagerInternal { public static final int PACKAGE_COMPANION = 14; public static final int PACKAGE_RETAIL_DEMO = 15; @IntDef(flag = true, prefix = "RESOLVE_", value = { RESOLVE_NON_BROWSER_ONLY, RESOLVE_NON_RESOLVER_ONLY }) @Retention(RetentionPolicy.SOURCE) public @interface PrivateResolveFlags {} /** * Internal {@link #resolveIntent(Intent, String, int, int, int, boolean, int)} flag: * only match components that contain a generic web intent filter. */ public static final int RESOLVE_NON_BROWSER_ONLY = 0x00000001; /** * Internal {@link #resolveIntent(Intent, String, int, int, int, boolean, int)} flag: do not * match to the resolver. */ public static final int RESOLVE_NON_RESOLVER_ONLY = 0x00000002; @IntDef(value = { INTEGRITY_VERIFICATION_ALLOW, INTEGRITY_VERIFICATION_REJECT, Loading Loading @@ -507,7 +526,8 @@ public abstract class PackageManagerInternal { * Resolves an activity intent, allowing instant apps to be resolved. */ public abstract ResolveInfo resolveIntent(Intent intent, String resolvedType, int flags, int userId, boolean resolveForStart, int filterCallingUid); int flags, @PrivateResolveFlags int privateResolveFlags, int userId, boolean resolveForStart, int filterCallingUid); /** * Resolves a service intent, allowing instant apps to be resolved. Loading services/core/java/com/android/server/pm/ComponentResolver.java +14 −4 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.content.pm.AuxiliaryResolveInfo; import android.content.pm.InstantAppResolveInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManagerInternal; import android.content.pm.PackageManagerInternal.PrivateResolveFlags; import android.content.pm.PackageUserState; import android.content.pm.ProviderInfo; import android.content.pm.ResolveInfo; Loading Loading @@ -229,9 +230,11 @@ public class ComponentResolver { } @Nullable List<ResolveInfo> queryActivities(Intent intent, String resolvedType, int flags, int userId) { List<ResolveInfo> queryActivities(Intent intent, String resolvedType, int flags, @PrivateResolveFlags int privateResolveFlags, int userId) { synchronized (mLock) { return mActivities.queryIntent(intent, resolvedType, flags, userId); return mActivities.queryIntent( intent, resolvedType, flags, privateResolveFlags, userId); } } Loading Loading @@ -368,7 +371,7 @@ public class ComponentResolver { @Nullable List<ResolveInfo> queryReceivers(Intent intent, String resolvedType, int flags, int userId) { synchronized (mLock) { return mReceivers.queryIntent(intent, resolvedType, flags, userId); return mReceivers.queryIntent(intent, resolvedType, flags, 0, userId); } } Loading Loading @@ -1154,11 +1157,12 @@ public class ComponentResolver { } List<ResolveInfo> queryIntent(Intent intent, String resolvedType, int flags, int userId) { int privateResolveFlags, int userId) { if (!sUserManager.exists(userId)) { return null; } mFlags = flags; mPrivateResolveFlags = privateResolveFlags; return super.queryIntent(intent, resolvedType, (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0, userId); Loading Loading @@ -1388,6 +1392,11 @@ public class ComponentResolver { } return null; } final boolean matchNonBrowserOnly = (mPrivateResolveFlags & PackageManagerInternal.RESOLVE_NON_BROWSER_ONLY) != 0; if (matchNonBrowserOnly && info.handleAllWebDataURI()) { return null; } final ResolveInfo res = new ResolveInfo(); res.activityInfo = ai; if ((mFlags & PackageManager.GET_RESOLVED_FILTER) != 0) { Loading Loading @@ -1465,6 +1474,7 @@ public class ComponentResolver { private final ArrayMap<ComponentName, ParsedActivity> mActivities = new ArrayMap<>(); private int mFlags; private int mPrivateResolveFlags; } // Both receivers and activities share a class, but point to different get methods Loading services/core/java/com/android/server/pm/PackageManagerService.java +31 −20 Original line number Diff line number Diff line Loading @@ -179,6 +179,7 @@ import android.content.pm.PackageManager.LegacyPackageDeleteObserver; import android.content.pm.PackageManager.ModuleInfoFlags; import android.content.pm.PackageManagerInternal; import android.content.pm.PackageManagerInternal.PackageListObserver; import android.content.pm.PackageManagerInternal.PrivateResolveFlags; import android.content.pm.PackageParser; import android.content.pm.PackageParser.PackageLite; import android.content.pm.PackageParser.PackageParserException; Loading Loading @@ -6128,8 +6129,8 @@ public class PackageManagerService extends IPackageManager.Stub @Override public ResolveInfo resolveIntent(Intent intent, String resolvedType, int flags, int userId) { return resolveIntentInternal(intent, resolvedType, flags, userId, false, Binder.getCallingUid()); return resolveIntentInternal(intent, resolvedType, flags, 0 /*privateResolveFlags*/, userId, false, Binder.getCallingUid()); } /** Loading @@ -6137,8 +6138,9 @@ public class PackageManagerService extends IPackageManager.Stub * However, if {@code resolveForStart} is {@code true}, all instant apps are visible * since we need to allow the system to start any installed application. */ private ResolveInfo resolveIntentInternal(Intent intent, String resolvedType, int flags, int userId, boolean resolveForStart, int filterCallingUid) { private ResolveInfo resolveIntentInternal(Intent intent, String resolvedType, int flags, @PrivateResolveFlags int privateResolveFlags, int userId, boolean resolveForStart, int filterCallingUid) { try { Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "resolveIntent"); Loading @@ -6150,11 +6152,13 @@ public class PackageManagerService extends IPackageManager.Stub Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "queryIntentActivities"); final List<ResolveInfo> query = queryIntentActivitiesInternal(intent, resolvedType, flags, filterCallingUid, userId, resolveForStart, true /*allowDynamicSplits*/); flags, privateResolveFlags, filterCallingUid, userId, resolveForStart, true /*allowDynamicSplits*/); Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); final ResolveInfo bestChoice = chooseBestActivity(intent, resolvedType, flags, query, userId); chooseBestActivity( intent, resolvedType, flags, privateResolveFlags, query, userId); return bestChoice; } finally { Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); Loading Loading @@ -6312,7 +6316,7 @@ public class PackageManagerService extends IPackageManager.Stub } private ResolveInfo chooseBestActivity(Intent intent, String resolvedType, int flags, List<ResolveInfo> query, int userId) { int flags, int privateResolveFlags, List<ResolveInfo> query, int userId) { if (query != null) { final int N = query.size(); if (N == 1) { Loading Loading @@ -6354,6 +6358,10 @@ public class PackageManagerService extends IPackageManager.Stub } } } if ((privateResolveFlags & PackageManagerInternal.RESOLVE_NON_RESOLVER_ONLY) != 0) { return null; } ri = new ResolveInfo(mResolveInfo); ri.activityInfo = new ActivityInfo(ri.activityInfo); ri.activityInfo.labelRes = ResolverActivity.getLabelRes(intent.getAction()); Loading Loading @@ -6767,13 +6775,13 @@ public class PackageManagerService extends IPackageManager.Stub private @NonNull List<ResolveInfo> queryIntentActivitiesInternal(Intent intent, String resolvedType, int flags, int userId) { return queryIntentActivitiesInternal( intent, resolvedType, flags, Binder.getCallingUid(), userId, false /*resolveForStart*/, true /*allowDynamicSplits*/); intent, resolvedType, flags, 0 /*privateResolveFlags*/, Binder.getCallingUid(), userId, false /*resolveForStart*/, true /*allowDynamicSplits*/); } private @NonNull List<ResolveInfo> queryIntentActivitiesInternal(Intent intent, String resolvedType, int flags, int filterCallingUid, int userId, boolean resolveForStart, boolean allowDynamicSplits) { String resolvedType, int flags, @PrivateResolveFlags int privateResolveFlags, int filterCallingUid, int userId, boolean resolveForStart, boolean allowDynamicSplits) { if (!mUserManager.exists(userId)) return Collections.emptyList(); final String instantAppPkgName = getInstantAppPackageName(filterCallingUid); mPermissionManager.enforceCrossUserPermission(Binder.getCallingUid(), userId, Loading Loading @@ -6858,7 +6866,7 @@ public class PackageManagerService extends IPackageManager.Stub // Check for results in the current profile. result = filterIfNotSystemUser(mComponentResolver.queryActivities( intent, resolvedType, flags, userId), userId); intent, resolvedType, flags, privateResolveFlags, userId), userId); addInstant = isInstantAppResolutionAllowed(intent, result, userId, false /*skipPackageCheck*/); // Check for cross profile results. Loading Loading @@ -6957,7 +6965,7 @@ public class PackageManagerService extends IPackageManager.Stub | PackageManager.GET_RESOLVED_FILTER | PackageManager.MATCH_INSTANT | PackageManager.MATCH_VISIBLE_TO_INSTANT_APP_ONLY, userId); 0, userId); for (int i = instantApps.size() - 1; i >= 0; --i) { final ResolveInfo info = instantApps.get(i); final String packageName = info.activityInfo.packageName; Loading Loading @@ -7061,7 +7069,7 @@ public class PackageManagerService extends IPackageManager.Stub return null; } List<ResolveInfo> resultTargetUser = mComponentResolver.queryActivities(intent, resolvedType, flags, parentUserId); resolvedType, flags, 0, parentUserId); if (resultTargetUser == null || resultTargetUser.isEmpty()) { return null; Loading Loading @@ -7246,8 +7254,9 @@ public class PackageManagerService extends IPackageManager.Stub failureActivityIntent.setPackage(packageName); // IMPORTANT: disallow dynamic splits to avoid an infinite loop final List<ResolveInfo> result = queryIntentActivitiesInternal( failureActivityIntent, null /*resolvedType*/, 0 /*flags*/, filterCallingUid, userId, false /*resolveForStart*/, false /*allowDynamicSplits*/); failureActivityIntent, null /*resolvedType*/, 0 /*flags*/, 0 /*privateResolveFlags*/, filterCallingUid, userId, false /*resolveForStart*/, false /*allowDynamicSplits*/); final int NR = result.size(); if (NR > 0) { for (int i = 0; i < NR; i++) { Loading Loading @@ -7502,7 +7511,7 @@ public class PackageManagerService extends IPackageManager.Stub String resolvedType, int flags, int sourceUserId) { int targetUserId = filter.getTargetUserId(); List<ResolveInfo> resultTargetUser = mComponentResolver.queryActivities(intent, resolvedType, flags, targetUserId); resolvedType, flags, 0, targetUserId); if (resultTargetUser != null && isUserEnabled(targetUserId)) { // If all the matches in the target profile are suspended, return null. for (int i = resultTargetUser.size() - 1; i >= 0; i--) { Loading Loading @@ -23324,7 +23333,7 @@ public class PackageManagerService extends IPackageManager.Stub public List<ResolveInfo> queryIntentActivities( Intent intent, String resolvedType, int flags, int filterCallingUid, int userId) { return PackageManagerService.this .queryIntentActivitiesInternal(intent, resolvedType, flags, filterCallingUid, .queryIntentActivitiesInternal(intent, resolvedType, flags, 0, filterCallingUid, userId, false /*resolveForStart*/, true /*allowDynamicSplits*/); } Loading Loading @@ -23610,9 +23619,11 @@ public class PackageManagerService extends IPackageManager.Stub @Override public ResolveInfo resolveIntent(Intent intent, String resolvedType, int flags, int userId, boolean resolveForStart, int filterCallingUid) { int flags, int privateResolveFlags, int userId, boolean resolveForStart, int filterCallingUid) { return resolveIntentInternal( intent, resolvedType, flags, userId, resolveForStart, filterCallingUid); intent, resolvedType, flags, privateResolveFlags, userId, resolveForStart, filterCallingUid); } @Override Loading
api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -10827,6 +10827,8 @@ package android.content { field public static final int FLAG_ACTIVITY_NO_USER_ACTION = 262144; // 0x40000 field public static final int FLAG_ACTIVITY_PREVIOUS_IS_TOP = 16777216; // 0x1000000 field public static final int FLAG_ACTIVITY_REORDER_TO_FRONT = 131072; // 0x20000 field public static final int FLAG_ACTIVITY_REQUIRE_DEFAULT = 512; // 0x200 field public static final int FLAG_ACTIVITY_REQUIRE_NON_BROWSER = 1024; // 0x400 field public static final int FLAG_ACTIVITY_RESET_TASK_IF_NEEDED = 2097152; // 0x200000 field public static final int FLAG_ACTIVITY_RETAIN_IN_RECENTS = 8192; // 0x2000 field public static final int FLAG_ACTIVITY_SINGLE_TOP = 536870912; // 0x20000000
core/java/android/content/Intent.java +15 −0 Original line number Diff line number Diff line Loading @@ -6477,6 +6477,21 @@ public class Intent implements Parcelable, Cloneable { */ public static final int FLAG_ACTIVITY_MATCH_EXTERNAL = 0x00000800; /** * If set in an intent passed to {@link Context#startActivity Context.startActivity()}, this * flag will only launch the intent if it resolves to a result that is not a browser. If no such * result exists, an {@link ActivityNotFoundException} will be thrown. */ public static final int FLAG_ACTIVITY_REQUIRE_NON_BROWSER = 0x00000400; /** * If set in an intent passed to {@link Context#startActivity Context.startActivity()}, this * flag will only launch the intent if it resolves to a single result. If no such result exists * or if the system chooser would otherwise be displayed, an {@link ActivityNotFoundException} * will be thrown. */ public static final int FLAG_ACTIVITY_REQUIRE_DEFAULT = 0x00000200; /** * If set, when sending a broadcast only registered receivers will be * called -- no BroadcastReceiver components will be launched. Loading
services/core/java/android/content/pm/PackageManagerInternal.java +21 −1 Original line number Diff line number Diff line Loading @@ -69,6 +69,25 @@ public abstract class PackageManagerInternal { public static final int PACKAGE_COMPANION = 14; public static final int PACKAGE_RETAIL_DEMO = 15; @IntDef(flag = true, prefix = "RESOLVE_", value = { RESOLVE_NON_BROWSER_ONLY, RESOLVE_NON_RESOLVER_ONLY }) @Retention(RetentionPolicy.SOURCE) public @interface PrivateResolveFlags {} /** * Internal {@link #resolveIntent(Intent, String, int, int, int, boolean, int)} flag: * only match components that contain a generic web intent filter. */ public static final int RESOLVE_NON_BROWSER_ONLY = 0x00000001; /** * Internal {@link #resolveIntent(Intent, String, int, int, int, boolean, int)} flag: do not * match to the resolver. */ public static final int RESOLVE_NON_RESOLVER_ONLY = 0x00000002; @IntDef(value = { INTEGRITY_VERIFICATION_ALLOW, INTEGRITY_VERIFICATION_REJECT, Loading Loading @@ -507,7 +526,8 @@ public abstract class PackageManagerInternal { * Resolves an activity intent, allowing instant apps to be resolved. */ public abstract ResolveInfo resolveIntent(Intent intent, String resolvedType, int flags, int userId, boolean resolveForStart, int filterCallingUid); int flags, @PrivateResolveFlags int privateResolveFlags, int userId, boolean resolveForStart, int filterCallingUid); /** * Resolves a service intent, allowing instant apps to be resolved. Loading
services/core/java/com/android/server/pm/ComponentResolver.java +14 −4 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.content.pm.AuxiliaryResolveInfo; import android.content.pm.InstantAppResolveInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManagerInternal; import android.content.pm.PackageManagerInternal.PrivateResolveFlags; import android.content.pm.PackageUserState; import android.content.pm.ProviderInfo; import android.content.pm.ResolveInfo; Loading Loading @@ -229,9 +230,11 @@ public class ComponentResolver { } @Nullable List<ResolveInfo> queryActivities(Intent intent, String resolvedType, int flags, int userId) { List<ResolveInfo> queryActivities(Intent intent, String resolvedType, int flags, @PrivateResolveFlags int privateResolveFlags, int userId) { synchronized (mLock) { return mActivities.queryIntent(intent, resolvedType, flags, userId); return mActivities.queryIntent( intent, resolvedType, flags, privateResolveFlags, userId); } } Loading Loading @@ -368,7 +371,7 @@ public class ComponentResolver { @Nullable List<ResolveInfo> queryReceivers(Intent intent, String resolvedType, int flags, int userId) { synchronized (mLock) { return mReceivers.queryIntent(intent, resolvedType, flags, userId); return mReceivers.queryIntent(intent, resolvedType, flags, 0, userId); } } Loading Loading @@ -1154,11 +1157,12 @@ public class ComponentResolver { } List<ResolveInfo> queryIntent(Intent intent, String resolvedType, int flags, int userId) { int privateResolveFlags, int userId) { if (!sUserManager.exists(userId)) { return null; } mFlags = flags; mPrivateResolveFlags = privateResolveFlags; return super.queryIntent(intent, resolvedType, (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0, userId); Loading Loading @@ -1388,6 +1392,11 @@ public class ComponentResolver { } return null; } final boolean matchNonBrowserOnly = (mPrivateResolveFlags & PackageManagerInternal.RESOLVE_NON_BROWSER_ONLY) != 0; if (matchNonBrowserOnly && info.handleAllWebDataURI()) { return null; } final ResolveInfo res = new ResolveInfo(); res.activityInfo = ai; if ((mFlags & PackageManager.GET_RESOLVED_FILTER) != 0) { Loading Loading @@ -1465,6 +1474,7 @@ public class ComponentResolver { private final ArrayMap<ComponentName, ParsedActivity> mActivities = new ArrayMap<>(); private int mFlags; private int mPrivateResolveFlags; } // Both receivers and activities share a class, but point to different get methods Loading
services/core/java/com/android/server/pm/PackageManagerService.java +31 −20 Original line number Diff line number Diff line Loading @@ -179,6 +179,7 @@ import android.content.pm.PackageManager.LegacyPackageDeleteObserver; import android.content.pm.PackageManager.ModuleInfoFlags; import android.content.pm.PackageManagerInternal; import android.content.pm.PackageManagerInternal.PackageListObserver; import android.content.pm.PackageManagerInternal.PrivateResolveFlags; import android.content.pm.PackageParser; import android.content.pm.PackageParser.PackageLite; import android.content.pm.PackageParser.PackageParserException; Loading Loading @@ -6128,8 +6129,8 @@ public class PackageManagerService extends IPackageManager.Stub @Override public ResolveInfo resolveIntent(Intent intent, String resolvedType, int flags, int userId) { return resolveIntentInternal(intent, resolvedType, flags, userId, false, Binder.getCallingUid()); return resolveIntentInternal(intent, resolvedType, flags, 0 /*privateResolveFlags*/, userId, false, Binder.getCallingUid()); } /** Loading @@ -6137,8 +6138,9 @@ public class PackageManagerService extends IPackageManager.Stub * However, if {@code resolveForStart} is {@code true}, all instant apps are visible * since we need to allow the system to start any installed application. */ private ResolveInfo resolveIntentInternal(Intent intent, String resolvedType, int flags, int userId, boolean resolveForStart, int filterCallingUid) { private ResolveInfo resolveIntentInternal(Intent intent, String resolvedType, int flags, @PrivateResolveFlags int privateResolveFlags, int userId, boolean resolveForStart, int filterCallingUid) { try { Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "resolveIntent"); Loading @@ -6150,11 +6152,13 @@ public class PackageManagerService extends IPackageManager.Stub Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "queryIntentActivities"); final List<ResolveInfo> query = queryIntentActivitiesInternal(intent, resolvedType, flags, filterCallingUid, userId, resolveForStart, true /*allowDynamicSplits*/); flags, privateResolveFlags, filterCallingUid, userId, resolveForStart, true /*allowDynamicSplits*/); Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); final ResolveInfo bestChoice = chooseBestActivity(intent, resolvedType, flags, query, userId); chooseBestActivity( intent, resolvedType, flags, privateResolveFlags, query, userId); return bestChoice; } finally { Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); Loading Loading @@ -6312,7 +6316,7 @@ public class PackageManagerService extends IPackageManager.Stub } private ResolveInfo chooseBestActivity(Intent intent, String resolvedType, int flags, List<ResolveInfo> query, int userId) { int flags, int privateResolveFlags, List<ResolveInfo> query, int userId) { if (query != null) { final int N = query.size(); if (N == 1) { Loading Loading @@ -6354,6 +6358,10 @@ public class PackageManagerService extends IPackageManager.Stub } } } if ((privateResolveFlags & PackageManagerInternal.RESOLVE_NON_RESOLVER_ONLY) != 0) { return null; } ri = new ResolveInfo(mResolveInfo); ri.activityInfo = new ActivityInfo(ri.activityInfo); ri.activityInfo.labelRes = ResolverActivity.getLabelRes(intent.getAction()); Loading Loading @@ -6767,13 +6775,13 @@ public class PackageManagerService extends IPackageManager.Stub private @NonNull List<ResolveInfo> queryIntentActivitiesInternal(Intent intent, String resolvedType, int flags, int userId) { return queryIntentActivitiesInternal( intent, resolvedType, flags, Binder.getCallingUid(), userId, false /*resolveForStart*/, true /*allowDynamicSplits*/); intent, resolvedType, flags, 0 /*privateResolveFlags*/, Binder.getCallingUid(), userId, false /*resolveForStart*/, true /*allowDynamicSplits*/); } private @NonNull List<ResolveInfo> queryIntentActivitiesInternal(Intent intent, String resolvedType, int flags, int filterCallingUid, int userId, boolean resolveForStart, boolean allowDynamicSplits) { String resolvedType, int flags, @PrivateResolveFlags int privateResolveFlags, int filterCallingUid, int userId, boolean resolveForStart, boolean allowDynamicSplits) { if (!mUserManager.exists(userId)) return Collections.emptyList(); final String instantAppPkgName = getInstantAppPackageName(filterCallingUid); mPermissionManager.enforceCrossUserPermission(Binder.getCallingUid(), userId, Loading Loading @@ -6858,7 +6866,7 @@ public class PackageManagerService extends IPackageManager.Stub // Check for results in the current profile. result = filterIfNotSystemUser(mComponentResolver.queryActivities( intent, resolvedType, flags, userId), userId); intent, resolvedType, flags, privateResolveFlags, userId), userId); addInstant = isInstantAppResolutionAllowed(intent, result, userId, false /*skipPackageCheck*/); // Check for cross profile results. Loading Loading @@ -6957,7 +6965,7 @@ public class PackageManagerService extends IPackageManager.Stub | PackageManager.GET_RESOLVED_FILTER | PackageManager.MATCH_INSTANT | PackageManager.MATCH_VISIBLE_TO_INSTANT_APP_ONLY, userId); 0, userId); for (int i = instantApps.size() - 1; i >= 0; --i) { final ResolveInfo info = instantApps.get(i); final String packageName = info.activityInfo.packageName; Loading Loading @@ -7061,7 +7069,7 @@ public class PackageManagerService extends IPackageManager.Stub return null; } List<ResolveInfo> resultTargetUser = mComponentResolver.queryActivities(intent, resolvedType, flags, parentUserId); resolvedType, flags, 0, parentUserId); if (resultTargetUser == null || resultTargetUser.isEmpty()) { return null; Loading Loading @@ -7246,8 +7254,9 @@ public class PackageManagerService extends IPackageManager.Stub failureActivityIntent.setPackage(packageName); // IMPORTANT: disallow dynamic splits to avoid an infinite loop final List<ResolveInfo> result = queryIntentActivitiesInternal( failureActivityIntent, null /*resolvedType*/, 0 /*flags*/, filterCallingUid, userId, false /*resolveForStart*/, false /*allowDynamicSplits*/); failureActivityIntent, null /*resolvedType*/, 0 /*flags*/, 0 /*privateResolveFlags*/, filterCallingUid, userId, false /*resolveForStart*/, false /*allowDynamicSplits*/); final int NR = result.size(); if (NR > 0) { for (int i = 0; i < NR; i++) { Loading Loading @@ -7502,7 +7511,7 @@ public class PackageManagerService extends IPackageManager.Stub String resolvedType, int flags, int sourceUserId) { int targetUserId = filter.getTargetUserId(); List<ResolveInfo> resultTargetUser = mComponentResolver.queryActivities(intent, resolvedType, flags, targetUserId); resolvedType, flags, 0, targetUserId); if (resultTargetUser != null && isUserEnabled(targetUserId)) { // If all the matches in the target profile are suspended, return null. for (int i = resultTargetUser.size() - 1; i >= 0; i--) { Loading Loading @@ -23324,7 +23333,7 @@ public class PackageManagerService extends IPackageManager.Stub public List<ResolveInfo> queryIntentActivities( Intent intent, String resolvedType, int flags, int filterCallingUid, int userId) { return PackageManagerService.this .queryIntentActivitiesInternal(intent, resolvedType, flags, filterCallingUid, .queryIntentActivitiesInternal(intent, resolvedType, flags, 0, filterCallingUid, userId, false /*resolveForStart*/, true /*allowDynamicSplits*/); } Loading Loading @@ -23610,9 +23619,11 @@ public class PackageManagerService extends IPackageManager.Stub @Override public ResolveInfo resolveIntent(Intent intent, String resolvedType, int flags, int userId, boolean resolveForStart, int filterCallingUid) { int flags, int privateResolveFlags, int userId, boolean resolveForStart, int filterCallingUid) { return resolveIntentInternal( intent, resolvedType, flags, userId, resolveForStart, filterCallingUid); intent, resolvedType, flags, privateResolveFlags, userId, resolveForStart, filterCallingUid); } @Override