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 | |
| 19 | import android.annotation.NonNull; |
| 20 | import android.annotation.Nullable; |
| 21 | import android.content.Intent; |
| 22 | import android.content.pm.ActivityInfo; |
| 23 | import android.content.pm.ApplicationInfo; |
| 24 | import android.content.pm.ConfigurationInfo; |
| 25 | import android.content.pm.FeatureGroupInfo; |
| 26 | import android.content.pm.FeatureInfo; |
| 27 | import android.content.pm.PackageInfo; |
| 28 | import android.content.pm.PackageParser; |
| 29 | import android.content.pm.ServiceInfo; |
| 30 | import android.content.pm.parsing.ComponentParseUtils.ParsedActivity; |
| 31 | import android.content.pm.parsing.ComponentParseUtils.ParsedActivityIntentInfo; |
| 32 | import android.content.pm.parsing.ComponentParseUtils.ParsedFeature; |
| 33 | import android.content.pm.parsing.ComponentParseUtils.ParsedInstrumentation; |
| 34 | import android.content.pm.parsing.ComponentParseUtils.ParsedPermission; |
| 35 | import android.content.pm.parsing.ComponentParseUtils.ParsedPermissionGroup; |
| 36 | import android.content.pm.parsing.ComponentParseUtils.ParsedProcess; |
| 37 | import android.content.pm.parsing.ComponentParseUtils.ParsedProvider; |
| 38 | import android.content.pm.parsing.ComponentParseUtils.ParsedService; |
| 39 | import android.os.Bundle; |
| 40 | import android.os.Parcelable; |
| 41 | import android.util.ArraySet; |
| 42 | import android.util.SparseArray; |
| 43 | |
| 44 | import com.android.internal.R; |
| 45 | |
| 46 | import java.security.PublicKey; |
| 47 | import java.util.List; |
| 48 | import java.util.Map; |
| 49 | import java.util.Set; |
| 50 | |
| 51 | /** |
| 52 | * Everything written by {@link ParsingPackage} and readable back. |
| 53 | * |
| 54 | * @hide |
| 55 | */ |
| 56 | @SuppressWarnings("UnusedReturnValue") |
| 57 | public interface ParsingPackageRead extends Parcelable { |
| 58 | |
| 59 | /** |
| 60 | * @see ActivityInfo |
| 61 | * @see PackageInfo#activities |
| 62 | */ |
| 63 | @NonNull |
| 64 | List<ParsedActivity> getActivities(); |
| 65 | |
| 66 | /** |
| 67 | * The names of packages to adopt ownership of permissions from, parsed under |
| 68 | * {@link PackageParser#TAG_ADOPT_PERMISSIONS}. |
| 69 | * @see R.styleable#AndroidManifestOriginalPackage_name |
| 70 | */ |
| 71 | @NonNull |
| 72 | List<String> getAdoptPermissions(); |
| 73 | |
| 74 | /** |
| 75 | * @see PackageInfo#configPreferences |
| 76 | * @see R.styleable#AndroidManifestUsesConfiguration |
| 77 | */ |
| 78 | @NonNull |
| 79 | List<ConfigurationInfo> getConfigPreferences(); |
| 80 | |
| 81 | @NonNull |
| 82 | List<ParsedFeature> getFeatures(); |
| 83 | |
| 84 | /** |
| 85 | * @see PackageInfo#featureGroups |
| 86 | * @see R.styleable#AndroidManifestUsesFeature |
| 87 | */ |
| 88 | @NonNull |
| 89 | List<FeatureGroupInfo> getFeatureGroups(); |
| 90 | |
| 91 | /** |
| 92 | * Permissions requested but not in the manifest. These may have been split or migrated from |
| 93 | * previous versions/definitions. |
| 94 | */ |
| 95 | @NonNull |
| 96 | List<String> getImplicitPermissions(); |
| 97 | |
| 98 | /** |
| 99 | * @see android.content.pm.InstrumentationInfo |
| 100 | * @see PackageInfo#instrumentation |
| 101 | */ |
| 102 | @NonNull |
| 103 | List<ParsedInstrumentation> getInstrumentations(); |
| 104 | |
| 105 | /** |
| 106 | * For use with {@link com.android.server.pm.KeySetManagerService}. Parsed in |
| 107 | * {@link PackageParser#TAG_KEY_SETS}. |
| 108 | * @see R.styleable#AndroidManifestKeySet |
| 109 | * @see R.styleable#AndroidManifestPublicKey |
| 110 | */ |
| 111 | @NonNull |
| 112 | Map<String, ArraySet<PublicKey>> getKeySetMapping(); |
| 113 | |
| 114 | /** |
| 115 | * Library names this package is declared as, for use by other packages with "uses-library". |
| 116 | * @see R.styleable#AndroidManifestLibrary |
| 117 | */ |
| 118 | @NonNull |
| 119 | List<String> getLibraryNames(); |
| 120 | |
| 121 | /** |
| 122 | * For system use to migrate from an old package name to a new one, moving over data |
| 123 | * if available. |
| 124 | * @see R.styleable#AndroidManifestOriginalPackage} |
| 125 | */ |
| 126 | @NonNull |
| 127 | List<String> getOriginalPackages(); |
| 128 | |
| 129 | /** |
| 130 | * Map of overlayable name to actor name. |
| 131 | */ |
| 132 | @NonNull |
| 133 | Map<String, String> getOverlayables(); |
| 134 | |
| 135 | /** |
| 136 | * @see android.content.pm.PermissionInfo |
| 137 | * @see PackageInfo#permissions |
| 138 | */ |
| 139 | @NonNull |
| 140 | List<ParsedPermission> getPermissions(); |
| 141 | |
| 142 | /** |
| 143 | * @see android.content.pm.PermissionGroupInfo |
| 144 | */ |
| 145 | @NonNull |
| 146 | List<ParsedPermissionGroup> getPermissionGroups(); |
| 147 | |
| 148 | /** |
| 149 | * Used to determine the default preferred handler of an {@link Intent}. |
| 150 | * |
| 151 | * Map of component className to intent info inside that component. |
| 152 | * TODO(b/135203078): Is this actually used/working? |
| 153 | */ |
| 154 | @NonNull |
| 155 | List<ParsedActivityIntentInfo> getPreferredActivityFilters(); |
| 156 | |
| 157 | /** |
| 158 | * System protected broadcasts. |
| 159 | * @see R.styleable#AndroidManifestProtectedBroadcast |
| 160 | */ |
| 161 | @NonNull |
| 162 | List<String> getProtectedBroadcasts(); |
| 163 | |
| 164 | /** |
| 165 | * @see android.content.pm.ProviderInfo |
| 166 | * @see PackageInfo#providers |
| 167 | */ |
| 168 | @NonNull |
| 169 | List<ParsedProvider> getProviders(); |
| 170 | |
| 171 | /** |
| 172 | * @see android.content.pm.ProcessInfo |
| 173 | */ |
| 174 | @NonNull |
| 175 | Map<String, ParsedProcess> getProcesses(); |
| 176 | |
| 177 | /** |
| 178 | * Since they share several attributes, receivers are parsed as {@link ParsedActivity}, even |
| 179 | * though they represent different functionality. |
| 180 | * TODO(b/135203078): Reconsider this and maybe make ParsedReceiver so it's not so confusing |
| 181 | * @see ActivityInfo |
| 182 | * @see PackageInfo#receivers |
| 183 | */ |
| 184 | @NonNull |
| 185 | List<ParsedActivity> getReceivers(); |
| 186 | |
| 187 | /** |
| 188 | * @see PackageInfo#reqFeatures |
| 189 | * @see R.styleable#AndroidManifestUsesFeature |
| 190 | */ |
| 191 | @NonNull |
| 192 | List<FeatureInfo> getReqFeatures(); |
| 193 | |
| 194 | /** |
| 195 | * All the permissions declared. This is an effective set, and may include permissions |
| 196 | * transformed from split/migrated permissions from previous versions, so may not be exactly |
| 197 | * what the package declares in its manifest. |
| 198 | * @see PackageInfo#requestedPermissions |
| 199 | * @see R.styleable#AndroidManifestUsesPermission |
| 200 | */ |
| 201 | @NonNull |
| 202 | List<String> getRequestedPermissions(); |
| 203 | |
| 204 | /** |
| 205 | * Whether or not the app requested explicitly resizeable Activities. |
| 206 | * A null value means nothing was explicitly requested. |
| 207 | */ |
| 208 | @Nullable |
| 209 | Boolean getResizeableActivity(); |
| 210 | |
| 211 | /** |
| 212 | * @see ServiceInfo |
| 213 | * @see PackageInfo#services |
| 214 | */ |
| 215 | @NonNull |
| 216 | List<ParsedService> getServices(); |
| 217 | |
| 218 | /** @see R.styleable#AndroidManifestUsesLibrary */ |
| 219 | @NonNull |
| 220 | List<String> getUsesLibraries(); |
| 221 | |
| 222 | /** |
| 223 | * Like {@link #getUsesLibraries()}, but marked optional by setting |
| 224 | * {@link R.styleable#AndroidManifestUsesLibrary_required} to false . Application is expected |
| 225 | * to handle absence manually. |
| 226 | * @see R.styleable#AndroidManifestUsesLibrary |
| 227 | */ |
| 228 | @NonNull |
| 229 | List<String> getUsesOptionalLibraries(); |
| 230 | |
| 231 | /** |
| 232 | * TODO(b/135203078): Move static library stuff to an inner data class |
| 233 | * @see R.styleable#AndroidManifestUsesStaticLibrary |
| 234 | */ |
| 235 | @NonNull |
| 236 | List<String> getUsesStaticLibraries(); |
| 237 | |
| 238 | /** @see R.styleable#AndroidManifestUsesStaticLibrary_certDigest */ |
| 239 | @Nullable |
| 240 | String[][] getUsesStaticLibrariesCertDigests(); |
| 241 | |
| 242 | /** @see R.styleable#AndroidManifestUsesStaticLibrary_version */ |
| 243 | @Nullable |
| 244 | long[] getUsesStaticLibrariesVersions(); |
| 245 | |
| 246 | /** |
| 247 | * Intents that this package may query or require and thus requires visibility into. |
| 248 | * @see R.styleable#AndroidManifestQueriesIntent |
| 249 | */ |
| 250 | @NonNull |
| 251 | List<Intent> getQueriesIntents(); |
| 252 | |
| 253 | /** |
| 254 | * Other packages that this package may query or require and thus requires visibility into. |
| 255 | * @see R.styleable#AndroidManifestQueriesPackage |
| 256 | */ |
| 257 | @NonNull |
| 258 | List<String> getQueriesPackages(); |
| 259 | |
| 260 | /** |
| 261 | * Authorities that this package may query or require and thus requires visibility into. |
| 262 | * @see R.styleable#AndroidManifestQueriesProvider |
| 263 | */ |
| 264 | @NonNull |
| 265 | Set<String> getQueriesProviders(); |
| 266 | |
| 267 | /** |
| 268 | * We store the application meta-data independently to avoid multiple unwanted references |
| 269 | * TODO(b/135203078): What does this comment mean? |
| 270 | * TODO(b/135203078): Make all the Bundles immutable (and non-null by shared empty reference?) |
| 271 | */ |
| 272 | @Nullable |
| 273 | Bundle getMetaData(); |
| 274 | |
| 275 | /** @see R.styleable#AndroidManifestApplication_forceQueryable */ |
| 276 | boolean isForceQueryable(); |
| 277 | |
| 278 | /** |
| 279 | * @see ApplicationInfo#maxAspectRatio |
| 280 | * @see R.styleable#AndroidManifestApplication_maxAspectRatio |
| 281 | */ |
| 282 | float getMaxAspectRatio(); |
| 283 | |
| 284 | /** |
| 285 | * @see ApplicationInfo#minAspectRatio |
| 286 | * @see R.styleable#AndroidManifestApplication_minAspectRatio |
| 287 | */ |
| 288 | float getMinAspectRatio(); |
| 289 | |
| 290 | /** |
| 291 | * @see ApplicationInfo#permission |
| 292 | * @see R.styleable#AndroidManifestApplication_permission |
| 293 | */ |
| 294 | @Nullable |
| 295 | String getPermission(); |
| 296 | |
| 297 | /** |
| 298 | * @see ApplicationInfo#processName |
| 299 | * @see R.styleable#AndroidManifestApplication_process |
| 300 | */ |
| 301 | @NonNull |
| 302 | String getProcessName(); |
| 303 | |
| 304 | /** |
| 305 | * @see PackageInfo#sharedUserId |
| 306 | * @see R.styleable#AndroidManifest_sharedUserId |
| 307 | */ |
| 308 | @Deprecated |
| 309 | @Nullable |
| 310 | String getSharedUserId(); |
| 311 | |
| 312 | /** @see R.styleable#AndroidManifestStaticLibrary_name */ |
| 313 | @Nullable |
| 314 | String getStaticSharedLibName(); |
| 315 | |
| 316 | /** |
| 317 | * @see ApplicationInfo#taskAffinity |
| 318 | * @see R.styleable#AndroidManifestApplication_taskAffinity |
| 319 | */ |
| 320 | @Nullable |
| 321 | String getTaskAffinity(); |
| 322 | |
| 323 | /** |
| 324 | * @see ApplicationInfo#targetSdkVersion |
| 325 | * @see R.styleable#AndroidManifestUsesSdk_targetSdkVersion |
| 326 | */ |
| 327 | int getTargetSdkVersion(); |
| 328 | |
| 329 | /** |
| 330 | * @see ApplicationInfo#uiOptions |
| 331 | * @see R.styleable#AndroidManifestApplication_uiOptions |
| 332 | */ |
| 333 | int getUiOptions(); |
| 334 | |
| 335 | boolean isCrossProfile(); |
| 336 | |
| 337 | boolean isResizeableActivityViaSdkVersion(); |
| 338 | |
| 339 | /** @see ApplicationInfo#FLAG_HARDWARE_ACCELERATED */ |
| 340 | boolean isBaseHardwareAccelerated(); |
| 341 | |
| 342 | /** |
| 343 | * If omitted from manifest, returns true if {@link #getTargetSdkVersion()} >= |
| 344 | * {@link android.os.Build.VERSION_CODES#DONUT}. |
| 345 | * @see R.styleable#AndroidManifestSupportsScreens_resizeable |
| 346 | * @see ApplicationInfo#FLAG_RESIZEABLE_FOR_SCREENS |
| 347 | */ |
| 348 | boolean isResizeable(); |
| 349 | |
| 350 | /** @see ApplicationInfo#PRIVATE_FLAG_ALLOW_AUDIO_PLAYBACK_CAPTURE */ |
| 351 | boolean isAllowAudioPlaybackCapture(); |
| 352 | |
| 353 | /** @see ApplicationInfo#FLAG_ALLOW_BACKUP */ |
| 354 | boolean isAllowBackup(); |
| 355 | |
| 356 | /** @see ApplicationInfo#FLAG_ALLOW_CLEAR_USER_DATA */ |
| 357 | boolean isAllowClearUserData(); |
| 358 | |
| 359 | /** @see ApplicationInfo#PRIVATE_FLAG_ALLOW_CLEAR_USER_DATA_ON_FAILED_RESTORE */ |
| 360 | boolean isAllowClearUserDataOnFailedRestore(); |
| 361 | |
| 362 | /** @see ApplicationInfo#FLAG_ALLOW_TASK_REPARENTING */ |
| 363 | boolean isAllowTaskReparenting(); |
| 364 | |
| 365 | /** |
| 366 | * @see ApplicationInfo#PRIVATE_FLAG_IS_RESOURCE_OVERLAY |
| 367 | * @see ApplicationInfo#isResourceOverlay() |
| 368 | */ |
| 369 | boolean isOverlay(); |
| 370 | |
| 371 | /** @see ApplicationInfo#PRIVATE_FLAG_BACKUP_IN_FOREGROUND */ |
| 372 | boolean isBackupInForeground(); |
| 373 | |
| 374 | /** @see ApplicationInfo#PRIVATE_FLAG_CANT_SAVE_STATE */ |
| 375 | boolean isCantSaveState(); |
| 376 | |
| 377 | /** @see ApplicationInfo#FLAG_DEBUGGABLE */ |
| 378 | boolean isDebuggable(); |
| 379 | |
| 380 | /** @see ApplicationInfo#PRIVATE_FLAG_DEFAULT_TO_DEVICE_PROTECTED_STORAGE */ |
| 381 | boolean isDefaultToDeviceProtectedStorage(); |
| 382 | |
| 383 | /** @see ApplicationInfo#PRIVATE_FLAG_DIRECT_BOOT_AWARE */ |
| 384 | boolean isDirectBootAware(); |
| 385 | |
| 386 | /** @see ApplicationInfo#FLAG_EXTERNAL_STORAGE */ |
| 387 | boolean isExternalStorage(); |
| 388 | |
| 389 | /** @see ApplicationInfo#FLAG_EXTRACT_NATIVE_LIBS */ |
| 390 | boolean isExtractNativeLibs(); |
| 391 | |
| 392 | /** @see ApplicationInfo#FLAG_FULL_BACKUP_ONLY */ |
| 393 | boolean isFullBackupOnly(); |
| 394 | |
| 395 | /** @see ApplicationInfo#FLAG_HAS_CODE */ |
| 396 | boolean isHasCode(); |
| 397 | |
| 398 | /** @see ApplicationInfo#PRIVATE_FLAG_HAS_FRAGILE_USER_DATA */ |
| 399 | boolean isHasFragileUserData(); |
| 400 | |
| 401 | /** @see ApplicationInfo#FLAG_IS_GAME */ |
| 402 | @Deprecated |
| 403 | boolean isGame(); |
| 404 | |
| 405 | /** @see ApplicationInfo#PRIVATE_FLAG_ISOLATED_SPLIT_LOADING */ |
| 406 | boolean isIsolatedSplitLoading(); |
| 407 | |
| 408 | /** @see ApplicationInfo#FLAG_KILL_AFTER_RESTORE */ |
| 409 | boolean isKillAfterRestore(); |
| 410 | |
| 411 | /** @see ApplicationInfo#FLAG_LARGE_HEAP */ |
| 412 | boolean isLargeHeap(); |
| 413 | |
| 414 | /** @see ApplicationInfo#FLAG_MULTIARCH */ |
| 415 | boolean isMultiArch(); |
| 416 | |
| 417 | /** @see ApplicationInfo#PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE */ |
| 418 | boolean isPartiallyDirectBootAware(); |
| 419 | |
| 420 | /** @see ApplicationInfo#FLAG_PERSISTENT */ |
| 421 | boolean isPersistent(); |
| 422 | |
| 423 | /** @see ApplicationInfo#PRIVATE_FLAG_PROFILEABLE_BY_SHELL */ |
| 424 | boolean isProfileableByShell(); |
| 425 | |
| 426 | /** @see ApplicationInfo#PRIVATE_FLAG_REQUEST_LEGACY_EXTERNAL_STORAGE */ |
| 427 | boolean isRequestLegacyExternalStorage(); |
| 428 | |
| 429 | /** @see ApplicationInfo#FLAG_RESTORE_ANY_VERSION */ |
| 430 | boolean isRestoreAnyVersion(); |
| 431 | |
| 432 | // ParsingPackageRead setSplitHasCode(int splitIndex, boolean splitHasCode); |
| 433 | |
| 434 | /** Flags of any split APKs; ordered by parsed splitName */ |
| 435 | @Nullable |
| 436 | int[] getSplitFlags(); |
| 437 | |
| 438 | /** @see ApplicationInfo#splitSourceDirs */ |
| 439 | @Nullable |
| 440 | String[] getSplitCodePaths(); |
| 441 | |
| 442 | /** @see ApplicationInfo#splitDependencies */ |
| 443 | @Nullable |
| 444 | SparseArray<int[]> getSplitDependencies(); |
| 445 | |
| 446 | /** |
| 447 | * @see ApplicationInfo#splitNames |
| 448 | * @see PackageInfo#splitNames |
| 449 | */ |
| 450 | @Nullable |
| 451 | String[] getSplitNames(); |
| 452 | |
| 453 | /** @see PackageInfo#splitRevisionCodes */ |
| 454 | int[] getSplitRevisionCodes(); |
| 455 | |
| 456 | /** @see ApplicationInfo#PRIVATE_FLAG_STATIC_SHARED_LIBRARY */ |
| 457 | boolean isStaticSharedLibrary(); |
| 458 | |
| 459 | /** @see ApplicationInfo#FLAG_SUPPORTS_RTL */ |
| 460 | boolean isSupportsRtl(); |
| 461 | |
| 462 | /** @see ApplicationInfo#FLAG_TEST_ONLY */ |
| 463 | boolean isTestOnly(); |
| 464 | |
| 465 | /** @see ApplicationInfo#PRIVATE_FLAG_USE_EMBEDDED_DEX */ |
| 466 | boolean isUseEmbeddedDex(); |
| 467 | |
| 468 | /** @see ApplicationInfo#FLAG_USES_CLEARTEXT_TRAFFIC */ |
| 469 | boolean isUsesCleartextTraffic(); |
| 470 | |
| 471 | /** @see ApplicationInfo#PRIVATE_FLAG_USES_NON_SDK_API */ |
| 472 | boolean isUsesNonSdkApi(); |
| 473 | |
| 474 | /** |
| 475 | * Set if the any of components are visible to instant applications. |
| 476 | * @see R.styleable#AndroidManifestActivity_visibleToInstantApps |
| 477 | * @see R.styleable#AndroidManifestProvider_visibleToInstantApps |
| 478 | * @see R.styleable#AndroidManifestService_visibleToInstantApps |
| 479 | */ |
| 480 | boolean isVisibleToInstantApps(); |
| 481 | |
| 482 | /** @see ApplicationInfo#FLAG_VM_SAFE_MODE */ |
| 483 | boolean isVmSafeMode(); |
| 484 | |
| 485 | /** |
| 486 | * If omitted from manifest, returns true if {@link #getTargetSdkVersion()} >= |
| 487 | * {@link android.os.Build.VERSION_CODES#DONUT}. |
| 488 | * @see R.styleable#AndroidManifestSupportsScreens_anyDensity |
| 489 | * @see ApplicationInfo#FLAG_SUPPORTS_SCREEN_DENSITIES |
| 490 | */ |
| 491 | boolean isAnyDensity(); |
| 492 | |
| 493 | /** |
| 494 | * @see ApplicationInfo#appComponentFactory |
| 495 | * @see R.styleable#AndroidManifestApplication_appComponentFactory |
| 496 | */ |
| 497 | @Nullable |
| 498 | String getAppComponentFactory(); |
| 499 | |
| 500 | /** |
| 501 | * @see ApplicationInfo#backupAgentName |
| 502 | * @see R.styleable#AndroidManifestApplication_backupAgent |
| 503 | */ |
| 504 | @Nullable |
| 505 | String getBackupAgentName(); |
| 506 | |
| 507 | /** |
| 508 | * @see ApplicationInfo#banner |
| 509 | * @see R.styleable#AndroidManifestApplication_banner |
| 510 | */ |
| 511 | int getBanner(); |
| 512 | |
| 513 | /** |
| 514 | * @see ApplicationInfo#category |
| 515 | * @see R.styleable#AndroidManifestApplication_appCategory |
| 516 | */ |
| 517 | int getCategory(); |
| 518 | |
| 519 | /** |
| 520 | * @see ApplicationInfo#classLoaderName |
| 521 | * @see R.styleable#AndroidManifestApplication_classLoader |
| 522 | */ |
| 523 | @Nullable |
| 524 | String getClassLoaderName(); |
| 525 | |
| 526 | /** |
| 527 | * @see ApplicationInfo#className |
| 528 | * @see R.styleable#AndroidManifestApplication_name |
| 529 | */ |
| 530 | @Nullable |
| 531 | String getClassName(); |
| 532 | |
| 533 | String getPackageName(); |
| 534 | |
| 535 | /** Path of base APK */ |
| 536 | String getBaseCodePath(); |
| 537 | |
| 538 | /** |
| 539 | * Path where this package was found on disk. For monolithic packages |
| 540 | * this is path to single base APK file; for cluster packages this is |
| 541 | * path to the cluster directory. |
| 542 | */ |
| 543 | @NonNull |
| 544 | String getCodePath(); |
| 545 | |
| 546 | /** |
| 547 | * @see ApplicationInfo#compatibleWidthLimitDp |
| 548 | * @see R.styleable#AndroidManifestSupportsScreens_compatibleWidthLimitDp |
| 549 | */ |
| 550 | int getCompatibleWidthLimitDp(); |
| 551 | |
| 552 | /** |
| 553 | * @see ApplicationInfo#descriptionRes |
| 554 | * @see R.styleable#AndroidManifestApplication_description |
| 555 | */ |
| 556 | int getDescriptionRes(); |
| 557 | |
| 558 | /** |
| 559 | * @see ApplicationInfo#enabled |
| 560 | * @see R.styleable#AndroidManifestApplication_enabled |
| 561 | */ |
| 562 | boolean isEnabled(); |
| 563 | |
| 564 | /** |
| 565 | * @see ApplicationInfo#fullBackupContent |
| 566 | * @see R.styleable#AndroidManifestApplication_fullBackupContent |
| 567 | */ |
| 568 | int getFullBackupContent(); |
| 569 | |
| 570 | /** @see ApplicationInfo#PRIVATE_FLAG_HAS_DOMAIN_URLS */ |
| 571 | boolean isHasDomainUrls(); |
| 572 | |
| 573 | /** |
| 574 | * @see ApplicationInfo#iconRes |
| 575 | * @see R.styleable#AndroidManifestApplication_icon |
| 576 | */ |
| 577 | int getIconRes(); |
| 578 | |
| 579 | /** |
| 580 | * @see ApplicationInfo#installLocation |
| 581 | * @see R.styleable#AndroidManifest_installLocation |
| 582 | */ |
| 583 | int getInstallLocation(); |
| 584 | |
| 585 | /** |
| 586 | * @see ApplicationInfo#labelRes |
| 587 | * @see R.styleable#AndroidManifestApplication_label |
| 588 | */ |
| 589 | int getLabelRes(); |
| 590 | |
| 591 | /** |
| 592 | * @see ApplicationInfo#largestWidthLimitDp |
| 593 | * @see R.styleable#AndroidManifestSupportsScreens_largestWidthLimitDp |
| 594 | */ |
| 595 | int getLargestWidthLimitDp(); |
| 596 | |
| 597 | /** |
| 598 | * @see ApplicationInfo#logo |
| 599 | * @see R.styleable#AndroidManifestApplication_logo |
| 600 | */ |
| 601 | int getLogo(); |
| 602 | |
| 603 | /** |
| 604 | * @see ApplicationInfo#manageSpaceActivityName |
| 605 | * @see R.styleable#AndroidManifestApplication_manageSpaceActivity |
| 606 | */ |
| 607 | @Nullable |
| 608 | String getManageSpaceActivityName(); |
| 609 | |
| 610 | /** |
| 611 | * @see ApplicationInfo#minSdkVersion |
| 612 | * @see R.styleable#AndroidManifestUsesSdk_minSdkVersion |
| 613 | */ |
| 614 | int getMinSdkVersion(); |
| 615 | |
| 616 | /** |
| 617 | * @see ApplicationInfo#networkSecurityConfigRes |
| 618 | * @see R.styleable#AndroidManifestApplication_networkSecurityConfig |
| 619 | */ |
| 620 | int getNetworkSecurityConfigRes(); |
| 621 | |
| 622 | /** |
| 623 | * If {@link R.styleable#AndroidManifestApplication_label} is a string literal, this is it. |
| 624 | * Otherwise, it's stored as {@link #getLabelRes()}. |
| 625 | * @see ApplicationInfo#nonLocalizedLabel |
| 626 | * @see R.styleable#AndroidManifestApplication_label |
| 627 | */ |
| 628 | @Nullable |
| 629 | CharSequence getNonLocalizedLabel(); |
| 630 | |
| 631 | /** |
| 632 | * @see PackageInfo#overlayCategory |
| 633 | * @see R.styleable#AndroidManifestResourceOverlay_category |
| 634 | */ |
| 635 | @Nullable |
| 636 | String getOverlayCategory(); |
| 637 | |
| 638 | /** @see PackageInfo#mOverlayIsStatic */ |
| 639 | boolean isOverlayIsStatic(); |
| 640 | |
| 641 | /** |
| 642 | * @see PackageInfo#overlayPriority |
| 643 | * @see R.styleable#AndroidManifestResourceOverlay_priority |
| 644 | */ |
| 645 | int getOverlayPriority(); |
| 646 | |
| 647 | /** |
| 648 | * @see PackageInfo#overlayTarget |
| 649 | * @see R.styleable#AndroidManifestResourceOverlay_targetPackage |
| 650 | */ |
| 651 | @Nullable |
| 652 | String getOverlayTarget(); |
| 653 | |
| 654 | /** |
| 655 | * @see PackageInfo#targetOverlayableName |
| 656 | * @see R.styleable#AndroidManifestResourceOverlay_targetName |
| 657 | */ |
| 658 | @Nullable |
| 659 | String getOverlayTargetName(); |
| 660 | |
| 661 | /** |
| 662 | * If a system app declares {@link #getOriginalPackages()}, and the app was previously installed |
| 663 | * under one of those original package names, the {@link #getPackageName()} system identifier |
| 664 | * will be changed to that previously installed name. This will then be non-null, set to the |
| 665 | * manifest package name, for tracking the package under its true name. |
| 666 | * |
| 667 | * TODO(b/135203078): Remove this in favor of checking originalPackages.isEmpty and |
| 668 | * getManifestPackageName |
| 669 | */ |
| 670 | @Nullable |
| 671 | String getRealPackage(); |
| 672 | |
| 673 | /** |
| 674 | * The required account type without which this application will not function. |
| 675 | * |
| 676 | * @see PackageInfo#requiredAccountType |
| 677 | * @see R.styleable#AndroidManifestApplication_requiredAccountType |
| 678 | */ |
| 679 | @Nullable |
| 680 | String getRequiredAccountType(); |
| 681 | |
| 682 | /** |
| 683 | * @see PackageInfo#requiredForAllUsers |
| 684 | * @see R.styleable#AndroidManifestApplication_requiredForAllUsers |
| 685 | */ |
| 686 | boolean isRequiredForAllUsers(); |
| 687 | |
| 688 | /** |
| 689 | * @see ApplicationInfo#requiresSmallestWidthDp |
| 690 | * @see R.styleable#AndroidManifestSupportsScreens_requiresSmallestWidthDp |
| 691 | */ |
| 692 | int getRequiresSmallestWidthDp(); |
| 693 | |
| 694 | /** |
| 695 | * SHA-512 hash of the only APK that can be used to update a system package. |
| 696 | * @see R.styleable#AndroidManifestRestrictUpdate |
| 697 | */ |
| 698 | @Nullable |
| 699 | byte[] getRestrictUpdateHash(); |
| 700 | |
| 701 | /** |
| 702 | * The restricted account authenticator type that is used by this application |
| 703 | * |
| 704 | * @see PackageInfo#restrictedAccountType |
| 705 | * @see R.styleable#AndroidManifestApplication_restrictedAccountType |
| 706 | */ |
| 707 | @Nullable |
| 708 | String getRestrictedAccountType(); |
| 709 | |
| 710 | /** |
| 711 | * @see ApplicationInfo#roundIconRes |
| 712 | * @see R.styleable#AndroidManifestApplication_roundIcon |
| 713 | */ |
| 714 | int getRoundIconRes(); |
| 715 | |
| 716 | /** |
| 717 | * @see PackageInfo#sharedUserLabel |
| 718 | * @see R.styleable#AndroidManifest_sharedUserLabel |
| 719 | */ |
| 720 | @Deprecated |
| 721 | int getSharedUserLabel(); |
| 722 | |
| 723 | /** |
| 724 | * The signature data of all APKs in this package, which must be exactly the same across the |
| 725 | * base and splits. |
| 726 | */ |
| 727 | PackageParser.SigningDetails getSigningDetails(); |
| 728 | |
| 729 | /** |
| 730 | * @see ApplicationInfo#splitClassLoaderNames |
| 731 | * @see R.styleable#AndroidManifestApplication_classLoader |
| 732 | */ |
| 733 | @Nullable |
| 734 | String[] getSplitClassLoaderNames(); |
| 735 | |
| 736 | /** @see R.styleable#AndroidManifestStaticLibrary_version */ |
| 737 | long getStaticSharedLibVersion(); |
| 738 | |
| 739 | /** |
| 740 | * If omitted from manifest, returns true if {@link #getTargetSdkVersion()} >= |
| 741 | * {@link android.os.Build.VERSION_CODES#DONUT}. |
| 742 | * @see R.styleable#AndroidManifestSupportsScreens_largeScreens |
| 743 | * @see ApplicationInfo#FLAG_SUPPORTS_LARGE_SCREENS |
| 744 | */ |
| 745 | boolean isSupportsLargeScreens(); |
| 746 | |
| 747 | /** |
| 748 | * If omitted from manifest, returns true. |
| 749 | * @see R.styleable#AndroidManifestSupportsScreens_normalScreens |
| 750 | * @see ApplicationInfo#FLAG_SUPPORTS_NORMAL_SCREENS |
| 751 | */ |
| 752 | boolean isSupportsNormalScreens(); |
| 753 | |
| 754 | /** |
| 755 | * If omitted from manifest, returns true if {@link #getTargetSdkVersion()} >= |
| 756 | * {@link android.os.Build.VERSION_CODES#DONUT}. |
| 757 | * @see R.styleable#AndroidManifestSupportsScreens_smallScreens |
| 758 | * @see ApplicationInfo#FLAG_SUPPORTS_SMALL_SCREENS |
| 759 | */ |
| 760 | boolean isSupportsSmallScreens(); |
| 761 | |
| 762 | /** |
| 763 | * If omitted from manifest, returns true if {@link #getTargetSdkVersion()} >= |
| 764 | * {@link android.os.Build.VERSION_CODES#GINGERBREAD}. |
| 765 | * @see R.styleable#AndroidManifestSupportsScreens_xlargeScreens |
| 766 | * @see ApplicationInfo#FLAG_SUPPORTS_XLARGE_SCREENS |
| 767 | */ |
| 768 | boolean isSupportsExtraLargeScreens(); |
| 769 | |
| 770 | /** @see ApplicationInfo#PRIVATE_FLAG_ALLOW_NATIVE_HEAP_POINTER_TAGGING */ |
| 771 | boolean isAllowNativeHeapPointerTagging(); |
| 772 | |
| 773 | boolean hasPreserveLegacyExternalStorage(); |
| 774 | |
| 775 | /** |
| 776 | * @see ApplicationInfo#targetSandboxVersion |
| 777 | * @see R.styleable#AndroidManifest_targetSandboxVersion |
| 778 | */ |
| 779 | @Deprecated |
| 780 | int getTargetSandboxVersion(); |
| 781 | |
| 782 | /** |
| 783 | * @see ApplicationInfo#theme |
| 784 | * @see R.styleable#AndroidManifestApplication_theme |
| 785 | */ |
| 786 | int getTheme(); |
| 787 | |
| 788 | /** |
| 789 | * For use with {@link com.android.server.pm.KeySetManagerService}. Parsed in |
| 790 | * {@link PackageParser#TAG_KEY_SETS}. |
| 791 | * @see R.styleable#AndroidManifestUpgradeKeySet |
| 792 | */ |
| 793 | @NonNull |
| 794 | Set<String> getUpgradeKeySets(); |
| 795 | |
| 796 | /** |
| 797 | * The install time abi override to choose 32bit abi's when multiple abi's |
| 798 | * are present. This is only meaningfull for multiarch applications. |
| 799 | * The use32bitAbi attribute is ignored if cpuAbiOverride is also set. |
| 800 | */ |
| 801 | boolean isUse32BitAbi(); |
| 802 | |
| 803 | /** @see ApplicationInfo#volumeUuid */ |
| 804 | @Nullable |
| 805 | String getVolumeUuid(); |
| 806 | |
| 807 | /** @see ApplicationInfo#zygotePreloadName */ |
| 808 | @Nullable |
| 809 | String getZygotePreloadName(); |
| 810 | |
| 811 | /** Revision code of base APK */ |
| 812 | int getBaseRevisionCode(); |
| 813 | |
| 814 | /** @see PackageInfo#versionName */ |
| 815 | @Nullable |
| 816 | String getVersionName(); |
| 817 | |
| 818 | /** @see PackageInfo#versionCodeMajor */ |
| 819 | @Nullable |
| 820 | int getVersionCode(); |
| 821 | |
| 822 | /** @see PackageInfo#versionCodeMajor */ |
| 823 | @Nullable |
| 824 | int getVersionCodeMajor(); |
| 825 | |
| 826 | /** |
| 827 | * @see ApplicationInfo#compileSdkVersion |
| 828 | * @see R.styleable#AndroidManifest_compileSdkVersion |
| 829 | */ |
| 830 | int getCompileSdkVersion(); |
| 831 | |
| 832 | /** |
| 833 | * @see ApplicationInfo#compileSdkVersionCodename |
| 834 | * @see R.styleable#AndroidManifest_compileSdkVersionCodename |
| 835 | */ |
| 836 | @Nullable |
| 837 | String getCompileSdkVersionCodeName(); |
| 838 | |
| 839 | @Nullable |
| 840 | Set<String> getMimeGroups(); |
| 841 | |
| 842 | // TODO(b/135203078): Hide and enforce going through PackageInfoUtils |
| 843 | ApplicationInfo toAppInfoWithoutState(); |
| 844 | } |