blob: f692db1f0443f36954a3b047b854410203d7e324 [file] [log] [blame]
Todd Kennedy01ad0c72016-11-11 15:33:12 -08001/*
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
17package android.content.pm;
18
Winson81fef842019-08-28 12:19:08 -070019import android.annotation.NonNull;
20import android.annotation.Nullable;
Todd Kennedy01ad0c72016-11-11 15:33:12 -080021import android.content.Intent;
Chad Brubaker06068612017-04-06 09:43:47 -070022import android.os.Bundle;
Todd Kennedy01ad0c72016-11-11 15:33:12 -080023
24/**
Todd Kennedy1fb34042017-03-01 13:56:58 -080025 * Information needed to make an instant application resolution request.
Todd Kennedy01ad0c72016-11-11 15:33:12 -080026 * @hide
27 */
Todd Kennedy1fb34042017-03-01 13:56:58 -080028public final class InstantAppRequest {
Patrick Baumann4db6bc12018-02-06 09:55:36 -080029
Todd Kennedy1fb34042017-03-01 13:56:58 -080030 /** Response from the first phase of instant application resolution */
Todd Kennedye9910222017-02-21 16:00:11 -080031 public final AuxiliaryResolveInfo responseObj;
Todd Kennedy1fb34042017-03-01 13:56:58 -080032 /** The original intent that triggered instant application resolution */
Todd Kennedy01ad0c72016-11-11 15:33:12 -080033 public final Intent origIntent;
34 /** Resolved type of the intent */
35 public final String resolvedType;
Todd Kennedy1fb34042017-03-01 13:56:58 -080036 /** The name of the package requesting the instant application */
Todd Kennedy01ad0c72016-11-11 15:33:12 -080037 public final String callingPackage;
Winson81fef842019-08-28 12:19:08 -070038 /** Whether or not the requesting package was an instant app */
39 public final boolean isRequesterInstantApp;
Todd Kennedy1fb34042017-03-01 13:56:58 -080040 /** ID of the user requesting the instant application */
Todd Kennedy01ad0c72016-11-11 15:33:12 -080041 public final int userId;
Chad Brubaker06068612017-04-06 09:43:47 -070042 /**
43 * Optional extra bundle provided by the source application to the installer for additional
Winson81fef842019-08-28 12:19:08 -070044 * verification.
45 */
Chad Brubaker06068612017-04-06 09:43:47 -070046 public final Bundle verificationBundle;
Todd Kennedy6ebabca2017-08-22 10:02:12 -070047 /** Whether resolution occurs because an application is starting */
48 public final boolean resolveForStart;
Winson81fef842019-08-28 12:19:08 -070049 /**
50 * The hash prefix of an instant app's domain or null if no host is defined.
51 * Secure version that should be carried through for external use.
52 */
53 @Nullable
54 public final int[] hostDigestPrefixSecure;
55 /** A unique identifier */
56 @NonNull
57 public final String token;
Todd Kennedy01ad0c72016-11-11 15:33:12 -080058
Todd Kennedy1fb34042017-03-01 13:56:58 -080059 public InstantAppRequest(AuxiliaryResolveInfo responseObj, Intent origIntent,
Philip P. Moltmanne7421e92020-02-10 16:14:12 +000060 String resolvedType, String callingPackage, boolean isRequesterInstantApp,
61 int userId, Bundle verificationBundle, boolean resolveForStart,
62 @Nullable int[] hostDigestPrefixSecure, @NonNull String token) {
Todd Kennedy01ad0c72016-11-11 15:33:12 -080063 this.responseObj = responseObj;
64 this.origIntent = origIntent;
65 this.resolvedType = resolvedType;
Todd Kennedy01ad0c72016-11-11 15:33:12 -080066 this.callingPackage = callingPackage;
Winson81fef842019-08-28 12:19:08 -070067 this.isRequesterInstantApp = isRequesterInstantApp;
Todd Kennedy01ad0c72016-11-11 15:33:12 -080068 this.userId = userId;
Chad Brubaker06068612017-04-06 09:43:47 -070069 this.verificationBundle = verificationBundle;
Todd Kennedy6ebabca2017-08-22 10:02:12 -070070 this.resolveForStart = resolveForStart;
Winson81fef842019-08-28 12:19:08 -070071 this.hostDigestPrefixSecure = hostDigestPrefixSecure;
72 this.token = token;
Todd Kennedy01ad0c72016-11-11 15:33:12 -080073 }
Chad Brubaker06068612017-04-06 09:43:47 -070074}