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