Merge "Fixes non-matching instant app behavior" into pi-dev

This commit is contained in:
android-build-team Robot
2018-05-03 09:36:52 +00:00
committed by Android (Google) Code Review

View File

@@ -16,6 +16,8 @@
package com.android.server.pm; package com.android.server.pm;
import static android.content.Intent.FLAG_ACTIVITY_MATCH_EXTERNAL;
import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.ACTION_INSTANT_APP_RESOLUTION_PHASE_ONE; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.ACTION_INSTANT_APP_RESOLUTION_PHASE_ONE;
import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.ACTION_INSTANT_APP_RESOLUTION_PHASE_TWO; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.ACTION_INSTANT_APP_RESOLUTION_PHASE_TWO;
import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.FIELD_INSTANT_APP_LAUNCH_TOKEN; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.FIELD_INSTANT_APP_LAUNCH_TOKEN;
@@ -366,6 +368,7 @@ public abstract class InstantAppResolver {
final Intent failureIntent = new Intent(origIntent); final Intent failureIntent = new Intent(origIntent);
boolean requiresSecondPhase = false; boolean requiresSecondPhase = false;
failureIntent.setFlags(failureIntent.getFlags() | Intent.FLAG_IGNORE_EPHEMERAL); failureIntent.setFlags(failureIntent.getFlags() | Intent.FLAG_IGNORE_EPHEMERAL);
failureIntent.setFlags(failureIntent.getFlags() & ~Intent.FLAG_ACTIVITY_MATCH_EXTERNAL);
failureIntent.setLaunchToken(token); failureIntent.setLaunchToken(token);
ArrayList<AuxiliaryResolveInfo.AuxiliaryFilter> filters = null; ArrayList<AuxiliaryResolveInfo.AuxiliaryFilter> filters = null;
boolean isWebIntent = origIntent.isWebIntent(); boolean isWebIntent = origIntent.isWebIntent();
@@ -408,6 +411,10 @@ public abstract class InstantAppResolver {
if (filters != null && !filters.isEmpty()) { if (filters != null && !filters.isEmpty()) {
return new AuxiliaryResolveInfo(token, requiresSecondPhase, failureIntent, filters); return new AuxiliaryResolveInfo(token, requiresSecondPhase, failureIntent, filters);
} }
// if the match external flag is set, return an empty resolve info
if ((origIntent.getFlags() & FLAG_ACTIVITY_MATCH_EXTERNAL) != 0) {
return new AuxiliaryResolveInfo(token, false, failureIntent, null /* filters */);
}
// Hash or filter mis-match; no instant apps for this domain. // Hash or filter mis-match; no instant apps for this domain.
return null; return null;
} }