Todd Kennedy | 01ad0c7 | 2016-11-11 15:33:12 -0800 | [diff] [blame] | 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 | |
Winson | 81fef84 | 2019-08-28 12:19:08 -0700 | [diff] [blame] | 19 | import android.annotation.NonNull; |
| 20 | import android.annotation.Nullable; |
Todd Kennedy | 01ad0c7 | 2016-11-11 15:33:12 -0800 | [diff] [blame] | 21 | import android.content.Intent; |
Chad Brubaker | 0606861 | 2017-04-06 09:43:47 -0700 | [diff] [blame] | 22 | import android.os.Bundle; |
Todd Kennedy | 01ad0c7 | 2016-11-11 15:33:12 -0800 | [diff] [blame] | 23 | |
| 24 | /** |
Todd Kennedy | 1fb3404 | 2017-03-01 13:56:58 -0800 | [diff] [blame] | 25 | * Information needed to make an instant application resolution request. |
Todd Kennedy | 01ad0c7 | 2016-11-11 15:33:12 -0800 | [diff] [blame] | 26 | * @hide |
| 27 | */ |
Todd Kennedy | 1fb3404 | 2017-03-01 13:56:58 -0800 | [diff] [blame] | 28 | public final class InstantAppRequest { |
Patrick Baumann | 4db6bc1 | 2018-02-06 09:55:36 -0800 | [diff] [blame] | 29 | |
Todd Kennedy | 1fb3404 | 2017-03-01 13:56:58 -0800 | [diff] [blame] | 30 | /** Response from the first phase of instant application resolution */ |
Todd Kennedy | e991022 | 2017-02-21 16:00:11 -0800 | [diff] [blame] | 31 | public final AuxiliaryResolveInfo responseObj; |
Todd Kennedy | 1fb3404 | 2017-03-01 13:56:58 -0800 | [diff] [blame] | 32 | /** The original intent that triggered instant application resolution */ |
Todd Kennedy | 01ad0c7 | 2016-11-11 15:33:12 -0800 | [diff] [blame] | 33 | public final Intent origIntent; |
| 34 | /** Resolved type of the intent */ |
| 35 | public final String resolvedType; |
Todd Kennedy | 1fb3404 | 2017-03-01 13:56:58 -0800 | [diff] [blame] | 36 | /** The name of the package requesting the instant application */ |
Todd Kennedy | 01ad0c7 | 2016-11-11 15:33:12 -0800 | [diff] [blame] | 37 | public final String callingPackage; |
Winson | 81fef84 | 2019-08-28 12:19:08 -0700 | [diff] [blame] | 38 | /** Whether or not the requesting package was an instant app */ |
| 39 | public final boolean isRequesterInstantApp; |
Todd Kennedy | 1fb3404 | 2017-03-01 13:56:58 -0800 | [diff] [blame] | 40 | /** ID of the user requesting the instant application */ |
Todd Kennedy | 01ad0c7 | 2016-11-11 15:33:12 -0800 | [diff] [blame] | 41 | public final int userId; |
Chad Brubaker | 0606861 | 2017-04-06 09:43:47 -0700 | [diff] [blame] | 42 | /** |
| 43 | * Optional extra bundle provided by the source application to the installer for additional |
Winson | 81fef84 | 2019-08-28 12:19:08 -0700 | [diff] [blame] | 44 | * verification. |
| 45 | */ |
Chad Brubaker | 0606861 | 2017-04-06 09:43:47 -0700 | [diff] [blame] | 46 | public final Bundle verificationBundle; |
Todd Kennedy | 6ebabca | 2017-08-22 10:02:12 -0700 | [diff] [blame] | 47 | /** Whether resolution occurs because an application is starting */ |
| 48 | public final boolean resolveForStart; |
Winson | 81fef84 | 2019-08-28 12:19:08 -0700 | [diff] [blame] | 49 | /** |
| 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 Kennedy | 01ad0c7 | 2016-11-11 15:33:12 -0800 | [diff] [blame] | 58 | |
Todd Kennedy | 1fb3404 | 2017-03-01 13:56:58 -0800 | [diff] [blame] | 59 | public InstantAppRequest(AuxiliaryResolveInfo responseObj, Intent origIntent, |
Philip P. Moltmann | e7421e9 | 2020-02-10 16:14:12 +0000 | [diff] [blame^] | 60 | String resolvedType, String callingPackage, boolean isRequesterInstantApp, |
| 61 | int userId, Bundle verificationBundle, boolean resolveForStart, |
| 62 | @Nullable int[] hostDigestPrefixSecure, @NonNull String token) { |
Todd Kennedy | 01ad0c7 | 2016-11-11 15:33:12 -0800 | [diff] [blame] | 63 | this.responseObj = responseObj; |
| 64 | this.origIntent = origIntent; |
| 65 | this.resolvedType = resolvedType; |
Todd Kennedy | 01ad0c7 | 2016-11-11 15:33:12 -0800 | [diff] [blame] | 66 | this.callingPackage = callingPackage; |
Winson | 81fef84 | 2019-08-28 12:19:08 -0700 | [diff] [blame] | 67 | this.isRequesterInstantApp = isRequesterInstantApp; |
Todd Kennedy | 01ad0c7 | 2016-11-11 15:33:12 -0800 | [diff] [blame] | 68 | this.userId = userId; |
Chad Brubaker | 0606861 | 2017-04-06 09:43:47 -0700 | [diff] [blame] | 69 | this.verificationBundle = verificationBundle; |
Todd Kennedy | 6ebabca | 2017-08-22 10:02:12 -0700 | [diff] [blame] | 70 | this.resolveForStart = resolveForStart; |
Winson | 81fef84 | 2019-08-28 12:19:08 -0700 | [diff] [blame] | 71 | this.hostDigestPrefixSecure = hostDigestPrefixSecure; |
| 72 | this.token = token; |
Todd Kennedy | 01ad0c7 | 2016-11-11 15:33:12 -0800 | [diff] [blame] | 73 | } |
Chad Brubaker | 0606861 | 2017-04-06 09:43:47 -0700 | [diff] [blame] | 74 | } |