| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.content.pm; |
| 18 |
|
| 19 |
import android.annotation.NonNull; |
| 20 |
import android.annotation.Nullable; |
| 21 |
import android.content.ComponentName; |
| 22 |
import android.content.Intent; |
| 23 |
import android.content.IntentFilter; |
| 24 |
import android.os.Bundle; |
| 25 |
|
| 26 |
import java.util.Collections; |
| 27 |
import java.util.List; |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
public final class AuxiliaryResolveInfo { |
| 39 |
|
| 40 |
public final ComponentName installFailureActivity; |
| 41 |
|
| 42 |
public final boolean needsPhaseTwo; |
| 43 |
|
| 44 |
public final String token; |
| 45 |
|
| 46 |
public final Intent failureIntent; |
| 47 |
|
| 48 |
public final List<AuxiliaryFilter> filters; |
| 49 |
|
| 50 |
public final int[] hostDigestPrefixSecure; |
| 51 |
|
| 52 |
|
| 53 |
public AuxiliaryResolveInfo(@NonNull String token, |
| 54 |
boolean needsPhase2, |
| 55 |
@Nullable Intent failureIntent, |
| 56 |
@Nullable List<AuxiliaryFilter> filters, |
| 57 |
@Nullable int[] hostDigestPrefix) { |
| 58 |
this.token = token; |
| 59 |
this.needsPhaseTwo = needsPhase2; |
| 60 |
this.failureIntent = failureIntent; |
| 61 |
this.filters = filters; |
| 62 |
this.installFailureActivity = null; |
| 63 |
this.hostDigestPrefixSecure = hostDigestPrefix; |
| 64 |
} |
| 65 |
|
| 66 |
|
| 67 |
public AuxiliaryResolveInfo(@Nullable ComponentName failureActivity, |
| 68 |
@Nullable Intent failureIntent, |
| 69 |
@Nullable List<AuxiliaryFilter> filters) { |
| 70 |
super(); |
| 71 |
this.installFailureActivity = failureActivity; |
| 72 |
this.filters = filters; |
| 73 |
this.token = null; |
| 74 |
this.needsPhaseTwo = false; |
| 75 |
this.failureIntent = failureIntent; |
| 76 |
this.hostDigestPrefixSecure = null; |
| 77 |
} |
| 78 |
|
| 79 |
|
| 80 |
public AuxiliaryResolveInfo(@Nullable ComponentName failureActivity, |
| 81 |
String packageName, long versionCode, String splitName) { |
| 82 |
this(failureActivity, null, Collections.singletonList( |
| 83 |
new AuxiliaryResolveInfo.AuxiliaryFilter(packageName, versionCode, splitName))); |
| 84 |
} |
| 85 |
|
| 86 |
|
| 87 |
public static final class AuxiliaryFilter extends IntentFilter { |
| 88 |
|
| 89 |
public final InstantAppResolveInfo resolveInfo; |
| 90 |
|
| 91 |
public final String packageName; |
| 92 |
|
| 93 |
public final long versionCode; |
| 94 |
|
| 95 |
public final String splitName; |
| 96 |
|
| 97 |
public final Bundle extras; |
| 98 |
|
| 99 |
public AuxiliaryFilter(IntentFilter orig, InstantAppResolveInfo resolveInfo, |
| 100 |
String splitName, Bundle extras) { |
| 101 |
super(orig); |
| 102 |
this.resolveInfo = resolveInfo; |
| 103 |
this.packageName = resolveInfo.getPackageName(); |
| 104 |
this.versionCode = resolveInfo.getLongVersionCode(); |
| 105 |
this.splitName = splitName; |
| 106 |
this.extras = extras; |
| 107 |
} |
| 108 |
|
| 109 |
public AuxiliaryFilter(InstantAppResolveInfo resolveInfo, |
| 110 |
String splitName, Bundle extras) { |
| 111 |
this.resolveInfo = resolveInfo; |
| 112 |
this.packageName = resolveInfo.getPackageName(); |
| 113 |
this.versionCode = resolveInfo.getLongVersionCode(); |
| 114 |
this.splitName = splitName; |
| 115 |
this.extras = extras; |
| 116 |
} |
| 117 |
|
| 118 |
public AuxiliaryFilter(String packageName, long versionCode, String splitName) { |
| 119 |
this.resolveInfo = null; |
| 120 |
this.packageName = packageName; |
| 121 |
this.versionCode = versionCode; |
| 122 |
this.splitName = splitName; |
| 123 |
this.extras = null; |
| 124 |
} |
| 125 |
|
| 126 |
@Override |
| 127 |
public String toString() { |
| 128 |
return "AuxiliaryFilter{" |
| 129 |
+ "packageName='" + packageName + '\'' |
| 130 |
+ ", versionCode=" + versionCode |
| 131 |
+ ", splitName='" + splitName + '\'' + '}'; |
| 132 |
} |
| 133 |
} |
| 134 |
} |