1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.content.pm; 18 19 import android.annotation.NonNull; 20 import android.annotation.Nullable; 21 import android.annotation.UserIdInt; 22 import android.content.Intent; 23 import android.os.Bundle; 24 25 /** 26 * Information needed to make an instant application resolution request. 27 * @hide 28 */ 29 public final class InstantAppRequest { 30 31 /** Response from the first phase of instant application resolution */ 32 public final AuxiliaryResolveInfo responseObj; 33 /** The original intent that triggered instant application resolution */ 34 public final Intent origIntent; 35 /** Resolved type of the intent */ 36 public final String resolvedType; 37 /** The name of the package requesting the instant application */ 38 public final String callingPackage; 39 /** The feature in the package requesting the instant application */ 40 public final String callingFeatureId; 41 /** Whether or not the requesting package was an instant app */ 42 public final boolean isRequesterInstantApp; 43 /** ID of the user requesting the instant application */ 44 public final @UserIdInt int userId; 45 /** 46 * Optional extra bundle provided by the source application to the installer for additional 47 * verification. 48 */ 49 public final Bundle verificationBundle; 50 /** Whether resolution occurs because an application is starting */ 51 public final boolean resolveForStart; 52 /** 53 * The hash prefix of an instant app's domain or null if no host is defined. 54 * Secure version that should be carried through for external use. 55 */ 56 @Nullable 57 public final int[] hostDigestPrefixSecure; 58 /** A unique identifier */ 59 @NonNull 60 public final String token; 61 InstantAppRequest(AuxiliaryResolveInfo responseObj, Intent origIntent, String resolvedType, String callingPackage, @Nullable String callingFeatureId, boolean isRequesterInstantApp, @UserIdInt int userId, Bundle verificationBundle, boolean resolveForStart, @Nullable int[] hostDigestPrefixSecure, @NonNull String token)62 public InstantAppRequest(AuxiliaryResolveInfo responseObj, Intent origIntent, 63 String resolvedType, String callingPackage, @Nullable String callingFeatureId, 64 boolean isRequesterInstantApp, @UserIdInt int userId, Bundle verificationBundle, 65 boolean resolveForStart, @Nullable int[] hostDigestPrefixSecure, 66 @NonNull String token) { 67 this.responseObj = responseObj; 68 this.origIntent = origIntent; 69 this.resolvedType = resolvedType; 70 this.callingPackage = callingPackage; 71 this.callingFeatureId = callingFeatureId; 72 this.isRequesterInstantApp = isRequesterInstantApp; 73 this.userId = userId; 74 this.verificationBundle = verificationBundle; 75 this.resolveForStart = resolveForStart; 76 this.hostDigestPrefixSecure = hostDigestPrefixSecure; 77 this.token = token; 78 } 79 } 80