blob: 361d4e4acb3bc5e5297fd38220b5199b8ffdfcd9 [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
19import android.content.Intent;
Chad Brubaker06068612017-04-06 09:43:47 -070020import android.os.Bundle;
Patrick Baumann4db6bc12018-02-06 09:55:36 -080021import android.text.TextUtils;
Todd Kennedy01ad0c72016-11-11 15:33:12 -080022
23/**
Todd Kennedy1fb34042017-03-01 13:56:58 -080024 * Information needed to make an instant application resolution request.
Todd Kennedy01ad0c72016-11-11 15:33:12 -080025 * @hide
26 */
Todd Kennedy1fb34042017-03-01 13:56:58 -080027public final class InstantAppRequest {
Patrick Baumann4db6bc12018-02-06 09:55:36 -080028
Todd Kennedy1fb34042017-03-01 13:56:58 -080029 /** Response from the first phase of instant application resolution */
Todd Kennedye9910222017-02-21 16:00:11 -080030 public final AuxiliaryResolveInfo responseObj;
Todd Kennedy1fb34042017-03-01 13:56:58 -080031 /** The original intent that triggered instant application resolution */
Todd Kennedy01ad0c72016-11-11 15:33:12 -080032 public final Intent origIntent;
33 /** Resolved type of the intent */
34 public final String resolvedType;
Todd Kennedy1fb34042017-03-01 13:56:58 -080035 /** The name of the package requesting the instant application */
Todd Kennedy01ad0c72016-11-11 15:33:12 -080036 public final String callingPackage;
Todd Kennedy1fb34042017-03-01 13:56:58 -080037 /** ID of the user requesting the instant application */
Todd Kennedy01ad0c72016-11-11 15:33:12 -080038 public final int userId;
Chad Brubaker06068612017-04-06 09:43:47 -070039 /**
40 * Optional extra bundle provided by the source application to the installer for additional
41 * verification. */
42 public final Bundle verificationBundle;
Todd Kennedy6ebabca2017-08-22 10:02:12 -070043 /** Whether resolution occurs because an application is starting */
44 public final boolean resolveForStart;
Patrick Baumann4db6bc12018-02-06 09:55:36 -080045 /** The instant app digest for this request */
46 public final InstantAppResolveInfo.InstantAppDigest digest;
Todd Kennedy01ad0c72016-11-11 15:33:12 -080047
Todd Kennedy1fb34042017-03-01 13:56:58 -080048 public InstantAppRequest(AuxiliaryResolveInfo responseObj, Intent origIntent,
Todd Kennedy6ebabca2017-08-22 10:02:12 -070049 String resolvedType, String callingPackage, int userId, Bundle verificationBundle,
50 boolean resolveForStart) {
Todd Kennedy01ad0c72016-11-11 15:33:12 -080051 this.responseObj = responseObj;
52 this.origIntent = origIntent;
53 this.resolvedType = resolvedType;
Todd Kennedy01ad0c72016-11-11 15:33:12 -080054 this.callingPackage = callingPackage;
55 this.userId = userId;
Chad Brubaker06068612017-04-06 09:43:47 -070056 this.verificationBundle = verificationBundle;
Todd Kennedy6ebabca2017-08-22 10:02:12 -070057 this.resolveForStart = resolveForStart;
Patrick Baumann4db6bc12018-02-06 09:55:36 -080058 if (origIntent.getData() != null && !TextUtils.isEmpty(origIntent.getData().getHost())) {
59 digest = new InstantAppResolveInfo.InstantAppDigest(
60 origIntent.getData().getHost(), 5 /*maxDigests*/);
61 } else {
62 digest = InstantAppResolveInfo.InstantAppDigest.UNDEFINED;
63 }
Todd Kennedy01ad0c72016-11-11 15:33:12 -080064 }
Chad Brubaker06068612017-04-06 09:43:47 -070065}