From 303c786927bd646a4ad3b8ec55683e6d6309513b Mon Sep 17 00:00:00 2001 From: Todd Kennedy Date: Tue, 9 May 2017 09:43:23 -0700 Subject: [PATCH] Don't require BROWSABLE Initially we wanted to limit instant apps to VIEW/BROWSABLE intents, but, apparently apps don't always set the BROWSABLE category. So, allow any VIEW intent w/ a URL to resovle to an instant app. Change-Id: I96e25cca8abcbe89b4a227b707112184c19565c6 Fixes: 38146110 Test: Manual Test: open go/aia-test-links Test: click any link Test: notice it launches the instant app directly [instead of going through the installer] --- services/core/java/com/android/server/am/ActivityStarter.java | 1 - .../core/java/com/android/server/pm/PackageManagerService.java | 1 - 2 files changed, 2 deletions(-) diff --git a/services/core/java/com/android/server/am/ActivityStarter.java b/services/core/java/com/android/server/am/ActivityStarter.java index e33ae0de8a954..6d4eb5b03d89e 100644 --- a/services/core/java/com/android/server/am/ActivityStarter.java +++ b/services/core/java/com/android/server/am/ActivityStarter.java @@ -637,7 +637,6 @@ class ActivityStarter { if (componentSpecified && intent.getData() != null && Intent.ACTION_VIEW.equals(intent.getAction()) - && intent.hasCategory(Intent.CATEGORY_BROWSABLE) && mService.getPackageManagerInternalLocked() .isInstantAppInstallerComponent(intent.getComponent())) { // intercept intents targeted directly to the ephemeral installer the diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 0173533d9594a..6d13c85f41ff0 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -4218,7 +4218,6 @@ public class PackageManagerService extends IPackageManager.Stub final boolean allowMatchInstant = (includeInstantApps && Intent.ACTION_VIEW.equals(intent.getAction()) - && intent.hasCategory(Intent.CATEGORY_BROWSABLE) && hasWebURI(intent)) || isSpecialProcess || mContext.checkCallingOrSelfPermission(