Merge "Require only ACTION_VIEW for web instant apps"
This commit is contained in:
committed by
Android (Google) Code Review
commit
4b1f8e2f2d
@@ -88,7 +88,7 @@ public abstract class InstantAppResolverService extends Service {
|
||||
public void onGetInstantAppResolveInfo(Intent sanitizedIntent, int[] hostDigestPrefix,
|
||||
String token, InstantAppResolutionCallback callback) {
|
||||
// if not overridden, forward to old methods and filter out non-web intents
|
||||
if (sanitizedIntent.isBrowsableWebIntent()) {
|
||||
if (sanitizedIntent.isWebIntent()) {
|
||||
onGetInstantAppResolveInfo(hostDigestPrefix, token, callback);
|
||||
} else {
|
||||
callback.onInstantAppResolveInfo(Collections.emptyList());
|
||||
@@ -107,7 +107,7 @@ public abstract class InstantAppResolverService extends Service {
|
||||
String token, InstantAppResolutionCallback callback) {
|
||||
Log.e(TAG, "New onGetInstantAppIntentFilter is not overridden");
|
||||
// if not overridden, forward to old methods and filter out non-web intents
|
||||
if (sanitizedIntent.isBrowsableWebIntent()) {
|
||||
if (sanitizedIntent.isWebIntent()) {
|
||||
onGetInstantAppIntentFilter(hostDigestPrefix, token, callback);
|
||||
} else {
|
||||
callback.onInstantAppResolveInfo(Collections.emptyList());
|
||||
|
||||
@@ -10089,9 +10089,8 @@ public class Intent implements Parcelable, Cloneable {
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public boolean isBrowsableWebIntent() {
|
||||
public boolean isWebIntent() {
|
||||
return ACTION_VIEW.equals(mAction)
|
||||
&& hasCategory(CATEGORY_BROWSABLE)
|
||||
&& hasWebURI();
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ public class ResolverListController {
|
||||
int flags = PackageManager.MATCH_DEFAULT_ONLY
|
||||
| (shouldGetResolvedFilter ? PackageManager.GET_RESOLVED_FILTER : 0)
|
||||
| (shouldGetActivityMetadata ? PackageManager.GET_META_DATA : 0);
|
||||
if (intent.isBrowsableWebIntent()
|
||||
if (intent.isWebIntent()
|
||||
|| (intent.getFlags() & Intent.FLAG_ACTIVITY_MATCH_EXTERNAL) != 0) {
|
||||
flags |= PackageManager.MATCH_INSTANT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user