diff options
| author | 2017-05-05 15:46:32 +0000 | |
|---|---|---|
| committer | 2017-05-05 15:46:37 +0000 | |
| commit | 8cfb1a95dac102bbe2dbb931df0dd60da083ee2c (patch) | |
| tree | f53638c6362cb76539ac03dfe247fcc62b868421 | |
| parent | 802d008e1b1c766b375fce9c776cc76a0c6cbf5a (diff) | |
| parent | a1d8051fa2317d897a6b20442177e357172e93db (diff) | |
Merge "Revert "Create auxiliary info for local instant apps"" into oc-dev
| -rw-r--r-- | core/java/android/content/pm/InstantAppResolveInfo.java | 4 | ||||
| -rw-r--r-- | services/core/java/com/android/server/pm/PackageManagerService.java | 39 |
2 files changed, 15 insertions, 28 deletions
diff --git a/core/java/android/content/pm/InstantAppResolveInfo.java b/core/java/android/content/pm/InstantAppResolveInfo.java index dcaf66ebc43b..603192a51af7 100644 --- a/core/java/android/content/pm/InstantAppResolveInfo.java +++ b/core/java/android/content/pm/InstantAppResolveInfo.java @@ -47,7 +47,7 @@ public final class InstantAppResolveInfo implements Parcelable { private final int mVersionCode; public InstantAppResolveInfo(@NonNull InstantAppDigest digest, @Nullable String packageName, - @Nullable List<InstantAppIntentFilter> filters, int versionCode) { + @Nullable List<InstantAppIntentFilter> filters, int versionConde) { // validate arguments if ((packageName == null && (filters != null && filters.size() != 0)) || (packageName != null && (filters == null || filters.size() == 0))) { @@ -61,7 +61,7 @@ public final class InstantAppResolveInfo implements Parcelable { mFilters = null; } mPackageName = packageName; - mVersionCode = versionCode; + mVersionCode = versionConde; } public InstantAppResolveInfo(@NonNull String hostName, @Nullable String packageName, diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 78d931f7a76a..55285c86d81e 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -6498,12 +6498,11 @@ public class PackageManagerService extends IPackageManager.Stub String resolvedType, int flags, int userId) { // first, check to see if we've got an instant app already installed final boolean alreadyResolvedLocally = (flags & PackageManager.MATCH_INSTANT) != 0; - ResolveInfo localInstantApp = null; + boolean localInstantAppAvailable = false; boolean blockResolution = false; if (!alreadyResolvedLocally) { final List<ResolveInfo> instantApps = mActivities.queryIntent(intent, resolvedType, flags - | PackageManager.GET_RESOLVED_FILTER | PackageManager.MATCH_INSTANT | PackageManager.MATCH_VISIBLE_TO_INSTANT_APP_ONLY, userId); @@ -6530,7 +6529,7 @@ public class PackageManagerService extends IPackageManager.Stub if (DEBUG_EPHEMERAL) { Slog.v(TAG, "Found installed instant app; pkg: " + packageName); } - localInstantApp = info; + localInstantAppAvailable = true; break; } } @@ -6538,29 +6537,17 @@ public class PackageManagerService extends IPackageManager.Stub } // no app installed, let's see if one's available AuxiliaryResolveInfo auxiliaryResponse = null; - if (!blockResolution) { - if (localInstantApp == null) { - // we don't have an instant app locally, resolve externally - Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "resolveEphemeral"); - final InstantAppRequest requestObject = new InstantAppRequest( - null /*responseObj*/, intent /*origIntent*/, resolvedType, - null /*callingPackage*/, userId, null /*verificationBundle*/); - auxiliaryResponse = - InstantAppResolver.doInstantAppResolutionPhaseOne( - mContext, mInstantAppResolverConnection, requestObject); - Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); - } else { - // we have an instant application locally, but, we can't admit that since - // callers shouldn't be able to determine prior browsing. create a dummy - // auxiliary response so the downstream code behaves as if there's an - // instant application available externally. when it comes time to start - // the instant application, we'll do the right thing. - final ApplicationInfo ai = localInstantApp.activityInfo.applicationInfo; - auxiliaryResponse = new AuxiliaryResolveInfo( - ai.packageName, null /*splitName*/, ai.versionCode); - } + if (!localInstantAppAvailable && !blockResolution) { + Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "resolveEphemeral"); + final InstantAppRequest requestObject = new InstantAppRequest( + null /*responseObj*/, intent /*origIntent*/, resolvedType, + null /*callingPackage*/, userId, null /*verificationBundle*/); + auxiliaryResponse = + InstantAppResolver.doInstantAppResolutionPhaseOne( + mContext, mInstantAppResolverConnection, requestObject); + Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); } - if (auxiliaryResponse != null) { + if (localInstantAppAvailable || auxiliaryResponse != null) { if (DEBUG_EPHEMERAL) { Slog.v(TAG, "Adding ephemeral installer to the ResolveInfo list"); } @@ -6580,7 +6567,7 @@ public class PackageManagerService extends IPackageManager.Stub ephemeralInstaller.filter = new IntentFilter(intent.getAction()); ephemeralInstaller.filter.addDataPath( intent.getData().getPath(), PatternMatcher.PATTERN_LITERAL); - ephemeralInstaller.isInstantAppAvailable = true; + ephemeralInstaller.instantAppAvailable = true; result.add(ephemeralInstaller); } } |