Do not adding ResolveInfo if no ephemeral installer

For the components such as Provider and Service declared in the
base apk but defined in the non-installed split. Do not adding it
to the ResolveInfo List in the query intent resolve functions if
the ephemeral installer could not be found.

Bug: 177638069
Test: atest SplitTests
Change-Id: Ibf4f4fc5b594326da88edbb2d12f9f6399df38c6
This commit is contained in:
Rhed Jao
2021-01-25 20:15:25 +08:00
parent 5bb5544909
commit 57a0fad19e

View File

@@ -3138,6 +3138,14 @@ public class PackageManagerService extends IPackageManager.Stub
if (info.serviceInfo.splitName != null
&& !ArrayUtils.contains(info.serviceInfo.applicationInfo.splitNames,
info.serviceInfo.splitName)) {
if (instantAppInstallerActivity() == null) {
if (DEBUG_INSTANT) {
Slog.v(TAG, "No installer - not adding it to the ResolveInfo"
+ "list");
}
resolveInfos.remove(i);
continue;
}
// requested service is defined in a split that hasn't been installed yet.
// add the installer to the resolve list
if (DEBUG_INSTANT) {
@@ -10551,6 +10559,13 @@ public class PackageManagerService extends IPackageManager.Stub
if (info.providerInfo.splitName != null
&& !ArrayUtils.contains(info.providerInfo.applicationInfo.splitNames,
info.providerInfo.splitName)) {
if (mInstantAppInstallerActivity == null) {
if (DEBUG_INSTANT) {
Slog.v(TAG, "No installer - not adding it to the ResolveInfo list");
}
resolveInfos.remove(i);
continue;
}
// requested provider is defined in a split that hasn't been installed yet.
// add the installer to the resolve list
if (DEBUG_INSTANT) {