Loading api/system-current.txt +16 −2 Original line number Diff line number Diff line Loading @@ -546,10 +546,12 @@ package android.app { method public final android.os.IBinder onBind(android.content.Intent); method @Deprecated public void onGetInstantAppIntentFilter(@Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method @Deprecated public void onGetInstantAppIntentFilter(@NonNull android.content.Intent, @Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method public void onGetInstantAppIntentFilter(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method @Deprecated public void onGetInstantAppIntentFilter(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method public void onGetInstantAppIntentFilter(@NonNull android.content.pm.InstantAppRequestInfo, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method @Deprecated public void onGetInstantAppResolveInfo(@Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method @Deprecated public void onGetInstantAppResolveInfo(@NonNull android.content.Intent, @Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method public void onGetInstantAppResolveInfo(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method @Deprecated public void onGetInstantAppResolveInfo(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method public void onGetInstantAppResolveInfo(@NonNull android.content.pm.InstantAppRequestInfo, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); } public static final class InstantAppResolverService.InstantAppResolutionCallback { Loading Loading @@ -1928,6 +1930,18 @@ package android.content.pm { field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.InstantAppIntentFilter> CREATOR; } public final class InstantAppRequestInfo implements android.os.Parcelable { ctor public InstantAppRequestInfo(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, boolean, @NonNull String); method public int describeContents(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.InstantAppRequestInfo> CREATOR; field @Nullable public final int[] hostDigestPrefix; field @NonNull public final android.content.Intent intent; field public final boolean isRequesterInstantApp; field @NonNull public final String token; field @NonNull public final android.os.UserHandle userHandle; } public final class InstantAppResolveInfo implements android.os.Parcelable { ctor public InstantAppResolveInfo(@NonNull android.content.pm.InstantAppResolveInfo.InstantAppDigest, @Nullable String, @Nullable java.util.List<android.content.pm.InstantAppIntentFilter>, int); ctor public InstantAppResolveInfo(@NonNull android.content.pm.InstantAppResolveInfo.InstantAppDigest, @Nullable String, @Nullable java.util.List<android.content.pm.InstantAppIntentFilter>, long, @Nullable android.os.Bundle); Loading core/java/android/app/IInstantAppResolver.aidl +4 −6 Original line number Diff line number Diff line Loading @@ -16,15 +16,13 @@ package android.app; import android.content.Intent; import android.content.pm.InstantAppRequestInfo; import android.os.IRemoteCallback; /** @hide */ oneway interface IInstantAppResolver { void getInstantAppResolveInfoList(in Intent sanitizedIntent, in int[] hostDigestPrefix, int userId, String token, int sequence, IRemoteCallback callback); void getInstantAppIntentFilterList(in Intent sanitizedIntent, in int[] hostDigestPrefix, int userId, String token, IRemoteCallback callback); void getInstantAppResolveInfoList(in InstantAppRequestInfo request, int sequence, IRemoteCallback callback); void getInstantAppIntentFilterList(in InstantAppRequestInfo request, IRemoteCallback callback); } core/java/android/app/InstantAppResolverService.java +84 −47 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.annotation.Nullable; import android.annotation.SystemApi; import android.content.Context; import android.content.Intent; import android.content.pm.InstantAppRequestInfo; import android.content.pm.InstantAppResolveInfo; import android.os.Build; import android.os.Bundle; Loading Loading @@ -59,8 +60,9 @@ public abstract class InstantAppResolverService extends Service { * Called to retrieve resolve info for instant applications immediately. * * @param digestPrefix The hash prefix of the instant app's domain. * @deprecated Should implement {@link #onGetInstantAppResolveInfo(Intent, int[], UserHandle, * String, InstantAppResolutionCallback)}. * * @deprecated Should implement {@link #onGetInstantAppResolveInfo(InstantAppRequestInfo, * InstantAppResolutionCallback)} */ @Deprecated public void onGetInstantAppResolveInfo(@Nullable int[] digestPrefix, @NonNull String token, Loading @@ -73,8 +75,9 @@ public abstract class InstantAppResolverService extends Service { * sources. * * @param digestPrefix The hash prefix of the instant app's domain. * @deprecated Should implement {@link #onGetInstantAppIntentFilter(Intent, int[], UserHandle, * String, InstantAppResolutionCallback)}. * * @deprecated Should implement {@link #onGetInstantAppIntentFilter(InstantAppRequestInfo, * InstantAppResolutionCallback)} */ @Deprecated public void onGetInstantAppIntentFilter(@Nullable int[] digestPrefix, @NonNull String token, Loading Loading @@ -103,8 +106,8 @@ public abstract class InstantAppResolverService extends Service { * * @see InstantAppResolveInfo * * @deprecated Should implement {@link #onGetInstantAppResolveInfo(Intent, int[], UserHandle, * String, InstantAppResolutionCallback)}. * @deprecated Should implement {@link #onGetInstantAppResolveInfo(InstantAppRequestInfo, * InstantAppResolutionCallback)} */ @Deprecated public void onGetInstantAppResolveInfo(@NonNull Intent sanitizedIntent, Loading Loading @@ -134,8 +137,8 @@ public abstract class InstantAppResolverService extends Service { * {@link Intent#EXTRA_INSTANT_APP_TOKEN}. * @param callback The {@link InstantAppResolutionCallback} to provide results to. * * @deprecated Should implement {@link #onGetInstantAppIntentFilter(Intent, int[], UserHandle, * String, InstantAppResolutionCallback)}. * @deprecated Should implement {@link #onGetInstantAppIntentFilter(InstantAppRequestInfo, * InstantAppResolutionCallback)} */ @Deprecated public void onGetInstantAppIntentFilter(@NonNull Intent sanitizedIntent, Loading Loading @@ -170,7 +173,11 @@ public abstract class InstantAppResolverService extends Service { * @param callback The {@link InstantAppResolutionCallback} to provide results to. * * @see InstantAppResolveInfo * * @deprecated Should implement {@link #onGetInstantAppResolveInfo(InstantAppRequestInfo, * InstantAppResolutionCallback */ @Deprecated public void onGetInstantAppResolveInfo(@NonNull Intent sanitizedIntent, @Nullable int[] hostDigestPrefix, @NonNull UserHandle userHandle, @NonNull String token, @NonNull InstantAppResolutionCallback callback) { Loading @@ -193,7 +200,11 @@ public abstract class InstantAppResolverService extends Service { * Intent, int[], UserHandle, String, InstantAppResolutionCallback)} and provided * to the currently visible installer via {@link Intent#EXTRA_INSTANT_APP_TOKEN}. * @param callback The {@link InstantAppResolutionCallback} to provide results to. * * @deprecated Should implement {@link #onGetInstantAppIntentFilter(InstantAppRequestInfo, * InstantAppResolutionCallback)} */ @Deprecated public void onGetInstantAppIntentFilter(@NonNull Intent sanitizedIntent, @Nullable int[] hostDigestPrefix, @NonNull UserHandle userHandle, @NonNull String token, @NonNull InstantAppResolutionCallback callback) { Loading @@ -201,6 +212,41 @@ public abstract class InstantAppResolverService extends Service { onGetInstantAppIntentFilter(sanitizedIntent, hostDigestPrefix, token, callback); } /** * Called to retrieve resolve info for instant applications immediately. The response will be * ignored if not provided within a reasonable time. {@link InstantAppResolveInfo}s provided * in response to this method may be partial to request a second phase of resolution which will * result in a subsequent call to {@link #onGetInstantAppIntentFilter(InstantAppRequestInfo, * InstantAppResolutionCallback)} * * @param request The parameters for this resolution request * @param callback The {@link InstantAppResolutionCallback} to provide results to. * * @see InstantAppResolveInfo */ public void onGetInstantAppResolveInfo(@NonNull InstantAppRequestInfo request, @NonNull InstantAppResolutionCallback callback) { // If not overridden, forward to the old method. onGetInstantAppResolveInfo(request.intent, request.hostDigestPrefix, request.userHandle, request.token, callback); } /** * Called to retrieve intent filters for potentially matching instant applications. Unlike * {@link #onGetInstantAppResolveInfo(InstantAppRequestInfo, InstantAppResolutionCallback)}, * the response may take as long as necessary to respond. All {@link InstantAppResolveInfo}s * provided in response to this method must be completely populated. * * @param request The parameters for this resolution request * @param callback The {@link InstantAppResolutionCallback} to provide results to. */ public void onGetInstantAppIntentFilter(@NonNull InstantAppRequestInfo request, @NonNull InstantAppResolutionCallback callback) { // If not overridden, forward to the old method. onGetInstantAppIntentFilter(request.intent, request.hostDigestPrefix, request.userHandle, request.token, callback); } /** * Returns a {@link Looper} to perform service operations on. */ Loading @@ -218,35 +264,29 @@ public abstract class InstantAppResolverService extends Service { public final IBinder onBind(Intent intent) { return new IInstantAppResolver.Stub() { @Override public void getInstantAppResolveInfoList(Intent sanitizedIntent, int[] digestPrefix, int userId, String token, int sequence, IRemoteCallback callback) { public void getInstantAppResolveInfoList(InstantAppRequestInfo request, int sequence, IRemoteCallback callback) { if (DEBUG_INSTANT) { Slog.v(TAG, "[" + token + "] Phase1 called; posting"); Slog.v(TAG, "[" + request.token + "] Phase1 called; posting"); } final SomeArgs args = SomeArgs.obtain(); args.arg1 = callback; args.arg2 = digestPrefix; args.arg3 = userId; args.arg4 = token; args.arg5 = sanitizedIntent; mHandler.obtainMessage(ServiceHandler.MSG_GET_INSTANT_APP_RESOLVE_INFO, sequence, 0, args).sendToTarget(); args.arg1 = request; args.arg2 = callback; mHandler.obtainMessage(ServiceHandler.MSG_GET_INSTANT_APP_RESOLVE_INFO, sequence, 0, args).sendToTarget(); } @Override public void getInstantAppIntentFilterList(Intent sanitizedIntent, int[] digestPrefix, int userId, String token, IRemoteCallback callback) { public void getInstantAppIntentFilterList(InstantAppRequestInfo request, IRemoteCallback callback) { if (DEBUG_INSTANT) { Slog.v(TAG, "[" + token + "] Phase2 called; posting"); Slog.v(TAG, "[" + request.token + "] Phase2 called; posting"); } final SomeArgs args = SomeArgs.obtain(); args.arg1 = callback; args.arg2 = digestPrefix; args.arg3 = userId; args.arg4 = token; args.arg5 = sanitizedIntent; mHandler.obtainMessage(ServiceHandler.MSG_GET_INSTANT_APP_INTENT_FILTER, args).sendToTarget(); args.arg1 = request; args.arg2 = callback; mHandler.obtainMessage(ServiceHandler.MSG_GET_INSTANT_APP_INTENT_FILTER, args) .sendToTarget(); } }; } Loading Loading @@ -287,36 +327,33 @@ public abstract class InstantAppResolverService extends Service { switch (action) { case MSG_GET_INSTANT_APP_RESOLVE_INFO: { final SomeArgs args = (SomeArgs) message.obj; final IRemoteCallback callback = (IRemoteCallback) args.arg1; final int[] digestPrefix = (int[]) args.arg2; final int userId = (int) args.arg3; final String token = (String) args.arg4; final Intent intent = (Intent) args.arg5; final InstantAppRequestInfo request = (InstantAppRequestInfo) args.arg1; final IRemoteCallback callback = (IRemoteCallback) args.arg2; args.recycle(); final int sequence = message.arg1; if (DEBUG_INSTANT) { Slog.d(TAG, "[" + token + "] Phase1 request;" + " prefix: " + Arrays.toString(digestPrefix) + ", userId: " + userId); Slog.d(TAG, "[" + request.token + "] Phase1 request;" + " prefix: " + Arrays.toString(request.hostDigestPrefix) + ", userId: " + request.userHandle.getIdentifier()); } onGetInstantAppResolveInfo(intent, digestPrefix, UserHandle.of(userId), token, onGetInstantAppResolveInfo(request, new InstantAppResolutionCallback(sequence, callback)); } break; case MSG_GET_INSTANT_APP_INTENT_FILTER: { final SomeArgs args = (SomeArgs) message.obj; final IRemoteCallback callback = (IRemoteCallback) args.arg1; final int[] digestPrefix = (int[]) args.arg2; final int userId = (int) args.arg3; final String token = (String) args.arg4; final Intent intent = (Intent) args.arg5; final InstantAppRequestInfo request = (InstantAppRequestInfo) args.arg1; final IRemoteCallback callback = (IRemoteCallback) args.arg2; args.recycle(); if (DEBUG_INSTANT) { Slog.d(TAG, "[" + token + "] Phase2 request;" + " prefix: " + Arrays.toString(digestPrefix) + ", userId: " + userId); Slog.d(TAG, "[" + request.token + "] Phase2 request;" + " prefix: " + Arrays.toString(request.hostDigestPrefix) + ", userId: " + request.userHandle.getIdentifier()); } onGetInstantAppIntentFilter(intent, digestPrefix, UserHandle.of(userId), token, onGetInstantAppIntentFilter(request, new InstantAppResolutionCallback(-1 /*sequence*/, callback)); } break; } break; default: { throw new IllegalArgumentException("Unknown message: " + action); Loading core/java/android/content/pm/AuxiliaryResolveInfo.java +7 −2 Original line number Diff line number Diff line Loading @@ -46,17 +46,21 @@ public final class AuxiliaryResolveInfo { public final Intent failureIntent; /** The matching filters for this resolve info. */ public final List<AuxiliaryFilter> filters; /** Stored {@link InstantAppRequest#hostDigestPrefixSecure} to prevent re-generation */ public final int[] hostDigestPrefixSecure; /** Create a response for installing an instant application. */ public AuxiliaryResolveInfo(@NonNull String token, boolean needsPhase2, @Nullable Intent failureIntent, @Nullable List<AuxiliaryFilter> filters) { @Nullable List<AuxiliaryFilter> filters, @Nullable int[] hostDigestPrefix) { this.token = token; this.needsPhaseTwo = needsPhase2; this.failureIntent = failureIntent; this.filters = filters; this.installFailureActivity = null; this.hostDigestPrefixSecure = hostDigestPrefix; } /** Create a response for installing a split on demand. */ Loading @@ -69,6 +73,7 @@ public final class AuxiliaryResolveInfo { this.token = null; this.needsPhaseTwo = false; this.failureIntent = failureIntent; this.hostDigestPrefixSecure = null; } /** Create a response for installing a split on demand. */ Loading core/java/android/content/pm/InstantAppRequest.java +21 −12 Original line number Diff line number Diff line Loading @@ -16,9 +16,10 @@ package android.content.pm; import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; /** * Information needed to make an instant application resolution request. Loading @@ -34,32 +35,40 @@ public final class InstantAppRequest { public final String resolvedType; /** The name of the package requesting the instant application */ public final String callingPackage; /** Whether or not the requesting package was an instant app */ public final boolean isRequesterInstantApp; /** ID of the user requesting the instant application */ public final int userId; /** * Optional extra bundle provided by the source application to the installer for additional * verification. */ * verification. */ public final Bundle verificationBundle; /** Whether resolution occurs because an application is starting */ public final boolean resolveForStart; /** The instant app digest for this request */ public final InstantAppResolveInfo.InstantAppDigest digest; /** * The hash prefix of an instant app's domain or null if no host is defined. * Secure version that should be carried through for external use. */ @Nullable public final int[] hostDigestPrefixSecure; /** A unique identifier */ @NonNull public final String token; public InstantAppRequest(AuxiliaryResolveInfo responseObj, Intent origIntent, String resolvedType, String callingPackage, int userId, Bundle verificationBundle, boolean resolveForStart) { String resolvedType, String callingPackage, boolean isRequesterInstantApp, int userId, Bundle verificationBundle, boolean resolveForStart, @Nullable int[] hostDigestPrefixSecure, @NonNull String token) { this.responseObj = responseObj; this.origIntent = origIntent; this.resolvedType = resolvedType; this.callingPackage = callingPackage; this.isRequesterInstantApp = isRequesterInstantApp; this.userId = userId; this.verificationBundle = verificationBundle; this.resolveForStart = resolveForStart; if (origIntent.getData() != null && !TextUtils.isEmpty(origIntent.getData().getHost())) { digest = new InstantAppResolveInfo.InstantAppDigest( origIntent.getData().getHost(), 5 /*maxDigests*/); } else { digest = InstantAppResolveInfo.InstantAppDigest.UNDEFINED; } this.hostDigestPrefixSecure = hostDigestPrefixSecure; this.token = token; } } Loading
api/system-current.txt +16 −2 Original line number Diff line number Diff line Loading @@ -546,10 +546,12 @@ package android.app { method public final android.os.IBinder onBind(android.content.Intent); method @Deprecated public void onGetInstantAppIntentFilter(@Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method @Deprecated public void onGetInstantAppIntentFilter(@NonNull android.content.Intent, @Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method public void onGetInstantAppIntentFilter(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method @Deprecated public void onGetInstantAppIntentFilter(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method public void onGetInstantAppIntentFilter(@NonNull android.content.pm.InstantAppRequestInfo, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method @Deprecated public void onGetInstantAppResolveInfo(@Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method @Deprecated public void onGetInstantAppResolveInfo(@NonNull android.content.Intent, @Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method public void onGetInstantAppResolveInfo(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method @Deprecated public void onGetInstantAppResolveInfo(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); method public void onGetInstantAppResolveInfo(@NonNull android.content.pm.InstantAppRequestInfo, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback); } public static final class InstantAppResolverService.InstantAppResolutionCallback { Loading Loading @@ -1928,6 +1930,18 @@ package android.content.pm { field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.InstantAppIntentFilter> CREATOR; } public final class InstantAppRequestInfo implements android.os.Parcelable { ctor public InstantAppRequestInfo(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, boolean, @NonNull String); method public int describeContents(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.InstantAppRequestInfo> CREATOR; field @Nullable public final int[] hostDigestPrefix; field @NonNull public final android.content.Intent intent; field public final boolean isRequesterInstantApp; field @NonNull public final String token; field @NonNull public final android.os.UserHandle userHandle; } public final class InstantAppResolveInfo implements android.os.Parcelable { ctor public InstantAppResolveInfo(@NonNull android.content.pm.InstantAppResolveInfo.InstantAppDigest, @Nullable String, @Nullable java.util.List<android.content.pm.InstantAppIntentFilter>, int); ctor public InstantAppResolveInfo(@NonNull android.content.pm.InstantAppResolveInfo.InstantAppDigest, @Nullable String, @Nullable java.util.List<android.content.pm.InstantAppIntentFilter>, long, @Nullable android.os.Bundle); Loading
core/java/android/app/IInstantAppResolver.aidl +4 −6 Original line number Diff line number Diff line Loading @@ -16,15 +16,13 @@ package android.app; import android.content.Intent; import android.content.pm.InstantAppRequestInfo; import android.os.IRemoteCallback; /** @hide */ oneway interface IInstantAppResolver { void getInstantAppResolveInfoList(in Intent sanitizedIntent, in int[] hostDigestPrefix, int userId, String token, int sequence, IRemoteCallback callback); void getInstantAppIntentFilterList(in Intent sanitizedIntent, in int[] hostDigestPrefix, int userId, String token, IRemoteCallback callback); void getInstantAppResolveInfoList(in InstantAppRequestInfo request, int sequence, IRemoteCallback callback); void getInstantAppIntentFilterList(in InstantAppRequestInfo request, IRemoteCallback callback); }
core/java/android/app/InstantAppResolverService.java +84 −47 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.annotation.Nullable; import android.annotation.SystemApi; import android.content.Context; import android.content.Intent; import android.content.pm.InstantAppRequestInfo; import android.content.pm.InstantAppResolveInfo; import android.os.Build; import android.os.Bundle; Loading Loading @@ -59,8 +60,9 @@ public abstract class InstantAppResolverService extends Service { * Called to retrieve resolve info for instant applications immediately. * * @param digestPrefix The hash prefix of the instant app's domain. * @deprecated Should implement {@link #onGetInstantAppResolveInfo(Intent, int[], UserHandle, * String, InstantAppResolutionCallback)}. * * @deprecated Should implement {@link #onGetInstantAppResolveInfo(InstantAppRequestInfo, * InstantAppResolutionCallback)} */ @Deprecated public void onGetInstantAppResolveInfo(@Nullable int[] digestPrefix, @NonNull String token, Loading @@ -73,8 +75,9 @@ public abstract class InstantAppResolverService extends Service { * sources. * * @param digestPrefix The hash prefix of the instant app's domain. * @deprecated Should implement {@link #onGetInstantAppIntentFilter(Intent, int[], UserHandle, * String, InstantAppResolutionCallback)}. * * @deprecated Should implement {@link #onGetInstantAppIntentFilter(InstantAppRequestInfo, * InstantAppResolutionCallback)} */ @Deprecated public void onGetInstantAppIntentFilter(@Nullable int[] digestPrefix, @NonNull String token, Loading Loading @@ -103,8 +106,8 @@ public abstract class InstantAppResolverService extends Service { * * @see InstantAppResolveInfo * * @deprecated Should implement {@link #onGetInstantAppResolveInfo(Intent, int[], UserHandle, * String, InstantAppResolutionCallback)}. * @deprecated Should implement {@link #onGetInstantAppResolveInfo(InstantAppRequestInfo, * InstantAppResolutionCallback)} */ @Deprecated public void onGetInstantAppResolveInfo(@NonNull Intent sanitizedIntent, Loading Loading @@ -134,8 +137,8 @@ public abstract class InstantAppResolverService extends Service { * {@link Intent#EXTRA_INSTANT_APP_TOKEN}. * @param callback The {@link InstantAppResolutionCallback} to provide results to. * * @deprecated Should implement {@link #onGetInstantAppIntentFilter(Intent, int[], UserHandle, * String, InstantAppResolutionCallback)}. * @deprecated Should implement {@link #onGetInstantAppIntentFilter(InstantAppRequestInfo, * InstantAppResolutionCallback)} */ @Deprecated public void onGetInstantAppIntentFilter(@NonNull Intent sanitizedIntent, Loading Loading @@ -170,7 +173,11 @@ public abstract class InstantAppResolverService extends Service { * @param callback The {@link InstantAppResolutionCallback} to provide results to. * * @see InstantAppResolveInfo * * @deprecated Should implement {@link #onGetInstantAppResolveInfo(InstantAppRequestInfo, * InstantAppResolutionCallback */ @Deprecated public void onGetInstantAppResolveInfo(@NonNull Intent sanitizedIntent, @Nullable int[] hostDigestPrefix, @NonNull UserHandle userHandle, @NonNull String token, @NonNull InstantAppResolutionCallback callback) { Loading @@ -193,7 +200,11 @@ public abstract class InstantAppResolverService extends Service { * Intent, int[], UserHandle, String, InstantAppResolutionCallback)} and provided * to the currently visible installer via {@link Intent#EXTRA_INSTANT_APP_TOKEN}. * @param callback The {@link InstantAppResolutionCallback} to provide results to. * * @deprecated Should implement {@link #onGetInstantAppIntentFilter(InstantAppRequestInfo, * InstantAppResolutionCallback)} */ @Deprecated public void onGetInstantAppIntentFilter(@NonNull Intent sanitizedIntent, @Nullable int[] hostDigestPrefix, @NonNull UserHandle userHandle, @NonNull String token, @NonNull InstantAppResolutionCallback callback) { Loading @@ -201,6 +212,41 @@ public abstract class InstantAppResolverService extends Service { onGetInstantAppIntentFilter(sanitizedIntent, hostDigestPrefix, token, callback); } /** * Called to retrieve resolve info for instant applications immediately. The response will be * ignored if not provided within a reasonable time. {@link InstantAppResolveInfo}s provided * in response to this method may be partial to request a second phase of resolution which will * result in a subsequent call to {@link #onGetInstantAppIntentFilter(InstantAppRequestInfo, * InstantAppResolutionCallback)} * * @param request The parameters for this resolution request * @param callback The {@link InstantAppResolutionCallback} to provide results to. * * @see InstantAppResolveInfo */ public void onGetInstantAppResolveInfo(@NonNull InstantAppRequestInfo request, @NonNull InstantAppResolutionCallback callback) { // If not overridden, forward to the old method. onGetInstantAppResolveInfo(request.intent, request.hostDigestPrefix, request.userHandle, request.token, callback); } /** * Called to retrieve intent filters for potentially matching instant applications. Unlike * {@link #onGetInstantAppResolveInfo(InstantAppRequestInfo, InstantAppResolutionCallback)}, * the response may take as long as necessary to respond. All {@link InstantAppResolveInfo}s * provided in response to this method must be completely populated. * * @param request The parameters for this resolution request * @param callback The {@link InstantAppResolutionCallback} to provide results to. */ public void onGetInstantAppIntentFilter(@NonNull InstantAppRequestInfo request, @NonNull InstantAppResolutionCallback callback) { // If not overridden, forward to the old method. onGetInstantAppIntentFilter(request.intent, request.hostDigestPrefix, request.userHandle, request.token, callback); } /** * Returns a {@link Looper} to perform service operations on. */ Loading @@ -218,35 +264,29 @@ public abstract class InstantAppResolverService extends Service { public final IBinder onBind(Intent intent) { return new IInstantAppResolver.Stub() { @Override public void getInstantAppResolveInfoList(Intent sanitizedIntent, int[] digestPrefix, int userId, String token, int sequence, IRemoteCallback callback) { public void getInstantAppResolveInfoList(InstantAppRequestInfo request, int sequence, IRemoteCallback callback) { if (DEBUG_INSTANT) { Slog.v(TAG, "[" + token + "] Phase1 called; posting"); Slog.v(TAG, "[" + request.token + "] Phase1 called; posting"); } final SomeArgs args = SomeArgs.obtain(); args.arg1 = callback; args.arg2 = digestPrefix; args.arg3 = userId; args.arg4 = token; args.arg5 = sanitizedIntent; mHandler.obtainMessage(ServiceHandler.MSG_GET_INSTANT_APP_RESOLVE_INFO, sequence, 0, args).sendToTarget(); args.arg1 = request; args.arg2 = callback; mHandler.obtainMessage(ServiceHandler.MSG_GET_INSTANT_APP_RESOLVE_INFO, sequence, 0, args).sendToTarget(); } @Override public void getInstantAppIntentFilterList(Intent sanitizedIntent, int[] digestPrefix, int userId, String token, IRemoteCallback callback) { public void getInstantAppIntentFilterList(InstantAppRequestInfo request, IRemoteCallback callback) { if (DEBUG_INSTANT) { Slog.v(TAG, "[" + token + "] Phase2 called; posting"); Slog.v(TAG, "[" + request.token + "] Phase2 called; posting"); } final SomeArgs args = SomeArgs.obtain(); args.arg1 = callback; args.arg2 = digestPrefix; args.arg3 = userId; args.arg4 = token; args.arg5 = sanitizedIntent; mHandler.obtainMessage(ServiceHandler.MSG_GET_INSTANT_APP_INTENT_FILTER, args).sendToTarget(); args.arg1 = request; args.arg2 = callback; mHandler.obtainMessage(ServiceHandler.MSG_GET_INSTANT_APP_INTENT_FILTER, args) .sendToTarget(); } }; } Loading Loading @@ -287,36 +327,33 @@ public abstract class InstantAppResolverService extends Service { switch (action) { case MSG_GET_INSTANT_APP_RESOLVE_INFO: { final SomeArgs args = (SomeArgs) message.obj; final IRemoteCallback callback = (IRemoteCallback) args.arg1; final int[] digestPrefix = (int[]) args.arg2; final int userId = (int) args.arg3; final String token = (String) args.arg4; final Intent intent = (Intent) args.arg5; final InstantAppRequestInfo request = (InstantAppRequestInfo) args.arg1; final IRemoteCallback callback = (IRemoteCallback) args.arg2; args.recycle(); final int sequence = message.arg1; if (DEBUG_INSTANT) { Slog.d(TAG, "[" + token + "] Phase1 request;" + " prefix: " + Arrays.toString(digestPrefix) + ", userId: " + userId); Slog.d(TAG, "[" + request.token + "] Phase1 request;" + " prefix: " + Arrays.toString(request.hostDigestPrefix) + ", userId: " + request.userHandle.getIdentifier()); } onGetInstantAppResolveInfo(intent, digestPrefix, UserHandle.of(userId), token, onGetInstantAppResolveInfo(request, new InstantAppResolutionCallback(sequence, callback)); } break; case MSG_GET_INSTANT_APP_INTENT_FILTER: { final SomeArgs args = (SomeArgs) message.obj; final IRemoteCallback callback = (IRemoteCallback) args.arg1; final int[] digestPrefix = (int[]) args.arg2; final int userId = (int) args.arg3; final String token = (String) args.arg4; final Intent intent = (Intent) args.arg5; final InstantAppRequestInfo request = (InstantAppRequestInfo) args.arg1; final IRemoteCallback callback = (IRemoteCallback) args.arg2; args.recycle(); if (DEBUG_INSTANT) { Slog.d(TAG, "[" + token + "] Phase2 request;" + " prefix: " + Arrays.toString(digestPrefix) + ", userId: " + userId); Slog.d(TAG, "[" + request.token + "] Phase2 request;" + " prefix: " + Arrays.toString(request.hostDigestPrefix) + ", userId: " + request.userHandle.getIdentifier()); } onGetInstantAppIntentFilter(intent, digestPrefix, UserHandle.of(userId), token, onGetInstantAppIntentFilter(request, new InstantAppResolutionCallback(-1 /*sequence*/, callback)); } break; } break; default: { throw new IllegalArgumentException("Unknown message: " + action); Loading
core/java/android/content/pm/AuxiliaryResolveInfo.java +7 −2 Original line number Diff line number Diff line Loading @@ -46,17 +46,21 @@ public final class AuxiliaryResolveInfo { public final Intent failureIntent; /** The matching filters for this resolve info. */ public final List<AuxiliaryFilter> filters; /** Stored {@link InstantAppRequest#hostDigestPrefixSecure} to prevent re-generation */ public final int[] hostDigestPrefixSecure; /** Create a response for installing an instant application. */ public AuxiliaryResolveInfo(@NonNull String token, boolean needsPhase2, @Nullable Intent failureIntent, @Nullable List<AuxiliaryFilter> filters) { @Nullable List<AuxiliaryFilter> filters, @Nullable int[] hostDigestPrefix) { this.token = token; this.needsPhaseTwo = needsPhase2; this.failureIntent = failureIntent; this.filters = filters; this.installFailureActivity = null; this.hostDigestPrefixSecure = hostDigestPrefix; } /** Create a response for installing a split on demand. */ Loading @@ -69,6 +73,7 @@ public final class AuxiliaryResolveInfo { this.token = null; this.needsPhaseTwo = false; this.failureIntent = failureIntent; this.hostDigestPrefixSecure = null; } /** Create a response for installing a split on demand. */ Loading
core/java/android/content/pm/InstantAppRequest.java +21 −12 Original line number Diff line number Diff line Loading @@ -16,9 +16,10 @@ package android.content.pm; import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; /** * Information needed to make an instant application resolution request. Loading @@ -34,32 +35,40 @@ public final class InstantAppRequest { public final String resolvedType; /** The name of the package requesting the instant application */ public final String callingPackage; /** Whether or not the requesting package was an instant app */ public final boolean isRequesterInstantApp; /** ID of the user requesting the instant application */ public final int userId; /** * Optional extra bundle provided by the source application to the installer for additional * verification. */ * verification. */ public final Bundle verificationBundle; /** Whether resolution occurs because an application is starting */ public final boolean resolveForStart; /** The instant app digest for this request */ public final InstantAppResolveInfo.InstantAppDigest digest; /** * The hash prefix of an instant app's domain or null if no host is defined. * Secure version that should be carried through for external use. */ @Nullable public final int[] hostDigestPrefixSecure; /** A unique identifier */ @NonNull public final String token; public InstantAppRequest(AuxiliaryResolveInfo responseObj, Intent origIntent, String resolvedType, String callingPackage, int userId, Bundle verificationBundle, boolean resolveForStart) { String resolvedType, String callingPackage, boolean isRequesterInstantApp, int userId, Bundle verificationBundle, boolean resolveForStart, @Nullable int[] hostDigestPrefixSecure, @NonNull String token) { this.responseObj = responseObj; this.origIntent = origIntent; this.resolvedType = resolvedType; this.callingPackage = callingPackage; this.isRequesterInstantApp = isRequesterInstantApp; this.userId = userId; this.verificationBundle = verificationBundle; this.resolveForStart = resolveForStart; if (origIntent.getData() != null && !TextUtils.isEmpty(origIntent.getData().getHost())) { digest = new InstantAppResolveInfo.InstantAppDigest( origIntent.getData().getHost(), 5 /*maxDigests*/); } else { digest = InstantAppResolveInfo.InstantAppDigest.UNDEFINED; } this.hostDigestPrefixSecure = hostDigestPrefixSecure; this.token = token; } }