Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2020 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.parsing; |
| 18 | |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 19 | import static java.util.Collections.emptyList; |
| 20 | import static java.util.Collections.emptyMap; |
| 21 | import static java.util.Collections.emptySet; |
| 22 | |
| 23 | import android.annotation.NonNull; |
| 24 | import android.annotation.Nullable; |
| 25 | import android.content.Intent; |
| 26 | import android.content.IntentFilter; |
| 27 | import android.content.pm.ApplicationInfo; |
| 28 | import android.content.pm.ConfigurationInfo; |
| 29 | import android.content.pm.FeatureGroupInfo; |
| 30 | import android.content.pm.FeatureInfo; |
| 31 | import android.content.pm.PackageInfo; |
| 32 | import android.content.pm.PackageParser; |
Winson | f00c755 | 2020-01-28 12:52:01 -0800 | [diff] [blame] | 33 | import android.content.pm.parsing.component.ParsedActivity; |
Philip P. Moltmann | 12ac3f4 | 2020-03-05 15:01:29 -0800 | [diff] [blame] | 34 | import android.content.pm.parsing.component.ParsedAttribution; |
Winson | f00c755 | 2020-01-28 12:52:01 -0800 | [diff] [blame] | 35 | import android.content.pm.parsing.component.ParsedComponent; |
Winson | f00c755 | 2020-01-28 12:52:01 -0800 | [diff] [blame] | 36 | import android.content.pm.parsing.component.ParsedInstrumentation; |
| 37 | import android.content.pm.parsing.component.ParsedIntentInfo; |
| 38 | import android.content.pm.parsing.component.ParsedMainComponent; |
| 39 | import android.content.pm.parsing.component.ParsedPermission; |
| 40 | import android.content.pm.parsing.component.ParsedPermissionGroup; |
| 41 | import android.content.pm.parsing.component.ParsedProcess; |
| 42 | import android.content.pm.parsing.component.ParsedProvider; |
| 43 | import android.content.pm.parsing.component.ParsedService; |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 44 | import android.content.res.TypedArray; |
| 45 | import android.os.Build; |
| 46 | import android.os.Bundle; |
| 47 | import android.os.Parcel; |
| 48 | import android.os.Parcelable; |
| 49 | import android.os.storage.StorageManager; |
| 50 | import android.text.TextUtils; |
| 51 | import android.util.ArraySet; |
Winson | f00c755 | 2020-01-28 12:52:01 -0800 | [diff] [blame] | 52 | import android.util.Pair; |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 53 | import android.util.SparseArray; |
Oli Lan | 72ae447 | 2020-04-14 16:50:41 +0100 | [diff] [blame] | 54 | import android.util.SparseIntArray; |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 55 | |
| 56 | import com.android.internal.R; |
| 57 | import com.android.internal.annotations.VisibleForTesting; |
| 58 | import com.android.internal.util.ArrayUtils; |
| 59 | import com.android.internal.util.CollectionUtils; |
| 60 | import com.android.internal.util.DataClass; |
| 61 | import com.android.internal.util.Parcelling; |
| 62 | import com.android.internal.util.Parcelling.BuiltIn.ForBoolean; |
| 63 | import com.android.internal.util.Parcelling.BuiltIn.ForInternedString; |
| 64 | import com.android.internal.util.Parcelling.BuiltIn.ForInternedStringArray; |
| 65 | import com.android.internal.util.Parcelling.BuiltIn.ForInternedStringList; |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 66 | import com.android.internal.util.Parcelling.BuiltIn.ForInternedStringSet; |
Winson | f00c755 | 2020-01-28 12:52:01 -0800 | [diff] [blame] | 67 | import com.android.internal.util.Parcelling.BuiltIn.ForInternedStringValueMap; |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 68 | import com.android.internal.util.Parcelling.BuiltIn.ForStringSet; |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 69 | |
| 70 | import java.security.PublicKey; |
| 71 | import java.util.Collections; |
Winson | f00c755 | 2020-01-28 12:52:01 -0800 | [diff] [blame] | 72 | import java.util.Comparator; |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 73 | import java.util.List; |
| 74 | import java.util.Map; |
| 75 | import java.util.Set; |
| 76 | |
| 77 | /** |
| 78 | * The backing data for a package that was parsed from disk. |
| 79 | * |
| 80 | * The field nullability annotations here are for internal reference. For effective nullability, |
| 81 | * see the parent interfaces. |
| 82 | * |
| 83 | * TODO(b/135203078): Convert Lists used as sets into Sets, to better express intended use case |
| 84 | * |
| 85 | * @hide |
| 86 | */ |
| 87 | public class ParsingPackageImpl implements ParsingPackage, Parcelable { |
| 88 | |
| 89 | private static final String TAG = "PackageImpl"; |
| 90 | |
Winson | 022e707 | 2020-01-28 10:52:58 -0800 | [diff] [blame] | 91 | public static ForBoolean sForBoolean = Parcelling.Cache.getOrCreate(ForBoolean.class); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 92 | public static ForInternedString sForInternedString = Parcelling.Cache.getOrCreate( |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 93 | ForInternedString.class); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 94 | public static ForInternedStringArray sForInternedStringArray = Parcelling.Cache.getOrCreate( |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 95 | ForInternedStringArray.class); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 96 | public static ForInternedStringList sForInternedStringList = Parcelling.Cache.getOrCreate( |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 97 | ForInternedStringList.class); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 98 | public static ForInternedStringValueMap sForInternedStringValueMap = |
| 99 | Parcelling.Cache.getOrCreate(ForInternedStringValueMap.class); |
| 100 | public static ForStringSet sForStringSet = Parcelling.Cache.getOrCreate(ForStringSet.class); |
Winson | f00c755 | 2020-01-28 12:52:01 -0800 | [diff] [blame] | 101 | protected static ParsedIntentInfo.StringPairListParceler sForIntentInfoPairs = |
| 102 | Parcelling.Cache.getOrCreate(ParsedIntentInfo.StringPairListParceler.class); |
| 103 | |
| 104 | private static final Comparator<ParsedMainComponent> ORDER_COMPARATOR = |
| 105 | (first, second) -> Integer.compare(second.getOrder(), first.getOrder()); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 106 | |
| 107 | // These are objects because null represents not explicitly set |
| 108 | @Nullable |
| 109 | @DataClass.ParcelWith(ForBoolean.class) |
| 110 | private Boolean supportsSmallScreens; |
| 111 | @Nullable |
| 112 | @DataClass.ParcelWith(ForBoolean.class) |
| 113 | private Boolean supportsNormalScreens; |
| 114 | @Nullable |
| 115 | @DataClass.ParcelWith(ForBoolean.class) |
| 116 | private Boolean supportsLargeScreens; |
| 117 | @Nullable |
| 118 | @DataClass.ParcelWith(ForBoolean.class) |
| 119 | private Boolean supportsExtraLargeScreens; |
| 120 | @Nullable |
| 121 | @DataClass.ParcelWith(ForBoolean.class) |
| 122 | private Boolean resizeable; |
| 123 | @Nullable |
| 124 | @DataClass.ParcelWith(ForBoolean.class) |
| 125 | private Boolean anyDensity; |
| 126 | |
| 127 | protected int versionCode; |
| 128 | protected int versionCodeMajor; |
| 129 | private int baseRevisionCode; |
| 130 | @Nullable |
| 131 | @DataClass.ParcelWith(ForInternedString.class) |
| 132 | private String versionName; |
| 133 | |
| 134 | private int compileSdkVersion; |
| 135 | @Nullable |
| 136 | @DataClass.ParcelWith(ForInternedString.class) |
| 137 | private String compileSdkVersionCodeName; |
| 138 | |
| 139 | @NonNull |
| 140 | @DataClass.ParcelWith(ForInternedString.class) |
| 141 | protected String packageName; |
| 142 | |
| 143 | @Nullable |
| 144 | @DataClass.ParcelWith(ForInternedString.class) |
| 145 | private String realPackage; |
| 146 | |
| 147 | @NonNull |
| 148 | protected String baseCodePath; |
| 149 | |
| 150 | private boolean requiredForAllUsers; |
| 151 | @Nullable |
| 152 | @DataClass.ParcelWith(ForInternedString.class) |
| 153 | private String restrictedAccountType; |
| 154 | @Nullable |
| 155 | @DataClass.ParcelWith(ForInternedString.class) |
| 156 | private String requiredAccountType; |
| 157 | |
| 158 | @Nullable |
| 159 | @DataClass.ParcelWith(ForInternedString.class) |
| 160 | private String overlayTarget; |
| 161 | @Nullable |
| 162 | @DataClass.ParcelWith(ForInternedString.class) |
| 163 | private String overlayTargetName; |
| 164 | @Nullable |
| 165 | @DataClass.ParcelWith(ForInternedString.class) |
| 166 | private String overlayCategory; |
| 167 | private int overlayPriority; |
| 168 | private boolean overlayIsStatic; |
| 169 | @NonNull |
Winson | e23ae20 | 2020-01-24 11:56:44 -0800 | [diff] [blame] | 170 | @DataClass.ParcelWith(ForInternedStringValueMap.class) |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 171 | private Map<String, String> overlayables = emptyMap(); |
| 172 | |
| 173 | @Nullable |
| 174 | @DataClass.ParcelWith(ForInternedString.class) |
| 175 | private String staticSharedLibName; |
| 176 | private long staticSharedLibVersion; |
| 177 | @NonNull |
| 178 | @DataClass.ParcelWith(ForInternedStringList.class) |
| 179 | private List<String> libraryNames = emptyList(); |
| 180 | @NonNull |
| 181 | @DataClass.ParcelWith(ForInternedStringList.class) |
| 182 | protected List<String> usesLibraries = emptyList(); |
| 183 | @NonNull |
| 184 | @DataClass.ParcelWith(ForInternedStringList.class) |
| 185 | protected List<String> usesOptionalLibraries = emptyList(); |
| 186 | |
| 187 | @NonNull |
| 188 | @DataClass.ParcelWith(ForInternedStringList.class) |
| 189 | private List<String> usesStaticLibraries = emptyList(); |
| 190 | @Nullable |
| 191 | private long[] usesStaticLibrariesVersions; |
| 192 | |
| 193 | @Nullable |
| 194 | private String[][] usesStaticLibrariesCertDigests; |
| 195 | |
| 196 | @Nullable |
| 197 | @DataClass.ParcelWith(ForInternedString.class) |
| 198 | private String sharedUserId; |
| 199 | |
| 200 | private int sharedUserLabel; |
| 201 | @NonNull |
| 202 | private List<ConfigurationInfo> configPreferences = emptyList(); |
| 203 | @NonNull |
| 204 | private List<FeatureInfo> reqFeatures = emptyList(); |
| 205 | @NonNull |
| 206 | private List<FeatureGroupInfo> featureGroups = emptyList(); |
| 207 | |
| 208 | @Nullable |
| 209 | private byte[] restrictUpdateHash; |
| 210 | |
| 211 | @NonNull |
| 212 | @DataClass.ParcelWith(ForInternedStringList.class) |
| 213 | protected List<String> originalPackages = emptyList(); |
| 214 | @NonNull |
| 215 | @DataClass.ParcelWith(ForInternedStringList.class) |
| 216 | protected List<String> adoptPermissions = emptyList(); |
| 217 | |
| 218 | @NonNull |
| 219 | @DataClass.ParcelWith(ForInternedStringList.class) |
| 220 | private List<String> requestedPermissions = emptyList(); |
| 221 | @NonNull |
| 222 | @DataClass.ParcelWith(ForInternedStringList.class) |
| 223 | private List<String> implicitPermissions = emptyList(); |
| 224 | |
| 225 | @NonNull |
| 226 | private Set<String> upgradeKeySets = emptySet(); |
| 227 | @NonNull |
| 228 | private Map<String, ArraySet<PublicKey>> keySetMapping = emptyMap(); |
| 229 | |
| 230 | @NonNull |
| 231 | @DataClass.ParcelWith(ForInternedStringList.class) |
| 232 | protected List<String> protectedBroadcasts = emptyList(); |
| 233 | |
| 234 | @NonNull |
| 235 | protected List<ParsedActivity> activities = emptyList(); |
| 236 | |
| 237 | @NonNull |
| 238 | protected List<ParsedActivity> receivers = emptyList(); |
| 239 | |
| 240 | @NonNull |
| 241 | protected List<ParsedService> services = emptyList(); |
| 242 | |
| 243 | @NonNull |
| 244 | protected List<ParsedProvider> providers = emptyList(); |
| 245 | |
| 246 | @NonNull |
Philip P. Moltmann | 12ac3f4 | 2020-03-05 15:01:29 -0800 | [diff] [blame] | 247 | private List<ParsedAttribution> attributions = emptyList(); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 248 | |
| 249 | @NonNull |
| 250 | protected List<ParsedPermission> permissions = emptyList(); |
| 251 | |
| 252 | @NonNull |
| 253 | protected List<ParsedPermissionGroup> permissionGroups = emptyList(); |
| 254 | |
| 255 | @NonNull |
| 256 | protected List<ParsedInstrumentation> instrumentations = emptyList(); |
| 257 | |
| 258 | @NonNull |
Winson | f00c755 | 2020-01-28 12:52:01 -0800 | [diff] [blame] | 259 | @DataClass.ParcelWith(ParsedIntentInfo.ListParceler.class) |
| 260 | private List<Pair<String, ParsedIntentInfo>> preferredActivityFilters = emptyList(); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 261 | |
| 262 | @NonNull |
| 263 | private Map<String, ParsedProcess> processes = emptyMap(); |
| 264 | |
| 265 | @Nullable |
| 266 | private Bundle metaData; |
| 267 | |
| 268 | @Nullable |
| 269 | @DataClass.ParcelWith(ForInternedString.class) |
| 270 | protected String volumeUuid; |
| 271 | @Nullable |
| 272 | private PackageParser.SigningDetails signingDetails; |
| 273 | |
| 274 | @NonNull |
| 275 | @DataClass.ParcelWith(ForInternedString.class) |
| 276 | protected String codePath; |
| 277 | |
| 278 | private boolean use32BitAbi; |
| 279 | private boolean visibleToInstantApps; |
| 280 | |
| 281 | private boolean forceQueryable; |
| 282 | |
| 283 | @NonNull |
| 284 | @DataClass.ParcelWith(ForInternedStringList.class) |
| 285 | private List<Intent> queriesIntents = emptyList(); |
| 286 | |
| 287 | @NonNull |
| 288 | @DataClass.ParcelWith(ForInternedStringList.class) |
| 289 | private List<String> queriesPackages = emptyList(); |
| 290 | |
| 291 | @NonNull |
| 292 | @DataClass.ParcelWith(ForInternedStringSet.class) |
| 293 | private Set<String> queriesProviders = emptySet(); |
| 294 | |
| 295 | @Nullable |
| 296 | @DataClass.ParcelWith(ForInternedStringArray.class) |
| 297 | private String[] splitClassLoaderNames; |
| 298 | @Nullable |
| 299 | protected String[] splitCodePaths; |
| 300 | @Nullable |
| 301 | private SparseArray<int[]> splitDependencies; |
| 302 | @Nullable |
| 303 | private int[] splitFlags; |
| 304 | @Nullable |
| 305 | @DataClass.ParcelWith(ForInternedStringArray.class) |
| 306 | private String[] splitNames; |
| 307 | @Nullable |
| 308 | private int[] splitRevisionCodes; |
| 309 | |
| 310 | @Nullable |
| 311 | @DataClass.ParcelWith(ForInternedString.class) |
| 312 | private String appComponentFactory; |
| 313 | @Nullable |
| 314 | @DataClass.ParcelWith(ForInternedString.class) |
| 315 | private String backupAgentName; |
| 316 | private int banner; |
| 317 | private int category; |
| 318 | @Nullable |
| 319 | @DataClass.ParcelWith(ForInternedString.class) |
| 320 | private String classLoaderName; |
| 321 | @Nullable |
| 322 | @DataClass.ParcelWith(ForInternedString.class) |
| 323 | private String className; |
| 324 | private int compatibleWidthLimitDp; |
| 325 | private int descriptionRes; |
Winson | 4688253 | 2020-04-02 12:16:13 -0700 | [diff] [blame] | 326 | |
| 327 | // Usually there's code to set this to true during parsing, but it's possible to install an APK |
| 328 | // targeting <R that doesn't contain an <application> tag. That code would be skipped and never |
| 329 | // assign this, so initialize this to true for those cases. |
| 330 | private boolean enabled = true; |
| 331 | |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 332 | private boolean crossProfile; |
| 333 | private int fullBackupContent; |
| 334 | private int iconRes; |
| 335 | private int installLocation = PackageParser.PARSE_DEFAULT_INSTALL_LOCATION; |
| 336 | private int labelRes; |
| 337 | private int largestWidthLimitDp; |
| 338 | private int logo; |
| 339 | @Nullable |
| 340 | @DataClass.ParcelWith(ForInternedString.class) |
| 341 | private String manageSpaceActivityName; |
| 342 | private float maxAspectRatio; |
| 343 | private float minAspectRatio; |
Oli Lan | 72ae447 | 2020-04-14 16:50:41 +0100 | [diff] [blame] | 344 | @Nullable |
| 345 | private SparseIntArray minExtensionVersions; |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 346 | private int minSdkVersion; |
| 347 | private int networkSecurityConfigRes; |
| 348 | @Nullable |
| 349 | private CharSequence nonLocalizedLabel; |
| 350 | @Nullable |
| 351 | @DataClass.ParcelWith(ForInternedString.class) |
| 352 | private String permission; |
| 353 | @Nullable |
| 354 | @DataClass.ParcelWith(ForInternedString.class) |
| 355 | private String processName; |
| 356 | private int requiresSmallestWidthDp; |
| 357 | private int roundIconRes; |
| 358 | private int targetSandboxVersion; |
| 359 | private int targetSdkVersion; |
| 360 | @Nullable |
| 361 | @DataClass.ParcelWith(ForInternedString.class) |
| 362 | private String taskAffinity; |
| 363 | private int theme; |
| 364 | |
| 365 | private int uiOptions; |
| 366 | @Nullable |
| 367 | @DataClass.ParcelWith(ForInternedString.class) |
| 368 | private String zygotePreloadName; |
| 369 | |
| 370 | private boolean externalStorage; |
| 371 | private boolean baseHardwareAccelerated; |
| 372 | private boolean allowBackup; |
| 373 | private boolean killAfterRestore; |
| 374 | private boolean restoreAnyVersion; |
| 375 | private boolean fullBackupOnly; |
| 376 | private boolean persistent; |
| 377 | private boolean debuggable; |
| 378 | private boolean vmSafeMode; |
| 379 | private boolean hasCode; |
| 380 | private boolean allowTaskReparenting; |
| 381 | private boolean allowClearUserData; |
| 382 | private boolean largeHeap; |
| 383 | private boolean usesCleartextTraffic; |
| 384 | private boolean supportsRtl; |
| 385 | private boolean testOnly; |
| 386 | private boolean multiArch; |
| 387 | private boolean extractNativeLibs; |
| 388 | private boolean game; |
| 389 | |
| 390 | /** |
| 391 | * @see ParsingPackageRead#getResizeableActivity() |
| 392 | */ |
| 393 | @Nullable |
| 394 | @DataClass.ParcelWith(ForBoolean.class) |
| 395 | private Boolean resizeableActivity; |
| 396 | |
| 397 | private boolean staticSharedLibrary; |
| 398 | private boolean overlay; |
| 399 | private boolean isolatedSplitLoading; |
| 400 | private boolean hasDomainUrls; |
| 401 | private boolean profileableByShell; |
| 402 | private boolean backupInForeground; |
| 403 | private boolean useEmbeddedDex; |
| 404 | private boolean defaultToDeviceProtectedStorage; |
| 405 | private boolean directBootAware; |
| 406 | private boolean partiallyDirectBootAware; |
| 407 | private boolean resizeableActivityViaSdkVersion; |
| 408 | private boolean allowClearUserDataOnFailedRestore; |
| 409 | private boolean allowAudioPlaybackCapture; |
| 410 | private boolean requestLegacyExternalStorage; |
| 411 | private boolean usesNonSdkApi; |
| 412 | private boolean hasFragileUserData; |
| 413 | private boolean cantSaveState; |
| 414 | private boolean allowNativeHeapPointerTagging; |
Eugene Susla | 49b84c3 | 2020-03-23 15:19:29 -0700 | [diff] [blame] | 415 | private int autoRevokePermissions; |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 416 | private boolean preserveLegacyExternalStorage; |
| 417 | |
Evgenii Stepanov | d43d109 | 2020-03-16 13:55:42 -0700 | [diff] [blame] | 418 | protected int gwpAsanMode; |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 419 | |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 420 | // TODO(chiuwinson): Non-null |
| 421 | @Nullable |
| 422 | private ArraySet<String> mimeGroups; |
| 423 | |
| 424 | @VisibleForTesting |
| 425 | public ParsingPackageImpl(@NonNull String packageName, @NonNull String baseCodePath, |
| 426 | @NonNull String codePath, @Nullable TypedArray manifestArray) { |
| 427 | this.packageName = TextUtils.safeIntern(packageName); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 428 | this.baseCodePath = baseCodePath; |
| 429 | this.codePath = codePath; |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 430 | |
| 431 | if (manifestArray != null) { |
| 432 | versionCode = manifestArray.getInteger(R.styleable.AndroidManifest_versionCode, 0); |
| 433 | versionCodeMajor = manifestArray.getInteger( |
| 434 | R.styleable.AndroidManifest_versionCodeMajor, 0); |
| 435 | setBaseRevisionCode( |
| 436 | manifestArray.getInteger(R.styleable.AndroidManifest_revisionCode, 0)); |
| 437 | setVersionName(manifestArray.getNonConfigurationString( |
| 438 | R.styleable.AndroidManifest_versionName, 0)); |
| 439 | |
| 440 | setCompileSdkVersion(manifestArray.getInteger( |
| 441 | R.styleable.AndroidManifest_compileSdkVersion, 0)); |
| 442 | setCompileSdkVersionCodename(manifestArray.getNonConfigurationString( |
| 443 | R.styleable.AndroidManifest_compileSdkVersionCodename, 0)); |
Todd Kennedy | 83eddae | 2020-03-02 09:21:25 -0800 | [diff] [blame] | 444 | |
| 445 | setIsolatedSplitLoading(manifestArray.getBoolean( |
| 446 | R.styleable.AndroidManifest_isolatedSplits, false)); |
| 447 | |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 448 | } |
| 449 | } |
| 450 | |
| 451 | public boolean isSupportsSmallScreens() { |
| 452 | if (supportsSmallScreens == null) { |
| 453 | return targetSdkVersion >= Build.VERSION_CODES.DONUT; |
| 454 | } |
| 455 | |
| 456 | return supportsSmallScreens; |
| 457 | } |
| 458 | |
| 459 | public boolean isSupportsNormalScreens() { |
| 460 | return supportsNormalScreens == null || supportsNormalScreens; |
| 461 | } |
| 462 | |
| 463 | public boolean isSupportsLargeScreens() { |
| 464 | if (supportsLargeScreens == null) { |
| 465 | return targetSdkVersion >= Build.VERSION_CODES.DONUT; |
| 466 | } |
| 467 | |
| 468 | return supportsLargeScreens; |
| 469 | } |
| 470 | |
| 471 | public boolean isSupportsExtraLargeScreens() { |
| 472 | if (supportsExtraLargeScreens == null) { |
| 473 | return targetSdkVersion >= Build.VERSION_CODES.GINGERBREAD; |
| 474 | } |
| 475 | |
| 476 | return supportsExtraLargeScreens; |
| 477 | } |
| 478 | |
| 479 | public boolean isResizeable() { |
| 480 | if (resizeable == null) { |
| 481 | return targetSdkVersion >= Build.VERSION_CODES.DONUT; |
| 482 | } |
| 483 | |
| 484 | return resizeable; |
| 485 | } |
| 486 | |
| 487 | public boolean isAnyDensity() { |
| 488 | if (anyDensity == null) { |
| 489 | return targetSdkVersion >= Build.VERSION_CODES.DONUT; |
| 490 | } |
| 491 | |
| 492 | return anyDensity; |
| 493 | } |
| 494 | |
| 495 | @Override |
| 496 | public ParsingPackageImpl sortActivities() { |
Winson | f00c755 | 2020-01-28 12:52:01 -0800 | [diff] [blame] | 497 | Collections.sort(this.activities, ORDER_COMPARATOR); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 498 | return this; |
| 499 | } |
| 500 | |
| 501 | @Override |
| 502 | public ParsingPackageImpl sortReceivers() { |
Winson | f00c755 | 2020-01-28 12:52:01 -0800 | [diff] [blame] | 503 | Collections.sort(this.receivers, ORDER_COMPARATOR); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 504 | return this; |
| 505 | } |
| 506 | |
| 507 | @Override |
| 508 | public ParsingPackageImpl sortServices() { |
Winson | f00c755 | 2020-01-28 12:52:01 -0800 | [diff] [blame] | 509 | Collections.sort(this.services, ORDER_COMPARATOR); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 510 | return this; |
| 511 | } |
| 512 | |
| 513 | @Override |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 514 | public Object hideAsParsed() { |
| 515 | // There is no equivalent for core-only parsing |
| 516 | throw new UnsupportedOperationException(); |
| 517 | } |
| 518 | |
| 519 | @Override |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 520 | public ParsingPackageImpl addConfigPreference(ConfigurationInfo configPreference) { |
| 521 | this.configPreferences = CollectionUtils.add(this.configPreferences, configPreference); |
| 522 | return this; |
| 523 | } |
| 524 | |
| 525 | @Override |
| 526 | public ParsingPackageImpl addReqFeature(FeatureInfo reqFeature) { |
| 527 | this.reqFeatures = CollectionUtils.add(this.reqFeatures, reqFeature); |
| 528 | return this; |
| 529 | } |
| 530 | |
| 531 | @Override |
| 532 | public ParsingPackageImpl addFeatureGroup(FeatureGroupInfo featureGroup) { |
| 533 | this.featureGroups = CollectionUtils.add(this.featureGroups, featureGroup); |
| 534 | return this; |
| 535 | } |
| 536 | |
| 537 | @Override |
| 538 | public ParsingPackageImpl addProtectedBroadcast(String protectedBroadcast) { |
| 539 | if (!this.protectedBroadcasts.contains(protectedBroadcast)) { |
| 540 | this.protectedBroadcasts = CollectionUtils.add(this.protectedBroadcasts, |
| 541 | TextUtils.safeIntern(protectedBroadcast)); |
| 542 | } |
| 543 | return this; |
| 544 | } |
| 545 | |
| 546 | @Override |
| 547 | public ParsingPackageImpl addInstrumentation(ParsedInstrumentation instrumentation) { |
| 548 | this.instrumentations = CollectionUtils.add(this.instrumentations, instrumentation); |
| 549 | return this; |
| 550 | } |
| 551 | |
| 552 | @Override |
| 553 | public ParsingPackageImpl addOriginalPackage(String originalPackage) { |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 554 | this.originalPackages = CollectionUtils.add(this.originalPackages, originalPackage); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 555 | return this; |
| 556 | } |
| 557 | |
| 558 | @Override |
| 559 | public ParsingPackage addOverlayable(String overlayableName, String actorName) { |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 560 | this.overlayables = CollectionUtils.add(this.overlayables, overlayableName, |
| 561 | TextUtils.safeIntern(actorName)); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 562 | return this; |
| 563 | } |
| 564 | |
| 565 | @Override |
| 566 | public ParsingPackageImpl addAdoptPermission(String adoptPermission) { |
| 567 | this.adoptPermissions = CollectionUtils.add(this.adoptPermissions, |
| 568 | TextUtils.safeIntern(adoptPermission)); |
| 569 | return this; |
| 570 | } |
| 571 | |
| 572 | @Override |
| 573 | public ParsingPackageImpl addPermission(ParsedPermission permission) { |
| 574 | this.permissions = CollectionUtils.add(this.permissions, permission); |
| 575 | return this; |
| 576 | } |
| 577 | |
| 578 | @Override |
| 579 | public ParsingPackageImpl addPermissionGroup(ParsedPermissionGroup permissionGroup) { |
| 580 | this.permissionGroups = CollectionUtils.add(this.permissionGroups, permissionGroup); |
| 581 | return this; |
| 582 | } |
| 583 | |
| 584 | @Override |
| 585 | public ParsingPackageImpl addRequestedPermission(String permission) { |
| 586 | this.requestedPermissions = CollectionUtils.add(this.requestedPermissions, |
| 587 | TextUtils.safeIntern(permission)); |
| 588 | return this; |
| 589 | } |
| 590 | |
| 591 | @Override |
| 592 | public ParsingPackageImpl addImplicitPermission(String permission) { |
| 593 | this.implicitPermissions = CollectionUtils.add(this.implicitPermissions, |
| 594 | TextUtils.safeIntern(permission)); |
| 595 | return this; |
| 596 | } |
| 597 | |
| 598 | @Override |
| 599 | public ParsingPackageImpl addKeySet(String keySetName, PublicKey publicKey) { |
| 600 | ArraySet<PublicKey> publicKeys = keySetMapping.get(keySetName); |
| 601 | if (publicKeys == null) { |
| 602 | publicKeys = new ArraySet<>(); |
| 603 | } |
| 604 | publicKeys.add(publicKey); |
| 605 | keySetMapping = CollectionUtils.add(this.keySetMapping, keySetName, publicKeys); |
| 606 | return this; |
| 607 | } |
| 608 | |
| 609 | @Override |
| 610 | public ParsingPackageImpl addActivity(ParsedActivity parsedActivity) { |
| 611 | this.activities = CollectionUtils.add(this.activities, parsedActivity); |
| 612 | addMimeGroupsFromComponent(parsedActivity); |
| 613 | return this; |
| 614 | } |
| 615 | |
| 616 | @Override |
| 617 | public ParsingPackageImpl addReceiver(ParsedActivity parsedReceiver) { |
| 618 | this.receivers = CollectionUtils.add(this.receivers, parsedReceiver); |
| 619 | addMimeGroupsFromComponent(parsedReceiver); |
| 620 | return this; |
| 621 | } |
| 622 | |
| 623 | @Override |
| 624 | public ParsingPackageImpl addService(ParsedService parsedService) { |
| 625 | this.services = CollectionUtils.add(this.services, parsedService); |
| 626 | addMimeGroupsFromComponent(parsedService); |
| 627 | return this; |
| 628 | } |
| 629 | |
| 630 | @Override |
| 631 | public ParsingPackageImpl addProvider(ParsedProvider parsedProvider) { |
| 632 | this.providers = CollectionUtils.add(this.providers, parsedProvider); |
| 633 | addMimeGroupsFromComponent(parsedProvider); |
| 634 | return this; |
| 635 | } |
| 636 | |
| 637 | @Override |
Philip P. Moltmann | 12ac3f4 | 2020-03-05 15:01:29 -0800 | [diff] [blame] | 638 | public ParsingPackageImpl addAttribution(ParsedAttribution attribution) { |
| 639 | this.attributions = CollectionUtils.add(this.attributions, attribution); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 640 | return this; |
| 641 | } |
| 642 | |
| 643 | @Override |
| 644 | public ParsingPackageImpl addLibraryName(String libraryName) { |
| 645 | this.libraryNames = CollectionUtils.add(this.libraryNames, |
| 646 | TextUtils.safeIntern(libraryName)); |
| 647 | return this; |
| 648 | } |
| 649 | |
| 650 | @Override |
| 651 | public ParsingPackageImpl addUsesOptionalLibrary(String libraryName) { |
| 652 | this.usesOptionalLibraries = CollectionUtils.add(this.usesOptionalLibraries, |
| 653 | TextUtils.safeIntern(libraryName)); |
| 654 | return this; |
| 655 | } |
| 656 | |
| 657 | @Override |
| 658 | public ParsingPackageImpl addUsesLibrary(String libraryName) { |
| 659 | this.usesLibraries = CollectionUtils.add(this.usesLibraries, |
| 660 | TextUtils.safeIntern(libraryName)); |
| 661 | return this; |
| 662 | } |
| 663 | |
| 664 | @Override |
| 665 | public ParsingPackageImpl removeUsesOptionalLibrary(String libraryName) { |
| 666 | this.usesOptionalLibraries = CollectionUtils.remove(this.usesOptionalLibraries, |
| 667 | libraryName); |
| 668 | return this; |
| 669 | } |
| 670 | |
| 671 | @Override |
| 672 | public ParsingPackageImpl addUsesStaticLibrary(String libraryName) { |
| 673 | this.usesStaticLibraries = CollectionUtils.add(this.usesStaticLibraries, |
| 674 | TextUtils.safeIntern(libraryName)); |
| 675 | return this; |
| 676 | } |
| 677 | |
| 678 | @Override |
| 679 | public ParsingPackageImpl addUsesStaticLibraryVersion(long version) { |
| 680 | this.usesStaticLibrariesVersions = ArrayUtils.appendLong(this.usesStaticLibrariesVersions, |
| 681 | version, true); |
| 682 | return this; |
| 683 | } |
| 684 | |
| 685 | @Override |
| 686 | public ParsingPackageImpl addUsesStaticLibraryCertDigests(String[] certSha256Digests) { |
| 687 | this.usesStaticLibrariesCertDigests = ArrayUtils.appendElement(String[].class, |
| 688 | this.usesStaticLibrariesCertDigests, certSha256Digests, true); |
| 689 | return this; |
| 690 | } |
| 691 | |
| 692 | @Override |
Winson | f00c755 | 2020-01-28 12:52:01 -0800 | [diff] [blame] | 693 | public ParsingPackageImpl addPreferredActivityFilter(String className, |
| 694 | ParsedIntentInfo intentInfo) { |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 695 | this.preferredActivityFilters = CollectionUtils.add(this.preferredActivityFilters, |
Winson | f00c755 | 2020-01-28 12:52:01 -0800 | [diff] [blame] | 696 | Pair.create(className, intentInfo)); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 697 | return this; |
| 698 | } |
| 699 | |
| 700 | @Override |
| 701 | public ParsingPackageImpl addQueriesIntent(Intent intent) { |
| 702 | this.queriesIntents = CollectionUtils.add(this.queriesIntents, intent); |
| 703 | return this; |
| 704 | } |
| 705 | |
| 706 | @Override |
| 707 | public ParsingPackageImpl addQueriesPackage(String packageName) { |
| 708 | this.queriesPackages = CollectionUtils.add(this.queriesPackages, |
| 709 | TextUtils.safeIntern(packageName)); |
| 710 | return this; |
| 711 | } |
| 712 | |
| 713 | @Override |
| 714 | public ParsingPackageImpl addQueriesProvider(String authority) { |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 715 | this.queriesProviders = CollectionUtils.add(this.queriesProviders, authority); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 716 | return this; |
| 717 | } |
| 718 | |
| 719 | @Override |
| 720 | public ParsingPackageImpl setSupportsSmallScreens(int supportsSmallScreens) { |
| 721 | if (supportsSmallScreens == 1) { |
| 722 | return this; |
| 723 | } |
| 724 | |
| 725 | this.supportsSmallScreens = supportsSmallScreens < 0; |
| 726 | return this; |
| 727 | } |
| 728 | |
| 729 | @Override |
| 730 | public ParsingPackageImpl setSupportsNormalScreens(int supportsNormalScreens) { |
| 731 | if (supportsNormalScreens == 1) { |
| 732 | return this; |
| 733 | } |
| 734 | |
| 735 | this.supportsNormalScreens = supportsNormalScreens < 0; |
| 736 | return this; |
| 737 | } |
| 738 | |
| 739 | @Override |
| 740 | public ParsingPackageImpl setSupportsLargeScreens(int supportsLargeScreens) { |
| 741 | if (supportsLargeScreens == 1) { |
| 742 | return this; |
| 743 | } |
| 744 | |
| 745 | this.supportsLargeScreens = supportsLargeScreens < 0; |
| 746 | return this; |
| 747 | } |
| 748 | |
| 749 | @Override |
| 750 | public ParsingPackageImpl setSupportsExtraLargeScreens(int supportsExtraLargeScreens) { |
| 751 | if (supportsExtraLargeScreens == 1) { |
| 752 | return this; |
| 753 | } |
| 754 | |
| 755 | this.supportsExtraLargeScreens = supportsExtraLargeScreens < 0; |
| 756 | return this; |
| 757 | } |
| 758 | |
| 759 | @Override |
| 760 | public ParsingPackageImpl setResizeable(int resizeable) { |
| 761 | if (resizeable == 1) { |
| 762 | return this; |
| 763 | } |
| 764 | |
| 765 | this.resizeable = resizeable < 0; |
| 766 | return this; |
| 767 | } |
| 768 | |
| 769 | @Override |
| 770 | public ParsingPackageImpl setAnyDensity(int anyDensity) { |
| 771 | if (anyDensity == 1) { |
| 772 | return this; |
| 773 | } |
| 774 | |
| 775 | this.anyDensity = anyDensity < 0; |
| 776 | return this; |
| 777 | } |
| 778 | |
| 779 | @Override |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 780 | public ParsingPackageImpl asSplit(String[] splitNames, String[] splitCodePaths, |
| 781 | int[] splitRevisionCodes, SparseArray<int[]> splitDependencies) { |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 782 | this.splitNames = splitNames; |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 783 | this.splitCodePaths = splitCodePaths; |
| 784 | this.splitRevisionCodes = splitRevisionCodes; |
| 785 | this.splitDependencies = splitDependencies; |
| 786 | |
| 787 | int count = splitNames.length; |
| 788 | this.splitFlags = new int[count]; |
| 789 | this.splitClassLoaderNames = new String[count]; |
| 790 | return this; |
| 791 | } |
| 792 | |
| 793 | @Override |
| 794 | public ParsingPackageImpl setSplitHasCode(int splitIndex, boolean splitHasCode) { |
| 795 | this.splitFlags[splitIndex] = splitHasCode |
| 796 | ? this.splitFlags[splitIndex] | ApplicationInfo.FLAG_HAS_CODE |
| 797 | : this.splitFlags[splitIndex] & ~ApplicationInfo.FLAG_HAS_CODE; |
| 798 | return this; |
| 799 | } |
| 800 | |
| 801 | @Override |
| 802 | public ParsingPackageImpl setSplitClassLoaderName(int splitIndex, String classLoaderName) { |
| 803 | this.splitClassLoaderNames[splitIndex] = classLoaderName; |
| 804 | return this; |
| 805 | } |
| 806 | |
| 807 | @Override |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 808 | public ParsingPackageImpl setRequiredAccountType(@Nullable String requiredAccountType) { |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 809 | this.requiredAccountType = TextUtils.nullIfEmpty(requiredAccountType); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 810 | return this; |
| 811 | } |
| 812 | |
| 813 | @Override |
| 814 | public ParsingPackageImpl setOverlayTarget(@Nullable String overlayTarget) { |
| 815 | this.overlayTarget = TextUtils.safeIntern(overlayTarget); |
| 816 | return this; |
| 817 | } |
| 818 | |
| 819 | @Override |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 820 | public ParsingPackageImpl setVolumeUuid(@Nullable String volumeUuid) { |
| 821 | this.volumeUuid = TextUtils.safeIntern(volumeUuid); |
| 822 | return this; |
| 823 | } |
| 824 | |
| 825 | @Override |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 826 | public ParsingPackageImpl setStaticSharedLibName(String staticSharedLibName) { |
| 827 | this.staticSharedLibName = TextUtils.safeIntern(staticSharedLibName); |
| 828 | return this; |
| 829 | } |
| 830 | |
| 831 | @Override |
| 832 | public ParsingPackageImpl setSharedUserId(String sharedUserId) { |
| 833 | this.sharedUserId = TextUtils.safeIntern(sharedUserId); |
| 834 | return this; |
| 835 | } |
| 836 | |
| 837 | @NonNull |
| 838 | @Override |
| 839 | public String getProcessName() { |
| 840 | return processName != null ? processName : packageName; |
| 841 | } |
| 842 | |
| 843 | @Override |
| 844 | public String toString() { |
| 845 | return "Package{" |
| 846 | + Integer.toHexString(System.identityHashCode(this)) |
| 847 | + " " + packageName + "}"; |
| 848 | } |
| 849 | |
| 850 | @Deprecated |
| 851 | @Override |
| 852 | public ApplicationInfo toAppInfoWithoutState() { |
| 853 | ApplicationInfo appInfo = new ApplicationInfo(); |
| 854 | appInfo.flags = PackageInfoWithoutStateUtils.appInfoFlags(this); |
| 855 | appInfo.privateFlags = PackageInfoWithoutStateUtils.appInfoPrivateFlags(this); |
| 856 | |
| 857 | appInfo.appComponentFactory = appComponentFactory; |
| 858 | appInfo.backupAgentName = backupAgentName; |
| 859 | appInfo.banner = banner; |
| 860 | appInfo.category = category; |
| 861 | appInfo.classLoaderName = classLoaderName; |
| 862 | appInfo.className = className; |
| 863 | appInfo.compatibleWidthLimitDp = compatibleWidthLimitDp; |
| 864 | appInfo.compileSdkVersion = compileSdkVersion; |
| 865 | appInfo.compileSdkVersionCodename = compileSdkVersionCodeName; |
| 866 | // appInfo.credentialProtectedDataDir = credentialProtectedDataDir; |
| 867 | // appInfo.dataDir = dataDir; |
| 868 | appInfo.descriptionRes = descriptionRes; |
| 869 | // appInfo.deviceProtectedDataDir = deviceProtectedDataDir; |
| 870 | appInfo.enabled = enabled; |
| 871 | appInfo.fullBackupContent = fullBackupContent; |
| 872 | // appInfo.hiddenUntilInstalled = hiddenUntilInstalled; |
| 873 | appInfo.icon = (PackageParser.sUseRoundIcon && roundIconRes != 0) ? roundIconRes : iconRes; |
| 874 | appInfo.iconRes = iconRes; |
| 875 | appInfo.roundIconRes = roundIconRes; |
| 876 | appInfo.installLocation = installLocation; |
| 877 | appInfo.labelRes = labelRes; |
| 878 | appInfo.largestWidthLimitDp = largestWidthLimitDp; |
| 879 | appInfo.logo = logo; |
| 880 | appInfo.manageSpaceActivityName = manageSpaceActivityName; |
| 881 | appInfo.maxAspectRatio = maxAspectRatio; |
| 882 | appInfo.metaData = metaData; |
| 883 | appInfo.minAspectRatio = minAspectRatio; |
| 884 | appInfo.minSdkVersion = minSdkVersion; |
| 885 | appInfo.name = className; |
| 886 | if (appInfo.name != null) { |
| 887 | appInfo.name = appInfo.name.trim(); |
| 888 | } |
| 889 | // appInfo.nativeLibraryDir = nativeLibraryDir; |
| 890 | // appInfo.nativeLibraryRootDir = nativeLibraryRootDir; |
| 891 | // appInfo.nativeLibraryRootRequiresIsa = nativeLibraryRootRequiresIsa; |
| 892 | appInfo.networkSecurityConfigRes = networkSecurityConfigRes; |
| 893 | appInfo.nonLocalizedLabel = nonLocalizedLabel; |
| 894 | if (appInfo.nonLocalizedLabel != null) { |
| 895 | appInfo.nonLocalizedLabel = appInfo.nonLocalizedLabel.toString().trim(); |
| 896 | } |
| 897 | appInfo.packageName = packageName; |
| 898 | appInfo.permission = permission; |
| 899 | // appInfo.primaryCpuAbi = primaryCpuAbi; |
| 900 | appInfo.processName = getProcessName(); |
| 901 | appInfo.requiresSmallestWidthDp = requiresSmallestWidthDp; |
| 902 | // appInfo.secondaryCpuAbi = secondaryCpuAbi; |
| 903 | // appInfo.secondaryNativeLibraryDir = secondaryNativeLibraryDir; |
| 904 | // appInfo.seInfo = seInfo; |
| 905 | // appInfo.seInfoUser = seInfoUser; |
| 906 | // appInfo.sharedLibraryFiles = usesLibraryFiles.isEmpty() |
| 907 | // ? null : usesLibraryFiles.toArray(new String[0]); |
| 908 | // appInfo.sharedLibraryInfos = usesLibraryInfos.isEmpty() ? null : usesLibraryInfos; |
| 909 | appInfo.splitClassLoaderNames = splitClassLoaderNames; |
| 910 | appInfo.splitDependencies = splitDependencies; |
| 911 | appInfo.splitNames = splitNames; |
| 912 | appInfo.storageUuid = StorageManager.convert(volumeUuid); |
| 913 | appInfo.targetSandboxVersion = targetSandboxVersion; |
| 914 | appInfo.targetSdkVersion = targetSdkVersion; |
| 915 | appInfo.taskAffinity = taskAffinity; |
| 916 | appInfo.theme = theme; |
| 917 | // appInfo.uid = uid; |
| 918 | appInfo.uiOptions = uiOptions; |
| 919 | appInfo.volumeUuid = volumeUuid; |
| 920 | appInfo.zygotePreloadName = zygotePreloadName; |
| 921 | appInfo.crossProfile = isCrossProfile(); |
Evgenii Stepanov | d43d109 | 2020-03-16 13:55:42 -0700 | [diff] [blame] | 922 | appInfo.setGwpAsanMode(gwpAsanMode); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 923 | appInfo.setBaseCodePath(baseCodePath); |
| 924 | appInfo.setBaseResourcePath(baseCodePath); |
| 925 | appInfo.setCodePath(codePath); |
| 926 | appInfo.setResourcePath(codePath); |
| 927 | appInfo.setSplitCodePaths(splitCodePaths); |
| 928 | appInfo.setSplitResourcePaths(splitCodePaths); |
| 929 | appInfo.setVersionCode(PackageInfo.composeLongVersionCode(versionCodeMajor, versionCode)); |
| 930 | |
| 931 | // TODO(b/135203078): Can this be removed? Looks only used in ActivityInfo. |
| 932 | // appInfo.showUserIcon = pkg.getShowUserIcon(); |
| 933 | // TODO(b/135203078): Unused? |
| 934 | // appInfo.resourceDirs = pkg.getResourceDirs(); |
| 935 | // TODO(b/135203078): Unused? |
| 936 | // appInfo.enabledSetting = pkg.getEnabledSetting(); |
| 937 | // TODO(b/135203078): See ParsingPackageImpl#getHiddenApiEnforcementPolicy |
| 938 | // appInfo.mHiddenApiPolicy = pkg.getHiddenApiPolicy(); |
| 939 | |
| 940 | return appInfo; |
| 941 | } |
| 942 | |
| 943 | @Override |
| 944 | public int describeContents() { |
| 945 | return 0; |
| 946 | } |
| 947 | |
| 948 | @Override |
| 949 | public void writeToParcel(Parcel dest, int flags) { |
| 950 | sForBoolean.parcel(this.supportsSmallScreens, dest, flags); |
| 951 | sForBoolean.parcel(this.supportsNormalScreens, dest, flags); |
| 952 | sForBoolean.parcel(this.supportsLargeScreens, dest, flags); |
| 953 | sForBoolean.parcel(this.supportsExtraLargeScreens, dest, flags); |
| 954 | sForBoolean.parcel(this.resizeable, dest, flags); |
| 955 | sForBoolean.parcel(this.anyDensity, dest, flags); |
| 956 | dest.writeInt(this.versionCode); |
| 957 | dest.writeInt(this.versionCodeMajor); |
| 958 | dest.writeInt(this.baseRevisionCode); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 959 | sForInternedString.parcel(this.versionName, dest, flags); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 960 | dest.writeInt(this.compileSdkVersion); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 961 | dest.writeString(this.compileSdkVersionCodeName); |
| 962 | sForInternedString.parcel(this.packageName, dest, flags); |
| 963 | dest.writeString(this.realPackage); |
| 964 | dest.writeString(this.baseCodePath); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 965 | dest.writeBoolean(this.requiredForAllUsers); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 966 | dest.writeString(this.restrictedAccountType); |
| 967 | dest.writeString(this.requiredAccountType); |
| 968 | sForInternedString.parcel(this.overlayTarget, dest, flags); |
| 969 | dest.writeString(this.overlayTargetName); |
| 970 | dest.writeString(this.overlayCategory); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 971 | dest.writeInt(this.overlayPriority); |
| 972 | dest.writeBoolean(this.overlayIsStatic); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 973 | sForInternedStringValueMap.parcel(this.overlayables, dest, flags); |
| 974 | sForInternedString.parcel(this.staticSharedLibName, dest, flags); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 975 | dest.writeLong(this.staticSharedLibVersion); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 976 | sForInternedStringList.parcel(this.libraryNames, dest, flags); |
| 977 | sForInternedStringList.parcel(this.usesLibraries, dest, flags); |
| 978 | sForInternedStringList.parcel(this.usesOptionalLibraries, dest, flags); |
| 979 | sForInternedStringList.parcel(this.usesStaticLibraries, dest, flags); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 980 | dest.writeLongArray(this.usesStaticLibrariesVersions); |
| 981 | |
| 982 | if (this.usesStaticLibrariesCertDigests == null) { |
| 983 | dest.writeInt(-1); |
| 984 | } else { |
| 985 | dest.writeInt(this.usesStaticLibrariesCertDigests.length); |
| 986 | for (int index = 0; index < this.usesStaticLibrariesCertDigests.length; index++) { |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 987 | dest.writeStringArray(this.usesStaticLibrariesCertDigests[index]); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 988 | } |
| 989 | } |
| 990 | |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 991 | sForInternedString.parcel(this.sharedUserId, dest, flags); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 992 | dest.writeInt(this.sharedUserLabel); |
| 993 | dest.writeTypedList(this.configPreferences); |
| 994 | dest.writeTypedList(this.reqFeatures); |
| 995 | dest.writeTypedList(this.featureGroups); |
| 996 | dest.writeByteArray(this.restrictUpdateHash); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 997 | dest.writeStringList(this.originalPackages); |
| 998 | sForInternedStringList.parcel(this.adoptPermissions, dest, flags); |
| 999 | sForInternedStringList.parcel(this.requestedPermissions, dest, flags); |
| 1000 | sForInternedStringList.parcel(this.implicitPermissions, dest, flags); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1001 | sForStringSet.parcel(this.upgradeKeySets, dest, flags); |
| 1002 | dest.writeMap(this.keySetMapping); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1003 | sForInternedStringList.parcel(this.protectedBroadcasts, dest, flags); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1004 | dest.writeTypedList(this.activities); |
| 1005 | dest.writeTypedList(this.receivers); |
| 1006 | dest.writeTypedList(this.services); |
| 1007 | dest.writeTypedList(this.providers); |
Philip P. Moltmann | 12ac3f4 | 2020-03-05 15:01:29 -0800 | [diff] [blame] | 1008 | dest.writeTypedList(this.attributions); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1009 | dest.writeTypedList(this.permissions); |
| 1010 | dest.writeTypedList(this.permissionGroups); |
| 1011 | dest.writeTypedList(this.instrumentations); |
Winson | f00c755 | 2020-01-28 12:52:01 -0800 | [diff] [blame] | 1012 | sForIntentInfoPairs.parcel(this.preferredActivityFilters, dest, flags); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1013 | dest.writeMap(this.processes); |
| 1014 | dest.writeBundle(this.metaData); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1015 | sForInternedString.parcel(this.volumeUuid, dest, flags); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1016 | dest.writeParcelable(this.signingDetails, flags); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1017 | dest.writeString(this.codePath); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1018 | dest.writeBoolean(this.use32BitAbi); |
| 1019 | dest.writeBoolean(this.visibleToInstantApps); |
| 1020 | dest.writeBoolean(this.forceQueryable); |
| 1021 | dest.writeParcelableList(this.queriesIntents, flags); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1022 | sForInternedStringList.parcel(this.queriesPackages, dest, flags); |
| 1023 | dest.writeString(this.appComponentFactory); |
| 1024 | dest.writeString(this.backupAgentName); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1025 | dest.writeInt(this.banner); |
| 1026 | dest.writeInt(this.category); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1027 | dest.writeString(this.classLoaderName); |
| 1028 | dest.writeString(this.className); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1029 | dest.writeInt(this.compatibleWidthLimitDp); |
| 1030 | dest.writeInt(this.descriptionRes); |
| 1031 | dest.writeBoolean(this.enabled); |
| 1032 | dest.writeBoolean(this.crossProfile); |
| 1033 | dest.writeInt(this.fullBackupContent); |
| 1034 | dest.writeInt(this.iconRes); |
| 1035 | dest.writeInt(this.installLocation); |
| 1036 | dest.writeInt(this.labelRes); |
| 1037 | dest.writeInt(this.largestWidthLimitDp); |
| 1038 | dest.writeInt(this.logo); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1039 | dest.writeString(this.manageSpaceActivityName); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1040 | dest.writeFloat(this.maxAspectRatio); |
| 1041 | dest.writeFloat(this.minAspectRatio); |
| 1042 | dest.writeInt(this.minSdkVersion); |
| 1043 | dest.writeInt(this.networkSecurityConfigRes); |
| 1044 | dest.writeCharSequence(this.nonLocalizedLabel); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1045 | dest.writeString(this.permission); |
| 1046 | dest.writeString(this.processName); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1047 | dest.writeInt(this.requiresSmallestWidthDp); |
| 1048 | dest.writeInt(this.roundIconRes); |
| 1049 | dest.writeInt(this.targetSandboxVersion); |
| 1050 | dest.writeInt(this.targetSdkVersion); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1051 | dest.writeString(this.taskAffinity); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1052 | dest.writeInt(this.theme); |
| 1053 | dest.writeInt(this.uiOptions); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1054 | dest.writeString(this.zygotePreloadName); |
| 1055 | dest.writeStringArray(this.splitClassLoaderNames); |
| 1056 | dest.writeStringArray(this.splitCodePaths); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1057 | dest.writeSparseArray(this.splitDependencies); |
| 1058 | dest.writeIntArray(this.splitFlags); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1059 | dest.writeStringArray(this.splitNames); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1060 | dest.writeIntArray(this.splitRevisionCodes); |
| 1061 | |
| 1062 | dest.writeBoolean(this.externalStorage); |
| 1063 | dest.writeBoolean(this.baseHardwareAccelerated); |
| 1064 | dest.writeBoolean(this.allowBackup); |
| 1065 | dest.writeBoolean(this.killAfterRestore); |
| 1066 | dest.writeBoolean(this.restoreAnyVersion); |
| 1067 | dest.writeBoolean(this.fullBackupOnly); |
| 1068 | dest.writeBoolean(this.persistent); |
| 1069 | dest.writeBoolean(this.debuggable); |
| 1070 | dest.writeBoolean(this.vmSafeMode); |
| 1071 | dest.writeBoolean(this.hasCode); |
| 1072 | dest.writeBoolean(this.allowTaskReparenting); |
| 1073 | dest.writeBoolean(this.allowClearUserData); |
| 1074 | dest.writeBoolean(this.largeHeap); |
| 1075 | dest.writeBoolean(this.usesCleartextTraffic); |
| 1076 | dest.writeBoolean(this.supportsRtl); |
| 1077 | dest.writeBoolean(this.testOnly); |
| 1078 | dest.writeBoolean(this.multiArch); |
| 1079 | dest.writeBoolean(this.extractNativeLibs); |
| 1080 | dest.writeBoolean(this.game); |
| 1081 | |
| 1082 | sForBoolean.parcel(this.resizeableActivity, dest, flags); |
| 1083 | |
| 1084 | dest.writeBoolean(this.staticSharedLibrary); |
| 1085 | dest.writeBoolean(this.overlay); |
| 1086 | dest.writeBoolean(this.isolatedSplitLoading); |
| 1087 | dest.writeBoolean(this.hasDomainUrls); |
| 1088 | dest.writeBoolean(this.profileableByShell); |
| 1089 | dest.writeBoolean(this.backupInForeground); |
| 1090 | dest.writeBoolean(this.useEmbeddedDex); |
| 1091 | dest.writeBoolean(this.defaultToDeviceProtectedStorage); |
| 1092 | dest.writeBoolean(this.directBootAware); |
| 1093 | dest.writeBoolean(this.partiallyDirectBootAware); |
| 1094 | dest.writeBoolean(this.resizeableActivityViaSdkVersion); |
| 1095 | dest.writeBoolean(this.allowClearUserDataOnFailedRestore); |
| 1096 | dest.writeBoolean(this.allowAudioPlaybackCapture); |
| 1097 | dest.writeBoolean(this.requestLegacyExternalStorage); |
| 1098 | dest.writeBoolean(this.usesNonSdkApi); |
| 1099 | dest.writeBoolean(this.hasFragileUserData); |
| 1100 | dest.writeBoolean(this.cantSaveState); |
| 1101 | dest.writeBoolean(this.allowNativeHeapPointerTagging); |
Eugene Susla | 49b84c3 | 2020-03-23 15:19:29 -0700 | [diff] [blame] | 1102 | dest.writeInt(this.autoRevokePermissions); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1103 | dest.writeBoolean(this.preserveLegacyExternalStorage); |
| 1104 | dest.writeArraySet(this.mimeGroups); |
Evgenii Stepanov | d43d109 | 2020-03-16 13:55:42 -0700 | [diff] [blame] | 1105 | dest.writeInt(this.gwpAsanMode); |
Oli Lan | 72ae447 | 2020-04-14 16:50:41 +0100 | [diff] [blame] | 1106 | dest.writeSparseIntArray(this.minExtensionVersions); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1107 | } |
| 1108 | |
| 1109 | public ParsingPackageImpl(Parcel in) { |
| 1110 | // We use the boot classloader for all classes that we load. |
| 1111 | final ClassLoader boot = Object.class.getClassLoader(); |
| 1112 | this.supportsSmallScreens = sForBoolean.unparcel(in); |
| 1113 | this.supportsNormalScreens = sForBoolean.unparcel(in); |
| 1114 | this.supportsLargeScreens = sForBoolean.unparcel(in); |
| 1115 | this.supportsExtraLargeScreens = sForBoolean.unparcel(in); |
| 1116 | this.resizeable = sForBoolean.unparcel(in); |
| 1117 | this.anyDensity = sForBoolean.unparcel(in); |
| 1118 | this.versionCode = in.readInt(); |
| 1119 | this.versionCodeMajor = in.readInt(); |
| 1120 | this.baseRevisionCode = in.readInt(); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1121 | this.versionName = sForInternedString.unparcel(in); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1122 | this.compileSdkVersion = in.readInt(); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1123 | this.compileSdkVersionCodeName = in.readString(); |
| 1124 | this.packageName = sForInternedString.unparcel(in); |
| 1125 | this.realPackage = in.readString(); |
| 1126 | this.baseCodePath = in.readString(); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1127 | this.requiredForAllUsers = in.readBoolean(); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1128 | this.restrictedAccountType = in.readString(); |
| 1129 | this.requiredAccountType = in.readString(); |
| 1130 | this.overlayTarget = sForInternedString.unparcel(in); |
| 1131 | this.overlayTargetName = in.readString(); |
| 1132 | this.overlayCategory = in.readString(); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1133 | this.overlayPriority = in.readInt(); |
| 1134 | this.overlayIsStatic = in.readBoolean(); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1135 | this.overlayables = sForInternedStringValueMap.unparcel(in); |
| 1136 | this.staticSharedLibName = sForInternedString.unparcel(in); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1137 | this.staticSharedLibVersion = in.readLong(); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1138 | this.libraryNames = sForInternedStringList.unparcel(in); |
| 1139 | this.usesLibraries = sForInternedStringList.unparcel(in); |
| 1140 | this.usesOptionalLibraries = sForInternedStringList.unparcel(in); |
| 1141 | this.usesStaticLibraries = sForInternedStringList.unparcel(in); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1142 | this.usesStaticLibrariesVersions = in.createLongArray(); |
| 1143 | |
| 1144 | int digestsSize = in.readInt(); |
| 1145 | if (digestsSize >= 0) { |
| 1146 | this.usesStaticLibrariesCertDigests = new String[digestsSize][]; |
| 1147 | for (int index = 0; index < digestsSize; index++) { |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1148 | this.usesStaticLibrariesCertDigests[index] = sForInternedStringArray.unparcel(in); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1149 | } |
| 1150 | } |
| 1151 | |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1152 | this.sharedUserId = sForInternedString.unparcel(in); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1153 | this.sharedUserLabel = in.readInt(); |
| 1154 | this.configPreferences = in.createTypedArrayList(ConfigurationInfo.CREATOR); |
| 1155 | this.reqFeatures = in.createTypedArrayList(FeatureInfo.CREATOR); |
| 1156 | this.featureGroups = in.createTypedArrayList(FeatureGroupInfo.CREATOR); |
| 1157 | this.restrictUpdateHash = in.createByteArray(); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1158 | this.originalPackages = in.createStringArrayList(); |
| 1159 | this.adoptPermissions = sForInternedStringList.unparcel(in); |
| 1160 | this.requestedPermissions = sForInternedStringList.unparcel(in); |
| 1161 | this.implicitPermissions = sForInternedStringList.unparcel(in); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1162 | this.upgradeKeySets = sForStringSet.unparcel(in); |
| 1163 | this.keySetMapping = in.readHashMap(boot); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1164 | this.protectedBroadcasts = sForInternedStringList.unparcel(in); |
| 1165 | |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1166 | this.activities = in.createTypedArrayList(ParsedActivity.CREATOR); |
| 1167 | this.receivers = in.createTypedArrayList(ParsedActivity.CREATOR); |
| 1168 | this.services = in.createTypedArrayList(ParsedService.CREATOR); |
| 1169 | this.providers = in.createTypedArrayList(ParsedProvider.CREATOR); |
Philip P. Moltmann | 12ac3f4 | 2020-03-05 15:01:29 -0800 | [diff] [blame] | 1170 | this.attributions = in.createTypedArrayList(ParsedAttribution.CREATOR); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1171 | this.permissions = in.createTypedArrayList(ParsedPermission.CREATOR); |
| 1172 | this.permissionGroups = in.createTypedArrayList(ParsedPermissionGroup.CREATOR); |
| 1173 | this.instrumentations = in.createTypedArrayList(ParsedInstrumentation.CREATOR); |
Winson | f00c755 | 2020-01-28 12:52:01 -0800 | [diff] [blame] | 1174 | this.preferredActivityFilters = sForIntentInfoPairs.unparcel(in); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1175 | this.processes = in.readHashMap(boot); |
| 1176 | this.metaData = in.readBundle(boot); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1177 | this.volumeUuid = sForInternedString.unparcel(in); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1178 | this.signingDetails = in.readParcelable(boot); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1179 | this.codePath = in.readString(); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1180 | this.use32BitAbi = in.readBoolean(); |
| 1181 | this.visibleToInstantApps = in.readBoolean(); |
| 1182 | this.forceQueryable = in.readBoolean(); |
| 1183 | this.queriesIntents = in.createTypedArrayList(Intent.CREATOR); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1184 | this.queriesPackages = sForInternedStringList.unparcel(in); |
| 1185 | this.appComponentFactory = in.readString(); |
| 1186 | this.backupAgentName = in.readString(); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1187 | this.banner = in.readInt(); |
| 1188 | this.category = in.readInt(); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1189 | this.classLoaderName = in.readString(); |
| 1190 | this.className = in.readString(); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1191 | this.compatibleWidthLimitDp = in.readInt(); |
| 1192 | this.descriptionRes = in.readInt(); |
| 1193 | this.enabled = in.readBoolean(); |
| 1194 | this.crossProfile = in.readBoolean(); |
| 1195 | this.fullBackupContent = in.readInt(); |
| 1196 | this.iconRes = in.readInt(); |
| 1197 | this.installLocation = in.readInt(); |
| 1198 | this.labelRes = in.readInt(); |
| 1199 | this.largestWidthLimitDp = in.readInt(); |
| 1200 | this.logo = in.readInt(); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1201 | this.manageSpaceActivityName = in.readString(); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1202 | this.maxAspectRatio = in.readFloat(); |
| 1203 | this.minAspectRatio = in.readFloat(); |
| 1204 | this.minSdkVersion = in.readInt(); |
| 1205 | this.networkSecurityConfigRes = in.readInt(); |
| 1206 | this.nonLocalizedLabel = in.readCharSequence(); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1207 | this.permission = in.readString(); |
| 1208 | this.processName = in.readString(); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1209 | this.requiresSmallestWidthDp = in.readInt(); |
| 1210 | this.roundIconRes = in.readInt(); |
| 1211 | this.targetSandboxVersion = in.readInt(); |
| 1212 | this.targetSdkVersion = in.readInt(); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1213 | this.taskAffinity = in.readString(); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1214 | this.theme = in.readInt(); |
| 1215 | this.uiOptions = in.readInt(); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1216 | this.zygotePreloadName = in.readString(); |
| 1217 | this.splitClassLoaderNames = in.createStringArray(); |
| 1218 | this.splitCodePaths = in.createStringArray(); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1219 | this.splitDependencies = in.readSparseArray(boot); |
| 1220 | this.splitFlags = in.createIntArray(); |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 1221 | this.splitNames = in.createStringArray(); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1222 | this.splitRevisionCodes = in.createIntArray(); |
| 1223 | this.externalStorage = in.readBoolean(); |
| 1224 | this.baseHardwareAccelerated = in.readBoolean(); |
| 1225 | this.allowBackup = in.readBoolean(); |
| 1226 | this.killAfterRestore = in.readBoolean(); |
| 1227 | this.restoreAnyVersion = in.readBoolean(); |
| 1228 | this.fullBackupOnly = in.readBoolean(); |
| 1229 | this.persistent = in.readBoolean(); |
| 1230 | this.debuggable = in.readBoolean(); |
| 1231 | this.vmSafeMode = in.readBoolean(); |
| 1232 | this.hasCode = in.readBoolean(); |
| 1233 | this.allowTaskReparenting = in.readBoolean(); |
| 1234 | this.allowClearUserData = in.readBoolean(); |
| 1235 | this.largeHeap = in.readBoolean(); |
| 1236 | this.usesCleartextTraffic = in.readBoolean(); |
| 1237 | this.supportsRtl = in.readBoolean(); |
| 1238 | this.testOnly = in.readBoolean(); |
| 1239 | this.multiArch = in.readBoolean(); |
| 1240 | this.extractNativeLibs = in.readBoolean(); |
| 1241 | this.game = in.readBoolean(); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1242 | this.resizeableActivity = sForBoolean.unparcel(in); |
| 1243 | |
| 1244 | this.staticSharedLibrary = in.readBoolean(); |
| 1245 | this.overlay = in.readBoolean(); |
| 1246 | this.isolatedSplitLoading = in.readBoolean(); |
| 1247 | this.hasDomainUrls = in.readBoolean(); |
| 1248 | this.profileableByShell = in.readBoolean(); |
| 1249 | this.backupInForeground = in.readBoolean(); |
| 1250 | this.useEmbeddedDex = in.readBoolean(); |
| 1251 | this.defaultToDeviceProtectedStorage = in.readBoolean(); |
| 1252 | this.directBootAware = in.readBoolean(); |
| 1253 | this.partiallyDirectBootAware = in.readBoolean(); |
| 1254 | this.resizeableActivityViaSdkVersion = in.readBoolean(); |
| 1255 | this.allowClearUserDataOnFailedRestore = in.readBoolean(); |
| 1256 | this.allowAudioPlaybackCapture = in.readBoolean(); |
| 1257 | this.requestLegacyExternalStorage = in.readBoolean(); |
| 1258 | this.usesNonSdkApi = in.readBoolean(); |
| 1259 | this.hasFragileUserData = in.readBoolean(); |
| 1260 | this.cantSaveState = in.readBoolean(); |
| 1261 | this.allowNativeHeapPointerTagging = in.readBoolean(); |
Eugene Susla | 49b84c3 | 2020-03-23 15:19:29 -0700 | [diff] [blame] | 1262 | this.autoRevokePermissions = in.readInt(); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1263 | this.preserveLegacyExternalStorage = in.readBoolean(); |
| 1264 | this.mimeGroups = (ArraySet<String>) in.readArraySet(boot); |
Evgenii Stepanov | d43d109 | 2020-03-16 13:55:42 -0700 | [diff] [blame] | 1265 | this.gwpAsanMode = in.readInt(); |
Oli Lan | 72ae447 | 2020-04-14 16:50:41 +0100 | [diff] [blame] | 1266 | this.minExtensionVersions = in.readSparseIntArray(); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1267 | } |
| 1268 | |
| 1269 | public static final Parcelable.Creator<ParsingPackageImpl> CREATOR = |
| 1270 | new Parcelable.Creator<ParsingPackageImpl>() { |
| 1271 | @Override |
| 1272 | public ParsingPackageImpl createFromParcel(Parcel source) { |
| 1273 | return new ParsingPackageImpl(source); |
| 1274 | } |
| 1275 | |
| 1276 | @Override |
| 1277 | public ParsingPackageImpl[] newArray(int size) { |
| 1278 | return new ParsingPackageImpl[size]; |
| 1279 | } |
| 1280 | }; |
| 1281 | |
| 1282 | @Override |
| 1283 | public int getVersionCode() { |
| 1284 | return versionCode; |
| 1285 | } |
| 1286 | |
| 1287 | @Override |
| 1288 | public int getVersionCodeMajor() { |
| 1289 | return versionCodeMajor; |
| 1290 | } |
| 1291 | |
| 1292 | @Override |
| 1293 | public int getBaseRevisionCode() { |
| 1294 | return baseRevisionCode; |
| 1295 | } |
| 1296 | |
| 1297 | @Nullable |
| 1298 | @Override |
| 1299 | public String getVersionName() { |
| 1300 | return versionName; |
| 1301 | } |
| 1302 | |
| 1303 | @Override |
| 1304 | public int getCompileSdkVersion() { |
| 1305 | return compileSdkVersion; |
| 1306 | } |
| 1307 | |
| 1308 | @Nullable |
| 1309 | @Override |
| 1310 | public String getCompileSdkVersionCodeName() { |
| 1311 | return compileSdkVersionCodeName; |
| 1312 | } |
| 1313 | |
| 1314 | @NonNull |
| 1315 | @Override |
| 1316 | public String getPackageName() { |
| 1317 | return packageName; |
| 1318 | } |
| 1319 | |
| 1320 | @Nullable |
| 1321 | @Override |
| 1322 | public String getRealPackage() { |
| 1323 | return realPackage; |
| 1324 | } |
| 1325 | |
| 1326 | @NonNull |
| 1327 | @Override |
| 1328 | public String getBaseCodePath() { |
| 1329 | return baseCodePath; |
| 1330 | } |
| 1331 | |
| 1332 | @Override |
| 1333 | public boolean isRequiredForAllUsers() { |
| 1334 | return requiredForAllUsers; |
| 1335 | } |
| 1336 | |
| 1337 | @Nullable |
| 1338 | @Override |
| 1339 | public String getRestrictedAccountType() { |
| 1340 | return restrictedAccountType; |
| 1341 | } |
| 1342 | |
| 1343 | @Nullable |
| 1344 | @Override |
| 1345 | public String getRequiredAccountType() { |
| 1346 | return requiredAccountType; |
| 1347 | } |
| 1348 | |
| 1349 | @Nullable |
| 1350 | @Override |
| 1351 | public String getOverlayTarget() { |
| 1352 | return overlayTarget; |
| 1353 | } |
| 1354 | |
| 1355 | @Nullable |
| 1356 | @Override |
| 1357 | public String getOverlayTargetName() { |
| 1358 | return overlayTargetName; |
| 1359 | } |
| 1360 | |
| 1361 | @Nullable |
| 1362 | @Override |
| 1363 | public String getOverlayCategory() { |
| 1364 | return overlayCategory; |
| 1365 | } |
| 1366 | |
| 1367 | @Override |
| 1368 | public int getOverlayPriority() { |
| 1369 | return overlayPriority; |
| 1370 | } |
| 1371 | |
| 1372 | @Override |
| 1373 | public boolean isOverlayIsStatic() { |
| 1374 | return overlayIsStatic; |
| 1375 | } |
| 1376 | |
| 1377 | @NonNull |
| 1378 | @Override |
| 1379 | public Map<String,String> getOverlayables() { |
| 1380 | return overlayables; |
| 1381 | } |
| 1382 | |
| 1383 | @Nullable |
| 1384 | @Override |
| 1385 | public String getStaticSharedLibName() { |
| 1386 | return staticSharedLibName; |
| 1387 | } |
| 1388 | |
| 1389 | @Override |
| 1390 | public long getStaticSharedLibVersion() { |
| 1391 | return staticSharedLibVersion; |
| 1392 | } |
| 1393 | |
| 1394 | @NonNull |
| 1395 | @Override |
| 1396 | public List<String> getLibraryNames() { |
| 1397 | return libraryNames; |
| 1398 | } |
| 1399 | |
| 1400 | @NonNull |
| 1401 | @Override |
| 1402 | public List<String> getUsesLibraries() { |
| 1403 | return usesLibraries; |
| 1404 | } |
| 1405 | |
| 1406 | @NonNull |
| 1407 | @Override |
| 1408 | public List<String> getUsesOptionalLibraries() { |
| 1409 | return usesOptionalLibraries; |
| 1410 | } |
| 1411 | |
| 1412 | @NonNull |
| 1413 | @Override |
| 1414 | public List<String> getUsesStaticLibraries() { |
| 1415 | return usesStaticLibraries; |
| 1416 | } |
| 1417 | |
| 1418 | @Nullable |
| 1419 | @Override |
| 1420 | public long[] getUsesStaticLibrariesVersions() { |
| 1421 | return usesStaticLibrariesVersions; |
| 1422 | } |
| 1423 | |
| 1424 | @Nullable |
| 1425 | @Override |
| 1426 | public String[][] getUsesStaticLibrariesCertDigests() { |
| 1427 | return usesStaticLibrariesCertDigests; |
| 1428 | } |
| 1429 | |
| 1430 | @Nullable |
| 1431 | @Override |
| 1432 | public String getSharedUserId() { |
| 1433 | return sharedUserId; |
| 1434 | } |
| 1435 | |
| 1436 | @Override |
| 1437 | public int getSharedUserLabel() { |
| 1438 | return sharedUserLabel; |
| 1439 | } |
| 1440 | |
| 1441 | @NonNull |
| 1442 | @Override |
| 1443 | public List<ConfigurationInfo> getConfigPreferences() { |
| 1444 | return configPreferences; |
| 1445 | } |
| 1446 | |
| 1447 | @NonNull |
| 1448 | @Override |
| 1449 | public List<FeatureInfo> getReqFeatures() { |
| 1450 | return reqFeatures; |
| 1451 | } |
| 1452 | |
| 1453 | @NonNull |
| 1454 | @Override |
| 1455 | public List<FeatureGroupInfo> getFeatureGroups() { |
| 1456 | return featureGroups; |
| 1457 | } |
| 1458 | |
| 1459 | @Nullable |
| 1460 | @Override |
| 1461 | public byte[] getRestrictUpdateHash() { |
| 1462 | return restrictUpdateHash; |
| 1463 | } |
| 1464 | |
| 1465 | @NonNull |
| 1466 | @Override |
| 1467 | public List<String> getOriginalPackages() { |
| 1468 | return originalPackages; |
| 1469 | } |
| 1470 | |
| 1471 | @NonNull |
| 1472 | @Override |
| 1473 | public List<String> getAdoptPermissions() { |
| 1474 | return adoptPermissions; |
| 1475 | } |
| 1476 | |
| 1477 | @NonNull |
| 1478 | @Override |
| 1479 | public List<String> getRequestedPermissions() { |
| 1480 | return requestedPermissions; |
| 1481 | } |
| 1482 | |
| 1483 | @NonNull |
| 1484 | @Override |
| 1485 | public List<String> getImplicitPermissions() { |
| 1486 | return implicitPermissions; |
| 1487 | } |
| 1488 | |
| 1489 | @NonNull |
| 1490 | @Override |
| 1491 | public Set<String> getUpgradeKeySets() { |
| 1492 | return upgradeKeySets; |
| 1493 | } |
| 1494 | |
| 1495 | @NonNull |
| 1496 | @Override |
| 1497 | public Map<String,ArraySet<PublicKey>> getKeySetMapping() { |
| 1498 | return keySetMapping; |
| 1499 | } |
| 1500 | |
| 1501 | @NonNull |
| 1502 | @Override |
| 1503 | public List<String> getProtectedBroadcasts() { |
| 1504 | return protectedBroadcasts; |
| 1505 | } |
| 1506 | |
| 1507 | @NonNull |
| 1508 | @Override |
| 1509 | public List<ParsedActivity> getActivities() { |
| 1510 | return activities; |
| 1511 | } |
| 1512 | |
| 1513 | @NonNull |
| 1514 | @Override |
| 1515 | public List<ParsedActivity> getReceivers() { |
| 1516 | return receivers; |
| 1517 | } |
| 1518 | |
| 1519 | @NonNull |
| 1520 | @Override |
| 1521 | public List<ParsedService> getServices() { |
| 1522 | return services; |
| 1523 | } |
| 1524 | |
| 1525 | @NonNull |
| 1526 | @Override |
| 1527 | public List<ParsedProvider> getProviders() { |
| 1528 | return providers; |
| 1529 | } |
| 1530 | |
| 1531 | @NonNull |
| 1532 | @Override |
Philip P. Moltmann | 12ac3f4 | 2020-03-05 15:01:29 -0800 | [diff] [blame] | 1533 | public List<ParsedAttribution> getAttributions() { |
| 1534 | return attributions; |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1535 | } |
| 1536 | |
| 1537 | @NonNull |
| 1538 | @Override |
| 1539 | public List<ParsedPermission> getPermissions() { |
| 1540 | return permissions; |
| 1541 | } |
| 1542 | |
| 1543 | @NonNull |
| 1544 | @Override |
| 1545 | public List<ParsedPermissionGroup> getPermissionGroups() { |
| 1546 | return permissionGroups; |
| 1547 | } |
| 1548 | |
| 1549 | @NonNull |
| 1550 | @Override |
| 1551 | public List<ParsedInstrumentation> getInstrumentations() { |
| 1552 | return instrumentations; |
| 1553 | } |
| 1554 | |
| 1555 | @NonNull |
| 1556 | @Override |
Winson | f00c755 | 2020-01-28 12:52:01 -0800 | [diff] [blame] | 1557 | public List<Pair<String,ParsedIntentInfo>> getPreferredActivityFilters() { |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1558 | return preferredActivityFilters; |
| 1559 | } |
| 1560 | |
| 1561 | @NonNull |
| 1562 | @Override |
| 1563 | public Map<String,ParsedProcess> getProcesses() { |
| 1564 | return processes; |
| 1565 | } |
| 1566 | |
| 1567 | @Nullable |
| 1568 | @Override |
| 1569 | public Bundle getMetaData() { |
| 1570 | return metaData; |
| 1571 | } |
| 1572 | |
Winson | f00c755 | 2020-01-28 12:52:01 -0800 | [diff] [blame] | 1573 | private void addMimeGroupsFromComponent(ParsedComponent component) { |
| 1574 | for (int i = component.getIntents().size() - 1; i >= 0; i--) { |
| 1575 | IntentFilter filter = component.getIntents().get(i); |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1576 | for (int groupIndex = filter.countMimeGroups() - 1; groupIndex >= 0; groupIndex--) { |
| 1577 | mimeGroups = ArrayUtils.add(mimeGroups, filter.getMimeGroup(groupIndex)); |
| 1578 | } |
| 1579 | } |
| 1580 | } |
| 1581 | |
| 1582 | @Override |
| 1583 | @Nullable |
| 1584 | public Set<String> getMimeGroups() { |
| 1585 | return mimeGroups; |
| 1586 | } |
| 1587 | |
| 1588 | @Nullable |
| 1589 | @Override |
| 1590 | public String getVolumeUuid() { |
| 1591 | return volumeUuid; |
| 1592 | } |
| 1593 | |
| 1594 | @Nullable |
| 1595 | @Override |
| 1596 | public PackageParser.SigningDetails getSigningDetails() { |
| 1597 | return signingDetails; |
| 1598 | } |
| 1599 | |
| 1600 | @NonNull |
| 1601 | @Override |
| 1602 | public String getCodePath() { |
| 1603 | return codePath; |
| 1604 | } |
| 1605 | |
| 1606 | @Override |
| 1607 | public boolean isUse32BitAbi() { |
| 1608 | return use32BitAbi; |
| 1609 | } |
| 1610 | |
| 1611 | @Override |
| 1612 | public boolean isVisibleToInstantApps() { |
| 1613 | return visibleToInstantApps; |
| 1614 | } |
| 1615 | |
| 1616 | @Override |
| 1617 | public boolean isForceQueryable() { |
| 1618 | return forceQueryable; |
| 1619 | } |
| 1620 | |
| 1621 | @NonNull |
| 1622 | @Override |
| 1623 | public List<Intent> getQueriesIntents() { |
| 1624 | return queriesIntents; |
| 1625 | } |
| 1626 | |
| 1627 | @NonNull |
| 1628 | @Override |
| 1629 | public List<String> getQueriesPackages() { |
| 1630 | return queriesPackages; |
| 1631 | } |
| 1632 | |
| 1633 | @NonNull |
| 1634 | @Override |
| 1635 | public Set<String> getQueriesProviders() { |
| 1636 | return queriesProviders; |
| 1637 | } |
| 1638 | |
| 1639 | @Nullable |
| 1640 | @Override |
| 1641 | public String[] getSplitClassLoaderNames() { |
| 1642 | return splitClassLoaderNames; |
| 1643 | } |
| 1644 | |
| 1645 | @Nullable |
| 1646 | @Override |
| 1647 | public String[] getSplitCodePaths() { |
| 1648 | return splitCodePaths; |
| 1649 | } |
| 1650 | |
| 1651 | @Nullable |
| 1652 | @Override |
| 1653 | public SparseArray<int[]> getSplitDependencies() { |
| 1654 | return splitDependencies; |
| 1655 | } |
| 1656 | |
| 1657 | @Nullable |
| 1658 | @Override |
| 1659 | public int[] getSplitFlags() { |
| 1660 | return splitFlags; |
| 1661 | } |
| 1662 | |
| 1663 | @Nullable |
| 1664 | @Override |
| 1665 | public String[] getSplitNames() { |
| 1666 | return splitNames; |
| 1667 | } |
| 1668 | |
| 1669 | @Nullable |
| 1670 | @Override |
| 1671 | public int[] getSplitRevisionCodes() { |
| 1672 | return splitRevisionCodes; |
| 1673 | } |
| 1674 | |
| 1675 | @Nullable |
| 1676 | @Override |
| 1677 | public String getAppComponentFactory() { |
| 1678 | return appComponentFactory; |
| 1679 | } |
| 1680 | |
| 1681 | @Nullable |
| 1682 | @Override |
| 1683 | public String getBackupAgentName() { |
| 1684 | return backupAgentName; |
| 1685 | } |
| 1686 | |
| 1687 | @Override |
| 1688 | public int getBanner() { |
| 1689 | return banner; |
| 1690 | } |
| 1691 | |
| 1692 | @Override |
| 1693 | public int getCategory() { |
| 1694 | return category; |
| 1695 | } |
| 1696 | |
| 1697 | @Nullable |
| 1698 | @Override |
| 1699 | public String getClassLoaderName() { |
| 1700 | return classLoaderName; |
| 1701 | } |
| 1702 | |
| 1703 | @Nullable |
| 1704 | @Override |
| 1705 | public String getClassName() { |
| 1706 | return className; |
| 1707 | } |
| 1708 | |
| 1709 | @Override |
| 1710 | public int getCompatibleWidthLimitDp() { |
| 1711 | return compatibleWidthLimitDp; |
| 1712 | } |
| 1713 | |
| 1714 | @Override |
| 1715 | public int getDescriptionRes() { |
| 1716 | return descriptionRes; |
| 1717 | } |
| 1718 | |
| 1719 | @Override |
| 1720 | public boolean isEnabled() { |
| 1721 | return enabled; |
| 1722 | } |
| 1723 | |
| 1724 | @Override |
| 1725 | public boolean isCrossProfile() { |
| 1726 | return crossProfile; |
| 1727 | } |
| 1728 | |
| 1729 | @Override |
| 1730 | public int getFullBackupContent() { |
| 1731 | return fullBackupContent; |
| 1732 | } |
| 1733 | |
| 1734 | @Override |
| 1735 | public int getIconRes() { |
| 1736 | return iconRes; |
| 1737 | } |
| 1738 | |
| 1739 | @Override |
| 1740 | public int getInstallLocation() { |
| 1741 | return installLocation; |
| 1742 | } |
| 1743 | |
| 1744 | @Override |
| 1745 | public int getLabelRes() { |
| 1746 | return labelRes; |
| 1747 | } |
| 1748 | |
| 1749 | @Override |
| 1750 | public int getLargestWidthLimitDp() { |
| 1751 | return largestWidthLimitDp; |
| 1752 | } |
| 1753 | |
| 1754 | @Override |
| 1755 | public int getLogo() { |
| 1756 | return logo; |
| 1757 | } |
| 1758 | |
| 1759 | @Nullable |
| 1760 | @Override |
| 1761 | public String getManageSpaceActivityName() { |
| 1762 | return manageSpaceActivityName; |
| 1763 | } |
| 1764 | |
| 1765 | @Override |
| 1766 | public float getMaxAspectRatio() { |
| 1767 | return maxAspectRatio; |
| 1768 | } |
| 1769 | |
| 1770 | @Override |
| 1771 | public float getMinAspectRatio() { |
| 1772 | return minAspectRatio; |
| 1773 | } |
| 1774 | |
Oli Lan | 72ae447 | 2020-04-14 16:50:41 +0100 | [diff] [blame] | 1775 | @Nullable |
| 1776 | @Override |
| 1777 | public SparseIntArray getMinExtensionVersions() { |
| 1778 | return minExtensionVersions; |
| 1779 | } |
| 1780 | |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 1781 | @Override |
| 1782 | public int getMinSdkVersion() { |
| 1783 | return minSdkVersion; |
| 1784 | } |
| 1785 | |
| 1786 | @Override |
| 1787 | public int getNetworkSecurityConfigRes() { |
| 1788 | return networkSecurityConfigRes; |
| 1789 | } |
| 1790 | |
| 1791 | @Nullable |
| 1792 | @Override |
| 1793 | public CharSequence getNonLocalizedLabel() { |
| 1794 | return nonLocalizedLabel; |
| 1795 | } |
| 1796 | |
| 1797 | @Nullable |
| 1798 | @Override |
| 1799 | public String getPermission() { |
| 1800 | return permission; |
| 1801 | } |
| 1802 | |
| 1803 | @Override |
| 1804 | public int getRequiresSmallestWidthDp() { |
| 1805 | return requiresSmallestWidthDp; |
| 1806 | } |
| 1807 | |
| 1808 | @Override |
| 1809 | public int getRoundIconRes() { |
| 1810 | return roundIconRes; |
| 1811 | } |
| 1812 | |
| 1813 | @Override |
| 1814 | public int getTargetSandboxVersion() { |
| 1815 | return targetSandboxVersion; |
| 1816 | } |
| 1817 | |
| 1818 | @Override |
| 1819 | public int getTargetSdkVersion() { |
| 1820 | return targetSdkVersion; |
| 1821 | } |
| 1822 | |
| 1823 | @Nullable |
| 1824 | @Override |
| 1825 | public String getTaskAffinity() { |
| 1826 | return taskAffinity; |
| 1827 | } |
| 1828 | |
| 1829 | @Override |
| 1830 | public int getTheme() { |
| 1831 | return theme; |
| 1832 | } |
| 1833 | |
| 1834 | @Override |
| 1835 | public int getUiOptions() { |
| 1836 | return uiOptions; |
| 1837 | } |
| 1838 | |
| 1839 | @Nullable |
| 1840 | @Override |
| 1841 | public String getZygotePreloadName() { |
| 1842 | return zygotePreloadName; |
| 1843 | } |
| 1844 | |
| 1845 | @Override |
| 1846 | public boolean isExternalStorage() { |
| 1847 | return externalStorage; |
| 1848 | } |
| 1849 | |
| 1850 | @Override |
| 1851 | public boolean isBaseHardwareAccelerated() { |
| 1852 | return baseHardwareAccelerated; |
| 1853 | } |
| 1854 | |
| 1855 | @Override |
| 1856 | public boolean isAllowBackup() { |
| 1857 | return allowBackup; |
| 1858 | } |
| 1859 | |
| 1860 | @Override |
| 1861 | public boolean isKillAfterRestore() { |
| 1862 | return killAfterRestore; |
| 1863 | } |
| 1864 | |
| 1865 | @Override |
| 1866 | public boolean isRestoreAnyVersion() { |
| 1867 | return restoreAnyVersion; |
| 1868 | } |
| 1869 | |
| 1870 | @Override |
| 1871 | public boolean isFullBackupOnly() { |
| 1872 | return fullBackupOnly; |
| 1873 | } |
| 1874 | |
| 1875 | @Override |
| 1876 | public boolean isPersistent() { |
| 1877 | return persistent; |
| 1878 | } |
| 1879 | |
| 1880 | @Override |
| 1881 | public boolean isDebuggable() { |
| 1882 | return debuggable; |
| 1883 | } |
| 1884 | |
| 1885 | @Override |
| 1886 | public boolean isVmSafeMode() { |
| 1887 | return vmSafeMode; |
| 1888 | } |
| 1889 | |
| 1890 | @Override |
| 1891 | public boolean isHasCode() { |
| 1892 | return hasCode; |
| 1893 | } |
| 1894 | |
| 1895 | @Override |
| 1896 | public boolean isAllowTaskReparenting() { |
| 1897 | return allowTaskReparenting; |
| 1898 | } |
| 1899 | |
| 1900 | @Override |
| 1901 | public boolean isAllowClearUserData() { |
| 1902 | return allowClearUserData; |
| 1903 | } |
| 1904 | |
| 1905 | @Override |
| 1906 | public boolean isLargeHeap() { |
| 1907 | return largeHeap; |
| 1908 | } |
| 1909 | |
| 1910 | @Override |
| 1911 | public boolean isUsesCleartextTraffic() { |
| 1912 | return usesCleartextTraffic; |
| 1913 | } |
| 1914 | |
| 1915 | @Override |
| 1916 | public boolean isSupportsRtl() { |
| 1917 | return supportsRtl; |
| 1918 | } |
| 1919 | |
| 1920 | @Override |
| 1921 | public boolean isTestOnly() { |
| 1922 | return testOnly; |
| 1923 | } |
| 1924 | |
| 1925 | @Override |
| 1926 | public boolean isMultiArch() { |
| 1927 | return multiArch; |
| 1928 | } |
| 1929 | |
| 1930 | @Override |
| 1931 | public boolean isExtractNativeLibs() { |
| 1932 | return extractNativeLibs; |
| 1933 | } |
| 1934 | |
| 1935 | @Override |
| 1936 | public boolean isGame() { |
| 1937 | return game; |
| 1938 | } |
| 1939 | |
| 1940 | /** |
| 1941 | * @see ParsingPackageRead#getResizeableActivity() |
| 1942 | */ |
| 1943 | @Nullable |
| 1944 | @Override |
| 1945 | public Boolean getResizeableActivity() { |
| 1946 | return resizeableActivity; |
| 1947 | } |
| 1948 | |
| 1949 | @Override |
| 1950 | public boolean isStaticSharedLibrary() { |
| 1951 | return staticSharedLibrary; |
| 1952 | } |
| 1953 | |
| 1954 | @Override |
| 1955 | public boolean isOverlay() { |
| 1956 | return overlay; |
| 1957 | } |
| 1958 | |
| 1959 | @Override |
| 1960 | public boolean isIsolatedSplitLoading() { |
| 1961 | return isolatedSplitLoading; |
| 1962 | } |
| 1963 | |
| 1964 | @Override |
| 1965 | public boolean isHasDomainUrls() { |
| 1966 | return hasDomainUrls; |
| 1967 | } |
| 1968 | |
| 1969 | @Override |
| 1970 | public boolean isProfileableByShell() { |
| 1971 | return profileableByShell; |
| 1972 | } |
| 1973 | |
| 1974 | @Override |
| 1975 | public boolean isBackupInForeground() { |
| 1976 | return backupInForeground; |
| 1977 | } |
| 1978 | |
| 1979 | @Override |
| 1980 | public boolean isUseEmbeddedDex() { |
| 1981 | return useEmbeddedDex; |
| 1982 | } |
| 1983 | |
| 1984 | @Override |
| 1985 | public boolean isDefaultToDeviceProtectedStorage() { |
| 1986 | return defaultToDeviceProtectedStorage; |
| 1987 | } |
| 1988 | |
| 1989 | @Override |
| 1990 | public boolean isDirectBootAware() { |
| 1991 | return directBootAware; |
| 1992 | } |
| 1993 | |
| 1994 | @Override |
Evgenii Stepanov | d43d109 | 2020-03-16 13:55:42 -0700 | [diff] [blame] | 1995 | public int getGwpAsanMode() { |
| 1996 | return gwpAsanMode; |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 1997 | } |
| 1998 | |
| 1999 | @Override |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 2000 | public boolean isPartiallyDirectBootAware() { |
| 2001 | return partiallyDirectBootAware; |
| 2002 | } |
| 2003 | |
| 2004 | @Override |
| 2005 | public boolean isResizeableActivityViaSdkVersion() { |
| 2006 | return resizeableActivityViaSdkVersion; |
| 2007 | } |
| 2008 | |
| 2009 | @Override |
| 2010 | public boolean isAllowClearUserDataOnFailedRestore() { |
| 2011 | return allowClearUserDataOnFailedRestore; |
| 2012 | } |
| 2013 | |
| 2014 | @Override |
| 2015 | public boolean isAllowAudioPlaybackCapture() { |
| 2016 | return allowAudioPlaybackCapture; |
| 2017 | } |
| 2018 | |
| 2019 | @Override |
| 2020 | public boolean isRequestLegacyExternalStorage() { |
| 2021 | return requestLegacyExternalStorage; |
| 2022 | } |
| 2023 | |
| 2024 | @Override |
| 2025 | public boolean isUsesNonSdkApi() { |
| 2026 | return usesNonSdkApi; |
| 2027 | } |
| 2028 | |
| 2029 | @Override |
| 2030 | public boolean isHasFragileUserData() { |
| 2031 | return hasFragileUserData; |
| 2032 | } |
| 2033 | |
| 2034 | @Override |
| 2035 | public boolean isCantSaveState() { |
| 2036 | return cantSaveState; |
| 2037 | } |
| 2038 | |
| 2039 | @Override |
| 2040 | public boolean isAllowNativeHeapPointerTagging() { |
| 2041 | return allowNativeHeapPointerTagging; |
| 2042 | } |
| 2043 | |
| 2044 | @Override |
Eugene Susla | 49b84c3 | 2020-03-23 15:19:29 -0700 | [diff] [blame] | 2045 | public int getAutoRevokePermissions() { |
| 2046 | return autoRevokePermissions; |
Eugene Susla | db77bc1 | 2020-03-03 12:09:00 -0800 | [diff] [blame] | 2047 | } |
| 2048 | |
| 2049 | @Override |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 2050 | public boolean hasPreserveLegacyExternalStorage() { |
| 2051 | return preserveLegacyExternalStorage; |
| 2052 | } |
| 2053 | |
| 2054 | @Override |
| 2055 | public ParsingPackageImpl setBaseRevisionCode(int value) { |
| 2056 | baseRevisionCode = value; |
| 2057 | return this; |
| 2058 | } |
| 2059 | |
| 2060 | @Override |
| 2061 | public ParsingPackageImpl setCompileSdkVersion(int value) { |
| 2062 | compileSdkVersion = value; |
| 2063 | return this; |
| 2064 | } |
| 2065 | |
| 2066 | @Override |
| 2067 | public ParsingPackageImpl setRequiredForAllUsers(boolean value) { |
| 2068 | requiredForAllUsers = value; |
| 2069 | return this; |
| 2070 | } |
| 2071 | |
| 2072 | @Override |
| 2073 | public ParsingPackageImpl setOverlayPriority(int value) { |
| 2074 | overlayPriority = value; |
| 2075 | return this; |
| 2076 | } |
| 2077 | |
| 2078 | @Override |
| 2079 | public ParsingPackageImpl setOverlayIsStatic(boolean value) { |
| 2080 | overlayIsStatic = value; |
| 2081 | return this; |
| 2082 | } |
| 2083 | |
| 2084 | @Override |
| 2085 | public ParsingPackageImpl setStaticSharedLibVersion(long value) { |
| 2086 | staticSharedLibVersion = value; |
| 2087 | return this; |
| 2088 | } |
| 2089 | |
| 2090 | @Override |
| 2091 | public ParsingPackageImpl setSharedUserLabel(int value) { |
| 2092 | sharedUserLabel = value; |
| 2093 | return this; |
| 2094 | } |
| 2095 | |
| 2096 | @Override |
| 2097 | public ParsingPackageImpl setRestrictUpdateHash(@Nullable byte... value) { |
| 2098 | restrictUpdateHash = value; |
| 2099 | return this; |
| 2100 | } |
| 2101 | |
| 2102 | @Override |
| 2103 | public ParsingPackageImpl setUpgradeKeySets(@NonNull Set<String> value) { |
| 2104 | upgradeKeySets = value; |
| 2105 | return this; |
| 2106 | } |
| 2107 | |
| 2108 | @Override |
| 2109 | public ParsingPackageImpl setProcesses(@NonNull Map<String,ParsedProcess> value) { |
| 2110 | processes = value; |
| 2111 | return this; |
| 2112 | } |
| 2113 | |
| 2114 | @Override |
| 2115 | public ParsingPackageImpl setMetaData(@Nullable Bundle value) { |
| 2116 | metaData = value; |
| 2117 | return this; |
| 2118 | } |
| 2119 | |
| 2120 | @Override |
| 2121 | public ParsingPackageImpl setSigningDetails(@Nullable PackageParser.SigningDetails value) { |
| 2122 | signingDetails = value; |
| 2123 | return this; |
| 2124 | } |
| 2125 | |
| 2126 | @Override |
| 2127 | public ParsingPackageImpl setUse32BitAbi(boolean value) { |
| 2128 | use32BitAbi = value; |
| 2129 | return this; |
| 2130 | } |
| 2131 | |
| 2132 | @Override |
| 2133 | public ParsingPackageImpl setVisibleToInstantApps(boolean value) { |
| 2134 | visibleToInstantApps = value; |
| 2135 | return this; |
| 2136 | } |
| 2137 | |
| 2138 | @Override |
| 2139 | public ParsingPackageImpl setForceQueryable(boolean value) { |
| 2140 | forceQueryable = value; |
| 2141 | return this; |
| 2142 | } |
| 2143 | |
| 2144 | @Override |
| 2145 | public ParsingPackageImpl setBanner(int value) { |
| 2146 | banner = value; |
| 2147 | return this; |
| 2148 | } |
| 2149 | |
| 2150 | @Override |
| 2151 | public ParsingPackageImpl setCategory(int value) { |
| 2152 | category = value; |
| 2153 | return this; |
| 2154 | } |
| 2155 | |
| 2156 | @Override |
| 2157 | public ParsingPackageImpl setCompatibleWidthLimitDp(int value) { |
| 2158 | compatibleWidthLimitDp = value; |
| 2159 | return this; |
| 2160 | } |
| 2161 | |
| 2162 | @Override |
| 2163 | public ParsingPackageImpl setDescriptionRes(int value) { |
| 2164 | descriptionRes = value; |
| 2165 | return this; |
| 2166 | } |
| 2167 | |
| 2168 | @Override |
| 2169 | public ParsingPackageImpl setEnabled(boolean value) { |
| 2170 | enabled = value; |
| 2171 | return this; |
| 2172 | } |
| 2173 | |
| 2174 | @Override |
| 2175 | public ParsingPackageImpl setCrossProfile(boolean value) { |
| 2176 | crossProfile = value; |
| 2177 | return this; |
| 2178 | } |
| 2179 | |
| 2180 | @Override |
| 2181 | public ParsingPackageImpl setFullBackupContent(int value) { |
| 2182 | fullBackupContent = value; |
| 2183 | return this; |
| 2184 | } |
| 2185 | |
| 2186 | @Override |
| 2187 | public ParsingPackageImpl setIconRes(int value) { |
| 2188 | iconRes = value; |
| 2189 | return this; |
| 2190 | } |
| 2191 | |
| 2192 | @Override |
| 2193 | public ParsingPackageImpl setInstallLocation(int value) { |
| 2194 | installLocation = value; |
| 2195 | return this; |
| 2196 | } |
| 2197 | |
| 2198 | @Override |
| 2199 | public ParsingPackageImpl setLabelRes(int value) { |
| 2200 | labelRes = value; |
| 2201 | return this; |
| 2202 | } |
| 2203 | |
| 2204 | @Override |
| 2205 | public ParsingPackageImpl setLargestWidthLimitDp(int value) { |
| 2206 | largestWidthLimitDp = value; |
| 2207 | return this; |
| 2208 | } |
| 2209 | |
| 2210 | @Override |
| 2211 | public ParsingPackageImpl setLogo(int value) { |
| 2212 | logo = value; |
| 2213 | return this; |
| 2214 | } |
| 2215 | |
| 2216 | @Override |
| 2217 | public ParsingPackageImpl setMaxAspectRatio(float value) { |
| 2218 | maxAspectRatio = value; |
| 2219 | return this; |
| 2220 | } |
| 2221 | |
| 2222 | @Override |
| 2223 | public ParsingPackageImpl setMinAspectRatio(float value) { |
| 2224 | minAspectRatio = value; |
| 2225 | return this; |
| 2226 | } |
| 2227 | |
| 2228 | @Override |
Oli Lan | 72ae447 | 2020-04-14 16:50:41 +0100 | [diff] [blame] | 2229 | public ParsingPackageImpl setMinExtensionVersions(@Nullable SparseIntArray value) { |
| 2230 | minExtensionVersions = value; |
| 2231 | return this; |
| 2232 | } |
| 2233 | |
| 2234 | @Override |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 2235 | public ParsingPackageImpl setMinSdkVersion(int value) { |
| 2236 | minSdkVersion = value; |
| 2237 | return this; |
| 2238 | } |
| 2239 | |
| 2240 | @Override |
| 2241 | public ParsingPackageImpl setNetworkSecurityConfigRes(int value) { |
| 2242 | networkSecurityConfigRes = value; |
| 2243 | return this; |
| 2244 | } |
| 2245 | |
| 2246 | @Override |
| 2247 | public ParsingPackageImpl setNonLocalizedLabel(@Nullable CharSequence value) { |
| 2248 | nonLocalizedLabel = value; |
| 2249 | return this; |
| 2250 | } |
| 2251 | |
| 2252 | @Override |
| 2253 | public ParsingPackageImpl setRequiresSmallestWidthDp(int value) { |
| 2254 | requiresSmallestWidthDp = value; |
| 2255 | return this; |
| 2256 | } |
| 2257 | |
| 2258 | @Override |
| 2259 | public ParsingPackageImpl setRoundIconRes(int value) { |
| 2260 | roundIconRes = value; |
| 2261 | return this; |
| 2262 | } |
| 2263 | |
| 2264 | @Override |
| 2265 | public ParsingPackageImpl setTargetSandboxVersion(int value) { |
| 2266 | targetSandboxVersion = value; |
| 2267 | return this; |
| 2268 | } |
| 2269 | |
| 2270 | @Override |
| 2271 | public ParsingPackageImpl setTargetSdkVersion(int value) { |
| 2272 | targetSdkVersion = value; |
| 2273 | return this; |
| 2274 | } |
| 2275 | |
| 2276 | @Override |
| 2277 | public ParsingPackageImpl setTheme(int value) { |
| 2278 | theme = value; |
| 2279 | return this; |
| 2280 | } |
| 2281 | |
| 2282 | @Override |
| 2283 | public ParsingPackageImpl setUiOptions(int value) { |
| 2284 | uiOptions = value; |
| 2285 | return this; |
| 2286 | } |
| 2287 | |
| 2288 | @Override |
| 2289 | public ParsingPackageImpl setExternalStorage(boolean value) { |
| 2290 | externalStorage = value; |
| 2291 | return this; |
| 2292 | } |
| 2293 | |
| 2294 | @Override |
| 2295 | public ParsingPackageImpl setBaseHardwareAccelerated(boolean value) { |
| 2296 | baseHardwareAccelerated = value; |
| 2297 | return this; |
| 2298 | } |
| 2299 | |
| 2300 | @Override |
| 2301 | public ParsingPackageImpl setAllowBackup(boolean value) { |
| 2302 | allowBackup = value; |
| 2303 | return this; |
| 2304 | } |
| 2305 | |
| 2306 | @Override |
| 2307 | public ParsingPackageImpl setKillAfterRestore(boolean value) { |
| 2308 | killAfterRestore = value; |
| 2309 | return this; |
| 2310 | } |
| 2311 | |
| 2312 | @Override |
| 2313 | public ParsingPackageImpl setRestoreAnyVersion(boolean value) { |
| 2314 | restoreAnyVersion = value; |
| 2315 | return this; |
| 2316 | } |
| 2317 | |
| 2318 | @Override |
| 2319 | public ParsingPackageImpl setFullBackupOnly(boolean value) { |
| 2320 | fullBackupOnly = value; |
| 2321 | return this; |
| 2322 | } |
| 2323 | |
| 2324 | @Override |
| 2325 | public ParsingPackageImpl setPersistent(boolean value) { |
| 2326 | persistent = value; |
| 2327 | return this; |
| 2328 | } |
| 2329 | |
| 2330 | @Override |
| 2331 | public ParsingPackageImpl setDebuggable(boolean value) { |
| 2332 | debuggable = value; |
| 2333 | return this; |
| 2334 | } |
| 2335 | |
| 2336 | @Override |
| 2337 | public ParsingPackageImpl setVmSafeMode(boolean value) { |
| 2338 | vmSafeMode = value; |
| 2339 | return this; |
| 2340 | } |
| 2341 | |
| 2342 | @Override |
| 2343 | public ParsingPackageImpl setHasCode(boolean value) { |
| 2344 | hasCode = value; |
| 2345 | return this; |
| 2346 | } |
| 2347 | |
| 2348 | @Override |
| 2349 | public ParsingPackageImpl setAllowTaskReparenting(boolean value) { |
| 2350 | allowTaskReparenting = value; |
| 2351 | return this; |
| 2352 | } |
| 2353 | |
| 2354 | @Override |
| 2355 | public ParsingPackageImpl setAllowClearUserData(boolean value) { |
| 2356 | allowClearUserData = value; |
| 2357 | return this; |
| 2358 | } |
| 2359 | |
| 2360 | @Override |
| 2361 | public ParsingPackageImpl setLargeHeap(boolean value) { |
| 2362 | largeHeap = value; |
| 2363 | return this; |
| 2364 | } |
| 2365 | |
| 2366 | @Override |
| 2367 | public ParsingPackageImpl setUsesCleartextTraffic(boolean value) { |
| 2368 | usesCleartextTraffic = value; |
| 2369 | return this; |
| 2370 | } |
| 2371 | |
| 2372 | @Override |
| 2373 | public ParsingPackageImpl setSupportsRtl(boolean value) { |
| 2374 | supportsRtl = value; |
| 2375 | return this; |
| 2376 | } |
| 2377 | |
| 2378 | @Override |
| 2379 | public ParsingPackageImpl setTestOnly(boolean value) { |
| 2380 | testOnly = value; |
| 2381 | return this; |
| 2382 | } |
| 2383 | |
| 2384 | @Override |
| 2385 | public ParsingPackageImpl setMultiArch(boolean value) { |
| 2386 | multiArch = value; |
| 2387 | return this; |
| 2388 | } |
| 2389 | |
| 2390 | @Override |
| 2391 | public ParsingPackageImpl setExtractNativeLibs(boolean value) { |
| 2392 | extractNativeLibs = value; |
| 2393 | return this; |
| 2394 | } |
| 2395 | |
| 2396 | @Override |
| 2397 | public ParsingPackageImpl setGame(boolean value) { |
| 2398 | game = value; |
| 2399 | return this; |
| 2400 | } |
| 2401 | |
| 2402 | /** |
| 2403 | * @see ParsingPackageRead#getResizeableActivity() |
| 2404 | */ |
| 2405 | @Override |
| 2406 | public ParsingPackageImpl setResizeableActivity(@Nullable Boolean value) { |
| 2407 | resizeableActivity = value; |
| 2408 | return this; |
| 2409 | } |
| 2410 | |
| 2411 | @Override |
| 2412 | public ParsingPackageImpl setStaticSharedLibrary(boolean value) { |
| 2413 | staticSharedLibrary = value; |
| 2414 | return this; |
| 2415 | } |
| 2416 | |
| 2417 | @Override |
| 2418 | public ParsingPackageImpl setOverlay(boolean value) { |
| 2419 | overlay = value; |
| 2420 | return this; |
| 2421 | } |
| 2422 | |
| 2423 | @Override |
| 2424 | public ParsingPackageImpl setIsolatedSplitLoading(boolean value) { |
| 2425 | isolatedSplitLoading = value; |
| 2426 | return this; |
| 2427 | } |
| 2428 | |
| 2429 | @Override |
| 2430 | public ParsingPackageImpl setHasDomainUrls(boolean value) { |
| 2431 | hasDomainUrls = value; |
| 2432 | return this; |
| 2433 | } |
| 2434 | |
| 2435 | @Override |
| 2436 | public ParsingPackageImpl setProfileableByShell(boolean value) { |
| 2437 | profileableByShell = value; |
| 2438 | return this; |
| 2439 | } |
| 2440 | |
| 2441 | @Override |
| 2442 | public ParsingPackageImpl setBackupInForeground(boolean value) { |
| 2443 | backupInForeground = value; |
| 2444 | return this; |
| 2445 | } |
| 2446 | |
| 2447 | @Override |
| 2448 | public ParsingPackageImpl setUseEmbeddedDex(boolean value) { |
| 2449 | useEmbeddedDex = value; |
| 2450 | return this; |
| 2451 | } |
| 2452 | |
| 2453 | @Override |
| 2454 | public ParsingPackageImpl setDefaultToDeviceProtectedStorage(boolean value) { |
| 2455 | defaultToDeviceProtectedStorage = value; |
| 2456 | return this; |
| 2457 | } |
| 2458 | |
| 2459 | @Override |
| 2460 | public ParsingPackageImpl setDirectBootAware(boolean value) { |
| 2461 | directBootAware = value; |
| 2462 | return this; |
| 2463 | } |
| 2464 | |
| 2465 | @Override |
Evgenii Stepanov | d43d109 | 2020-03-16 13:55:42 -0700 | [diff] [blame] | 2466 | public ParsingPackageImpl setGwpAsanMode(int value) { |
| 2467 | gwpAsanMode = value; |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 2468 | return this; |
| 2469 | } |
| 2470 | |
| 2471 | @Override |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 2472 | public ParsingPackageImpl setPartiallyDirectBootAware(boolean value) { |
| 2473 | partiallyDirectBootAware = value; |
| 2474 | return this; |
| 2475 | } |
| 2476 | |
| 2477 | @Override |
| 2478 | public ParsingPackageImpl setResizeableActivityViaSdkVersion(boolean value) { |
| 2479 | resizeableActivityViaSdkVersion = value; |
| 2480 | return this; |
| 2481 | } |
| 2482 | |
| 2483 | @Override |
| 2484 | public ParsingPackageImpl setAllowClearUserDataOnFailedRestore(boolean value) { |
| 2485 | allowClearUserDataOnFailedRestore = value; |
| 2486 | return this; |
| 2487 | } |
| 2488 | |
| 2489 | @Override |
| 2490 | public ParsingPackageImpl setAllowAudioPlaybackCapture(boolean value) { |
| 2491 | allowAudioPlaybackCapture = value; |
| 2492 | return this; |
| 2493 | } |
| 2494 | |
| 2495 | @Override |
| 2496 | public ParsingPackageImpl setRequestLegacyExternalStorage(boolean value) { |
| 2497 | requestLegacyExternalStorage = value; |
| 2498 | return this; |
| 2499 | } |
| 2500 | |
| 2501 | @Override |
| 2502 | public ParsingPackageImpl setUsesNonSdkApi(boolean value) { |
| 2503 | usesNonSdkApi = value; |
| 2504 | return this; |
| 2505 | } |
| 2506 | |
| 2507 | @Override |
| 2508 | public ParsingPackageImpl setHasFragileUserData(boolean value) { |
| 2509 | hasFragileUserData = value; |
| 2510 | return this; |
| 2511 | } |
| 2512 | |
| 2513 | @Override |
| 2514 | public ParsingPackageImpl setCantSaveState(boolean value) { |
| 2515 | cantSaveState = value; |
| 2516 | return this; |
| 2517 | } |
| 2518 | |
| 2519 | @Override |
| 2520 | public ParsingPackageImpl setAllowNativeHeapPointerTagging(boolean value) { |
| 2521 | allowNativeHeapPointerTagging = value; |
| 2522 | return this; |
| 2523 | } |
| 2524 | |
| 2525 | @Override |
Eugene Susla | 49b84c3 | 2020-03-23 15:19:29 -0700 | [diff] [blame] | 2526 | public ParsingPackageImpl setAutoRevokePermissions(int value) { |
| 2527 | autoRevokePermissions = value; |
Eugene Susla | db77bc1 | 2020-03-03 12:09:00 -0800 | [diff] [blame] | 2528 | return this; |
| 2529 | } |
| 2530 | |
| 2531 | @Override |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 2532 | public ParsingPackageImpl setPreserveLegacyExternalStorage(boolean value) { |
| 2533 | preserveLegacyExternalStorage = value; |
| 2534 | return this; |
| 2535 | } |
Winson | dec01d6 | 2020-02-21 10:44:58 -0800 | [diff] [blame] | 2536 | |
| 2537 | @Override |
| 2538 | public ParsingPackageImpl setVersionName(String versionName) { |
| 2539 | this.versionName = versionName; |
| 2540 | return this; |
| 2541 | } |
| 2542 | |
| 2543 | @Override |
| 2544 | public ParsingPackage setCompileSdkVersionCodename(String compileSdkVersionCodename) { |
| 2545 | this.compileSdkVersionCodeName = compileSdkVersionCodename; |
| 2546 | return this; |
| 2547 | } |
| 2548 | |
| 2549 | @Override |
| 2550 | public ParsingPackageImpl setProcessName(String processName) { |
| 2551 | this.processName = processName; |
| 2552 | return this; |
| 2553 | } |
| 2554 | |
| 2555 | @Override |
| 2556 | public ParsingPackageImpl setRealPackage(@Nullable String realPackage) { |
| 2557 | this.realPackage = realPackage; |
| 2558 | return this; |
| 2559 | } |
| 2560 | |
| 2561 | @Override |
| 2562 | public ParsingPackageImpl setRestrictedAccountType(@Nullable String restrictedAccountType) { |
| 2563 | this.restrictedAccountType = restrictedAccountType; |
| 2564 | return this; |
| 2565 | } |
| 2566 | |
| 2567 | @Override |
| 2568 | public ParsingPackageImpl setOverlayTargetName(@Nullable String overlayTargetName) { |
| 2569 | this.overlayTargetName = overlayTargetName; |
| 2570 | return this; |
| 2571 | } |
| 2572 | |
| 2573 | @Override |
| 2574 | public ParsingPackageImpl setOverlayCategory(@Nullable String overlayCategory) { |
| 2575 | this.overlayCategory = overlayCategory; |
| 2576 | return this; |
| 2577 | } |
| 2578 | |
| 2579 | @Override |
| 2580 | public ParsingPackageImpl setAppComponentFactory(@Nullable String appComponentFactory) { |
| 2581 | this.appComponentFactory = appComponentFactory; |
| 2582 | return this; |
| 2583 | } |
| 2584 | |
| 2585 | @Override |
| 2586 | public ParsingPackageImpl setBackupAgentName(@Nullable String backupAgentName) { |
| 2587 | this.backupAgentName = backupAgentName; |
| 2588 | return this; |
| 2589 | } |
| 2590 | |
| 2591 | @Override |
| 2592 | public ParsingPackageImpl setClassLoaderName(@Nullable String classLoaderName) { |
| 2593 | this.classLoaderName = classLoaderName; |
| 2594 | return this; |
| 2595 | } |
| 2596 | |
| 2597 | @Override |
| 2598 | public ParsingPackageImpl setClassName(@Nullable String className) { |
| 2599 | this.className = className; |
| 2600 | return this; |
| 2601 | } |
| 2602 | |
| 2603 | @Override |
| 2604 | public ParsingPackageImpl setManageSpaceActivityName(@Nullable String manageSpaceActivityName) { |
| 2605 | this.manageSpaceActivityName = manageSpaceActivityName; |
| 2606 | return this; |
| 2607 | } |
| 2608 | |
| 2609 | @Override |
| 2610 | public ParsingPackageImpl setPermission(@Nullable String permission) { |
| 2611 | this.permission = permission; |
| 2612 | return this; |
| 2613 | } |
| 2614 | |
| 2615 | @Override |
| 2616 | public ParsingPackageImpl setTaskAffinity(@Nullable String taskAffinity) { |
| 2617 | this.taskAffinity = taskAffinity; |
| 2618 | return this; |
| 2619 | } |
| 2620 | |
| 2621 | @Override |
| 2622 | public ParsingPackageImpl setZygotePreloadName(@Nullable String zygotePreloadName) { |
| 2623 | this.zygotePreloadName = zygotePreloadName; |
| 2624 | return this; |
| 2625 | } |
Winson | 01e38f4 | 2020-01-24 11:50:11 -0800 | [diff] [blame] | 2626 | } |