Allow start of explicit intents
This change relaxes startActivity* logic to allow for all explicit intents to be started, even if the package name provided for such intent is not visible to the caller. Fixes: 161007330 Bug: 148657387 Test: atest AppEnumerationTests Change-Id: Iceaee276e8d4c297ace1fe605100f52e4cc49b07
This commit is contained in:
@@ -7161,8 +7161,9 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
&& ((!matchInstantApp && !isCallerInstantApp && isTargetInstantApp)
|
||||
|| (matchVisibleToInstantAppOnly && isCallerInstantApp
|
||||
&& isTargetHiddenFromInstantApp));
|
||||
final boolean blockNormalResolution = !isTargetInstantApp && !isCallerInstantApp
|
||||
&& shouldFilterApplicationLocked(
|
||||
final boolean blockNormalResolution =
|
||||
!resolveForStart && !isTargetInstantApp && !isCallerInstantApp
|
||||
&& shouldFilterApplicationLocked(
|
||||
getPackageSettingInternal(ai.applicationInfo.packageName,
|
||||
Process.SYSTEM_UID), filterCallingUid, userId);
|
||||
if (!blockInstantResolution && !blockNormalResolution) {
|
||||
@@ -7255,8 +7256,8 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
final PackageSetting setting =
|
||||
getPackageSettingInternal(pkgName, Process.SYSTEM_UID);
|
||||
result = null;
|
||||
if (setting != null && setting.pkg != null
|
||||
&& !shouldFilterApplicationLocked(setting, filterCallingUid, userId)) {
|
||||
if (setting != null && setting.pkg != null && (resolveForStart
|
||||
|| !shouldFilterApplicationLocked(setting, filterCallingUid, userId))) {
|
||||
result = filterIfNotSystemUser(mComponentResolver.queryActivities(
|
||||
intent, resolvedType, flags, setting.pkg.getActivities(), userId),
|
||||
userId);
|
||||
|
||||
Reference in New Issue
Block a user