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 com.android.server.pm.pkg; 18 19 import android.annotation.Dimension; 20 import android.annotation.DrawableRes; 21 import android.annotation.NonNull; 22 import android.annotation.Nullable; 23 import android.annotation.StringRes; 24 import android.annotation.StyleRes; 25 import android.annotation.SystemApi; 26 import android.annotation.XmlRes; 27 import android.content.ComponentName; 28 import android.content.Intent; 29 import android.content.pm.ActivityInfo; 30 import android.content.pm.ApplicationInfo; 31 import android.content.pm.ConfigurationInfo; 32 import android.content.pm.FeatureGroupInfo; 33 import android.content.pm.FeatureInfo; 34 import android.content.pm.InstrumentationInfo; 35 import android.content.pm.PackageInfo; 36 import android.content.pm.PackageManager; 37 import android.content.pm.PermissionInfo; 38 import android.content.pm.ProviderInfo; 39 import android.content.pm.ServiceInfo; 40 import android.content.pm.SigningDetails; 41 import android.os.Bundle; 42 import android.os.storage.StorageManager; 43 import android.processor.immutability.Immutable; 44 import android.util.ArraySet; 45 import android.util.Pair; 46 import android.util.SparseArray; 47 import android.util.SparseIntArray; 48 49 import com.android.internal.R; 50 import com.android.internal.pm.pkg.component.ParsedActivity; 51 import com.android.internal.pm.pkg.component.ParsedApexSystemService; 52 import com.android.internal.pm.pkg.component.ParsedAttribution; 53 import com.android.internal.pm.pkg.component.ParsedInstrumentation; 54 import com.android.internal.pm.pkg.component.ParsedIntentInfo; 55 import com.android.internal.pm.pkg.component.ParsedPermission; 56 import com.android.internal.pm.pkg.component.ParsedPermissionGroup; 57 import com.android.internal.pm.pkg.component.ParsedProcess; 58 import com.android.internal.pm.pkg.component.ParsedProvider; 59 import com.android.internal.pm.pkg.component.ParsedService; 60 import com.android.internal.pm.pkg.component.ParsedUsesPermission; 61 import com.android.internal.pm.pkg.parsing.ParsingPackageUtils; 62 63 import java.security.PublicKey; 64 import java.util.List; 65 import java.util.Map; 66 import java.util.Set; 67 import java.util.UUID; 68 69 /** 70 * The representation of an application on disk, as parsed from its split APKs' manifests. 71 * 72 * Metadata available here is mostly device-state independent and indicates what the application 73 * author declared for their app. 74 * 75 * This is the system server in-process API equivalent of the public API {@link ApplicationInfo}. 76 * Note that because {@link ApplicationInfo} is stateful, several methods that exist on it may not 77 * be available here and need to be read through {@link PackageState} or {@link PackageUserState}. 78 * 79 * All instances of {@link AndroidPackage} are associated with a {@link PackageState}, and the 80 * only way to retrieve one is through {@link PackageState}. Note that the inverse does not apply 81 * and {@link AndroidPackage} may be null in several cases. See 82 * {@link PackageState#getAndroidPackage()}. 83 * 84 * The data available here is immutable and will throw {@link UnsupportedOperationException} if any 85 * collection type is mutated. 86 * 87 * @hide 88 */ 89 @SystemApi(client = SystemApi.Client.SYSTEM_SERVER) 90 @Immutable 91 public interface AndroidPackage { 92 93 /** 94 * An array containing the drawable resources that used for the launcher 95 * activity icons. 96 * 97 * @see R.attr#alternateLauncherIcons 98 * @hide 99 */ 100 @Immutable.Ignore 101 @Nullable getAlternateLauncherIconResIds()102 int[] getAlternateLauncherIconResIds(); 103 104 /** 105 * An array containing the string resources that used for the launcher 106 * activity labels. 107 * 108 * @see R.attr#alternateLauncherLabels 109 * @hide 110 */ 111 @Immutable.Ignore 112 @Nullable getAlternateLauncherLabelResIds()113 int[] getAlternateLauncherLabelResIds(); 114 115 /** 116 * @see ApplicationInfo#className 117 * @see R.styleable#AndroidManifestApplication_name 118 */ 119 @Nullable getApplicationClassName()120 String getApplicationClassName(); 121 122 /** 123 * @see ApplicationInfo#appComponentFactory 124 * @see R.styleable#AndroidManifestApplication_appComponentFactory 125 */ 126 @Nullable getAppComponentFactory()127 String getAppComponentFactory(); 128 129 /** 130 * @see ApplicationInfo#backupAgentName 131 * @see R.styleable#AndroidManifestApplication_backupAgent 132 */ 133 @Nullable getBackupAgentName()134 String getBackupAgentName(); 135 136 /** 137 * @see ApplicationInfo#banner 138 * @see R.styleable#AndroidManifestApplication_banner 139 */ 140 @DrawableRes getBannerResourceId()141 int getBannerResourceId(); 142 143 /** 144 * @see PackageInfo#baseRevisionCode 145 * @see R.styleable#AndroidManifest_revisionCode 146 */ getBaseRevisionCode()147 int getBaseRevisionCode(); 148 149 /** 150 * @see ApplicationInfo#category 151 * @see R.styleable#AndroidManifestApplication_appCategory 152 */ getCategory()153 int getCategory(); 154 155 /** 156 * @see ApplicationInfo#classLoaderName 157 * @see R.styleable#AndroidManifestApplication_classLoader 158 */ 159 @Nullable getClassLoaderName()160 String getClassLoaderName(); 161 162 /** 163 * @see ApplicationInfo#compatibleWidthLimitDp 164 * @see R.styleable#AndroidManifestSupportsScreens_compatibleWidthLimitDp 165 */ 166 @Dimension(unit = Dimension.DP) getCompatibleWidthLimitDp()167 int getCompatibleWidthLimitDp(); 168 169 /** 170 * @see ApplicationInfo#dataExtractionRulesRes 171 * @see R.styleable#AndroidManifestApplication_dataExtractionRules 172 */ 173 @XmlRes getDataExtractionRulesResourceId()174 int getDataExtractionRulesResourceId(); 175 176 /** 177 * @see ApplicationInfo#descriptionRes 178 * @see R.styleable#AndroidManifestApplication_description 179 */ 180 @StringRes // This is actually format="reference" getDescriptionResourceId()181 int getDescriptionResourceId(); 182 183 /** 184 * @see ApplicationInfo#fullBackupContent 185 * @see R.styleable#AndroidManifestApplication_fullBackupContent 186 */ 187 @XmlRes getFullBackupContentResourceId()188 int getFullBackupContentResourceId(); 189 190 /** 191 * @see ApplicationInfo#getGwpAsanMode() 192 * @see R.styleable#AndroidManifestApplication_gwpAsanMode 193 */ 194 @ApplicationInfo.GwpAsanMode getGwpAsanMode()195 int getGwpAsanMode(); 196 197 /** 198 * @see ApplicationInfo#iconRes 199 * @see R.styleable#AndroidManifestApplication_icon 200 */ 201 @DrawableRes getIconResourceId()202 int getIconResourceId(); 203 204 /** 205 * @see ApplicationInfo#labelRes 206 * @see R.styleable#AndroidManifestApplication_label 207 */ 208 @StringRes getLabelResourceId()209 int getLabelResourceId(); 210 211 /** 212 * @see ApplicationInfo#largestWidthLimitDp 213 * @see R.styleable#AndroidManifestSupportsScreens_largestWidthLimitDp 214 */ 215 @Dimension(unit = Dimension.DP) getLargestWidthLimitDp()216 int getLargestWidthLimitDp(); 217 218 /** 219 * Library names this package is declared as, for use by other packages with "uses-library". 220 * 221 * @see R.styleable#AndroidManifestLibrary 222 */ 223 @NonNull getLibraryNames()224 List<String> getLibraryNames(); 225 226 /** 227 * @see ApplicationInfo#logo 228 * @see R.styleable#AndroidManifestApplication_logo 229 */ 230 @DrawableRes getLogoResourceId()231 int getLogoResourceId(); 232 233 /** 234 * The resource ID used to provide the application's locales configuration. 235 * 236 * @see R.styleable#AndroidManifestApplication_localeConfig 237 */ 238 @XmlRes getLocaleConfigResourceId()239 int getLocaleConfigResourceId(); 240 241 /** 242 * @see PackageInfo#getLongVersionCode() 243 * @see R.styleable#AndroidManifest_versionCode 244 * @see R.styleable#AndroidManifest_versionCodeMajor 245 */ getLongVersionCode()246 long getLongVersionCode(); 247 248 /** 249 * @see ApplicationInfo#maxAspectRatio 250 * @see R.styleable#AndroidManifestApplication_maxAspectRatio 251 */ getMaxAspectRatio()252 float getMaxAspectRatio(); 253 254 /** 255 * @see ApplicationInfo#minAspectRatio 256 * @see R.styleable#AndroidManifestApplication_minAspectRatio 257 */ getMinAspectRatio()258 float getMinAspectRatio(); 259 260 /** 261 * @see ApplicationInfo#getNativeHeapZeroInitialized() 262 * @see R.styleable#AndroidManifestApplication_nativeHeapZeroInitialized 263 */ 264 @ApplicationInfo.NativeHeapZeroInitialized getNativeHeapZeroInitialized()265 int getNativeHeapZeroInitialized(); 266 267 /** 268 * @see ApplicationInfo#networkSecurityConfigRes 269 * @see R.styleable#AndroidManifestApplication_networkSecurityConfig 270 */ 271 @XmlRes getNetworkSecurityConfigResourceId()272 int getNetworkSecurityConfigResourceId(); 273 274 /** 275 * @see PackageInfo#requiredAccountType 276 * @see R.styleable#AndroidManifestApplication_requiredAccountType 277 */ 278 @Nullable getRequiredAccountType()279 String getRequiredAccountType(); 280 281 /** 282 * @see ApplicationInfo#requiresSmallestWidthDp 283 * @see R.styleable#AndroidManifestSupportsScreens_requiresSmallestWidthDp 284 */ 285 @Dimension(unit = Dimension.DP) getRequiresSmallestWidthDp()286 int getRequiresSmallestWidthDp(); 287 288 /** 289 * The restricted account authenticator type that is used by this application. 290 * 291 * @see PackageInfo#restrictedAccountType 292 * @see R.styleable#AndroidManifestApplication_restrictedAccountType 293 */ 294 @Nullable getRestrictedAccountType()295 String getRestrictedAccountType(); 296 297 /** 298 * @see R.styleable#AndroidManifestApplication_emergencyInstaller 299 * @hide 300 */ 301 @Nullable getEmergencyInstaller()302 String getEmergencyInstaller(); 303 304 /** 305 * @see ApplicationInfo#roundIconRes 306 * @see R.styleable#AndroidManifestApplication_roundIcon 307 */ 308 @DrawableRes getRoundIconResourceId()309 int getRoundIconResourceId(); 310 311 /** 312 * @see R.styleable#AndroidManifestSdkLibrary_name 313 */ 314 @Nullable getSdkLibraryName()315 String getSdkLibraryName(); 316 317 /** 318 * @see PackageInfo#sharedUserId 319 * @see R.styleable#AndroidManifest_sharedUserId 320 */ 321 @Nullable getSharedUserId()322 String getSharedUserId(); 323 324 /** 325 * @see PackageInfo#sharedUserLabel 326 * @see R.styleable#AndroidManifest_sharedUserLabel 327 */ 328 @StringRes getSharedUserLabelResourceId()329 int getSharedUserLabelResourceId(); 330 331 /** 332 * @return List of all splits for a package. Note that base.apk is considered a 333 * split and will be provided as index 0 of the list. 334 */ 335 @NonNull getSplits()336 List<AndroidPackageSplit> getSplits(); 337 338 /** 339 * @see R.styleable#AndroidManifestStaticLibrary_name 340 */ 341 @Nullable getStaticSharedLibraryName()342 String getStaticSharedLibraryName(); 343 344 /** 345 * @see R.styleable#AndroidManifestStaticLibrary_version 346 * @hide 347 */ getStaticSharedLibraryVersion()348 long getStaticSharedLibraryVersion(); 349 350 /** 351 * @return The {@link UUID} for use with {@link StorageManager} APIs identifying where this 352 * package was installed. 353 */ 354 @NonNull getStorageUuid()355 UUID getStorageUuid(); 356 357 /** 358 * @see ApplicationInfo#targetSdkVersion 359 * @see R.styleable#AndroidManifestUsesSdk_targetSdkVersion 360 */ getTargetSdkVersion()361 int getTargetSdkVersion(); 362 363 /** 364 * @see ApplicationInfo#theme 365 * @see R.styleable#AndroidManifestApplication_theme 366 */ 367 @StyleRes getThemeResourceId()368 int getThemeResourceId(); 369 370 /** 371 * @see ApplicationInfo#uiOptions 372 * @see R.styleable#AndroidManifestApplication_uiOptions 373 */ getUiOptions()374 int getUiOptions(); 375 376 /** 377 * @see PackageInfo#versionName 378 */ 379 @Nullable getVersionName()380 String getVersionName(); 381 382 /** 383 * @see ApplicationInfo#zygotePreloadName 384 * @see R.styleable#AndroidManifestApplication_zygotePreloadName 385 */ 386 @Nullable getZygotePreloadName()387 String getZygotePreloadName(); 388 389 /** 390 * @see ApplicationInfo#PRIVATE_FLAG_ALLOW_AUDIO_PLAYBACK_CAPTURE 391 * @see R.styleable#AndroidManifestApplication_allowAudioPlaybackCapture 392 */ isAllowAudioPlaybackCapture()393 boolean isAllowAudioPlaybackCapture(); 394 395 /** 396 * @see ApplicationInfo#FLAG_ALLOW_BACKUP 397 * @see R.styleable#AndroidManifestApplication_allowBackup 398 */ isBackupAllowed()399 boolean isBackupAllowed(); 400 401 /** 402 * @see ApplicationInfo#FLAG_ALLOW_CLEAR_USER_DATA 403 * @see R.styleable#AndroidManifestApplication_allowClearUserData 404 */ isClearUserDataAllowed()405 boolean isClearUserDataAllowed(); 406 407 /** 408 * @see ApplicationInfo#PRIVATE_FLAG_ALLOW_CLEAR_USER_DATA_ON_FAILED_RESTORE 409 * @see R.styleable#AndroidManifestApplication_allowClearUserDataOnFailedRestore 410 */ isClearUserDataOnFailedRestoreAllowed()411 boolean isClearUserDataOnFailedRestoreAllowed(); 412 413 /** 414 * @see ApplicationInfo#PRIVATE_FLAG_ALLOW_NATIVE_HEAP_POINTER_TAGGING 415 * @see R.styleable#AndroidManifestApplication_allowNativeHeapPointerTagging 416 */ isAllowNativeHeapPointerTagging()417 boolean isAllowNativeHeapPointerTagging(); 418 419 /** 420 * @see ApplicationInfo#FLAG_ALLOW_TASK_REPARENTING 421 * @see R.styleable#AndroidManifestApplication_allowTaskReparenting 422 */ isTaskReparentingAllowed()423 boolean isTaskReparentingAllowed(); 424 425 /** 426 * If omitted from manifest, returns true if {@link #getTargetSdkVersion()} >= {@link 427 * android.os.Build.VERSION_CODES#DONUT}. 428 * 429 * @see R.styleable#AndroidManifestSupportsScreens_anyDensity 430 * @see ApplicationInfo#FLAG_SUPPORTS_SCREEN_DENSITIES 431 */ isAnyDensity()432 boolean isAnyDensity(); 433 434 /** 435 * @see ApplicationInfo#areAttributionsUserVisible() 436 * @see R.styleable#AndroidManifestApplication_attributionsAreUserVisible 437 */ isAttributionsUserVisible()438 boolean isAttributionsUserVisible(); 439 440 /** 441 * @see ApplicationInfo#PRIVATE_FLAG_BACKUP_IN_FOREGROUND 442 * @see R.styleable#AndroidManifestApplication_backupInForeground 443 */ isBackupInForeground()444 boolean isBackupInForeground(); 445 446 /** 447 * @see ApplicationInfo#FLAG_HARDWARE_ACCELERATED 448 * @see R.styleable#AndroidManifestApplication_hardwareAccelerated 449 */ isHardwareAccelerated()450 boolean isHardwareAccelerated(); 451 452 /** 453 * @see ApplicationInfo#PRIVATE_FLAG_CANT_SAVE_STATE 454 * @see R.styleable#AndroidManifestApplication_cantSaveState 455 */ isSaveStateDisallowed()456 boolean isSaveStateDisallowed(); 457 458 /** 459 * @see PackageInfo#coreApp 460 */ isCoreApp()461 boolean isCoreApp(); 462 463 /** 464 * @see ApplicationInfo#crossProfile 465 * @see R.styleable#AndroidManifestApplication_crossProfile 466 */ isCrossProfile()467 boolean isCrossProfile(); 468 469 /** 470 * @see ApplicationInfo#FLAG_DEBUGGABLE 471 * @see R.styleable#AndroidManifestApplication_debuggable 472 */ isDebuggable()473 boolean isDebuggable(); 474 475 /** 476 * @see ApplicationInfo#PRIVATE_FLAG_DEFAULT_TO_DEVICE_PROTECTED_STORAGE 477 * @see R.styleable#AndroidManifestApplication_defaultToDeviceProtectedStorage 478 */ isDefaultToDeviceProtectedStorage()479 boolean isDefaultToDeviceProtectedStorage(); 480 481 /** 482 * @see ApplicationInfo#PRIVATE_FLAG_DIRECT_BOOT_AWARE 483 * @see R.styleable#AndroidManifestApplication_directBootAware 484 */ isDirectBootAware()485 boolean isDirectBootAware(); 486 487 /** 488 * @see ApplicationInfo#FLAG_EXTRACT_NATIVE_LIBS 489 * @see R.styleable#AndroidManifestApplication_extractNativeLibs 490 */ isExtractNativeLibrariesRequested()491 boolean isExtractNativeLibrariesRequested(); 492 493 /** 494 * @see ApplicationInfo#FLAG_FACTORY_TEST 495 */ isFactoryTest()496 boolean isFactoryTest(); 497 498 /** 499 * @see R.styleable#AndroidManifestApplication_forceQueryable 500 */ isForceQueryable()501 boolean isForceQueryable(); 502 503 /** 504 * @see ApplicationInfo#FLAG_FULL_BACKUP_ONLY 505 * @see R.styleable#AndroidManifestApplication_fullBackupOnly 506 */ isFullBackupOnly()507 boolean isFullBackupOnly(); 508 509 /** 510 * @see ApplicationInfo#FLAG_HAS_CODE 511 * @see R.styleable#AndroidManifestApplication_hasCode 512 */ isDeclaredHavingCode()513 boolean isDeclaredHavingCode(); 514 515 /** 516 * @see ApplicationInfo#PRIVATE_FLAG_HAS_FRAGILE_USER_DATA 517 * @see R.styleable#AndroidManifestApplication_hasFragileUserData 518 */ isUserDataFragile()519 boolean isUserDataFragile(); 520 521 /** 522 * @see ApplicationInfo#PRIVATE_FLAG_ISOLATED_SPLIT_LOADING 523 * @see R.styleable#AndroidManifest_isolatedSplits 524 */ isIsolatedSplitLoading()525 boolean isIsolatedSplitLoading(); 526 527 /** 528 * @see ApplicationInfo#FLAG_KILL_AFTER_RESTORE 529 * @see R.styleable#AndroidManifestApplication_killAfterRestore 530 */ isKillAfterRestoreAllowed()531 boolean isKillAfterRestoreAllowed(); 532 533 /** 534 * @see ApplicationInfo#FLAG_LARGE_HEAP 535 * @see R.styleable#AndroidManifestApplication_largeHeap 536 */ isLargeHeap()537 boolean isLargeHeap(); 538 539 /** 540 * Returns true if R.styleable#AndroidManifest_sharedUserMaxSdkVersion is set to a value 541 * smaller than the current SDK version, indicating the package wants to leave its declared 542 * {@link #getSharedUserId()}. This only occurs on new installs, pretending the app never 543 * declared one. 544 * 545 * @see R.styleable#AndroidManifest_sharedUserMaxSdkVersion 546 */ isLeavingSharedUser()547 boolean isLeavingSharedUser(); 548 549 /** 550 * @see ApplicationInfo#FLAG_MULTIARCH 551 * @see R.styleable#AndroidManifestApplication_multiArch 552 */ isMultiArch()553 boolean isMultiArch(); 554 555 /** 556 * @see ApplicationInfo#nativeLibraryRootRequiresIsa 557 */ isNativeLibraryRootRequiresIsa()558 boolean isNativeLibraryRootRequiresIsa(); 559 560 /** 561 * @see R.styleable#AndroidManifestApplication_enableOnBackInvokedCallback 562 */ isOnBackInvokedCallbackEnabled()563 boolean isOnBackInvokedCallbackEnabled(); 564 565 /** 566 * @see ApplicationInfo#FLAG_PERSISTENT 567 * @see R.styleable#AndroidManifestApplication_persistent 568 */ isPersistent()569 boolean isPersistent(); 570 571 /** 572 * @see ApplicationInfo#PRIVATE_FLAG_EXT_PROFILEABLE 573 * @see R.styleable#AndroidManifestProfileable 574 */ isProfileable()575 boolean isProfileable(); 576 577 /** 578 * @see ApplicationInfo#PRIVATE_FLAG_PROFILEABLE_BY_SHELL 579 * @see R.styleable#AndroidManifestProfileable_shell 580 */ isProfileableByShell()581 boolean isProfileableByShell(); 582 583 /** 584 * @see ApplicationInfo#PRIVATE_FLAG_REQUEST_LEGACY_EXTERNAL_STORAGE 585 * @see R.styleable#AndroidManifestApplication_requestLegacyExternalStorage 586 */ isRequestLegacyExternalStorage()587 boolean isRequestLegacyExternalStorage(); 588 589 /** 590 * @see PackageInfo#requiredForAllUsers 591 * @see R.styleable#AndroidManifestApplication_requiredForAllUsers 592 */ isRequiredForAllUsers()593 boolean isRequiredForAllUsers(); 594 595 /** 596 * Whether the enabled settings of components in the application should be reset to the default, 597 * when the application's user data is cleared. 598 * 599 * @see R.styleable#AndroidManifestApplication_resetEnabledSettingsOnAppDataCleared 600 */ isResetEnabledSettingsOnAppDataCleared()601 boolean isResetEnabledSettingsOnAppDataCleared(); 602 603 /** 604 * @see ApplicationInfo#PRIVATE_FLAG_IS_RESOURCE_OVERLAY 605 * @see ApplicationInfo#isResourceOverlay() 606 * @see R.styleable#AndroidManifestResourceOverlay 607 */ isResourceOverlay()608 boolean isResourceOverlay(); 609 610 /** 611 * @see ApplicationInfo#FLAG_RESTORE_ANY_VERSION 612 * @see R.styleable#AndroidManifestApplication_restoreAnyVersion 613 */ isRestoreAnyVersion()614 boolean isRestoreAnyVersion(); 615 616 /** 617 * @see ApplicationInfo#PRIVATE_FLAG_SIGNED_WITH_PLATFORM_KEY 618 */ isSignedWithPlatformKey()619 boolean isSignedWithPlatformKey(); 620 621 /** 622 * If omitted from manifest, returns true if {@link #getTargetSdkVersion()} >= {@link 623 * android.os.Build.VERSION_CODES#GINGERBREAD}. 624 * 625 * @see R.styleable#AndroidManifestSupportsScreens_xlargeScreens 626 * @see ApplicationInfo#FLAG_SUPPORTS_XLARGE_SCREENS 627 */ isExtraLargeScreensSupported()628 boolean isExtraLargeScreensSupported(); 629 630 /** 631 * If omitted from manifest, returns true if {@link #getTargetSdkVersion()} >= {@link 632 * android.os.Build.VERSION_CODES#DONUT}. 633 * 634 * @see R.styleable#AndroidManifestSupportsScreens_largeScreens 635 * @see ApplicationInfo#FLAG_SUPPORTS_LARGE_SCREENS 636 */ isLargeScreensSupported()637 boolean isLargeScreensSupported(); 638 639 /** 640 * If omitted from manifest, returns true. 641 * 642 * @see R.styleable#AndroidManifestSupportsScreens_normalScreens 643 * @see ApplicationInfo#FLAG_SUPPORTS_NORMAL_SCREENS 644 */ isNormalScreensSupported()645 boolean isNormalScreensSupported(); 646 647 /** 648 * @see ApplicationInfo#FLAG_SUPPORTS_RTL 649 * @see R.styleable#AndroidManifestApplication_supportsRtl 650 */ isRtlSupported()651 boolean isRtlSupported(); 652 653 /** 654 * If omitted from manifest, returns true if {@link #getTargetSdkVersion()} >= {@link 655 * android.os.Build.VERSION_CODES#DONUT}. 656 * 657 * @see R.styleable#AndroidManifestSupportsScreens_smallScreens 658 * @see ApplicationInfo#FLAG_SUPPORTS_SMALL_SCREENS 659 */ isSmallScreensSupported()660 boolean isSmallScreensSupported(); 661 662 /** 663 * @see ApplicationInfo#FLAG_TEST_ONLY 664 * @see R.styleable#AndroidManifestApplication_testOnly 665 */ isTestOnly()666 boolean isTestOnly(); 667 668 /** 669 * The install time abi override to choose 32bit abi's when multiple abi's are present. This is 670 * only meaningful for multiarch applications. The use32bitAbi attribute is ignored if 671 * cpuAbiOverride is also set. 672 * 673 * @see R.attr#use32bitAbi 674 */ is32BitAbiPreferred()675 boolean is32BitAbiPreferred(); 676 677 /** 678 * @see ApplicationInfo#FLAG_USES_CLEARTEXT_TRAFFIC 679 * @see R.styleable#AndroidManifestApplication_usesCleartextTraffic 680 */ isCleartextTrafficAllowed()681 boolean isCleartextTrafficAllowed(); 682 683 /** 684 * @see ApplicationInfo#PRIVATE_FLAG_USE_EMBEDDED_DEX 685 * @see R.styleable#AndroidManifestApplication_useEmbeddedDex 686 */ isUseEmbeddedDex()687 boolean isUseEmbeddedDex(); 688 689 /** 690 * @see ApplicationInfo#PRIVATE_FLAG_USES_NON_SDK_API 691 * @see R.styleable#AndroidManifestApplication_usesNonSdkApi 692 */ isNonSdkApiRequested()693 boolean isNonSdkApiRequested(); 694 695 /** 696 * @see ApplicationInfo#FLAG_VM_SAFE_MODE 697 * @see R.styleable#AndroidManifestApplication_vmSafeMode 698 */ isVmSafeMode()699 boolean isVmSafeMode(); 700 701 // Methods below this comment are not yet exposed as API 702 703 /** 704 * Set of Activities parsed from the manifest. 705 * <p> 706 * This contains minimal system state and does not 707 * provide the same information as {@link ActivityInfo}. Effective state can be queried through 708 * {@link android.content.pm.PackageManager#getActivityInfo(ComponentName, int)} or by 709 * combining state from from com.android.server.pm.pkg.PackageState and 710 * {@link PackageUserState}. 711 * 712 * @see ActivityInfo 713 * @see PackageInfo#activities 714 * @see R.styleable#AndroidManifestActivity 715 * @hide 716 */ 717 @Immutable.Ignore 718 @NonNull getActivities()719 List<ParsedActivity> getActivities(); 720 721 /** 722 * The names of packages to adopt ownership of permissions from, parsed under {@link 723 * ParsingPackageUtils#TAG_ADOPT_PERMISSIONS}. 724 * 725 * @see R.styleable#AndroidManifestAdoptPermissions_name 726 * @hide 727 */ 728 @NonNull getAdoptPermissions()729 List<String> getAdoptPermissions(); 730 731 /** 732 * @see R.styleable#AndroidManifestApexSystemService 733 * @hide 734 */ 735 @Immutable.Ignore 736 @NonNull getApexSystemServices()737 List<ParsedApexSystemService> getApexSystemServices(); 738 739 /** 740 * @see R.styleable#AndroidManifestAttribution 741 * @hide 742 */ 743 @Immutable.Ignore 744 @NonNull getAttributions()745 List<ParsedAttribution> getAttributions(); 746 747 /** 748 * @see ApplicationInfo#AUTO_REVOKE_ALLOWED 749 * @see ApplicationInfo#AUTO_REVOKE_DISCOURAGED 750 * @see ApplicationInfo#AUTO_REVOKE_DISALLOWED 751 * @see R.styleable#AndroidManifestApplication_autoRevokePermissions 752 * @hide 753 */ getAutoRevokePermissions()754 int getAutoRevokePermissions(); 755 756 /** 757 * @see ApplicationInfo#sourceDir 758 * @see ApplicationInfo#getBaseCodePath 759 * 760 * @deprecated Use {@link #getSplits()}[0].{@link AndroidPackageSplit#getPath() getPath()} 761 * 762 * @hide 763 */ 764 @Deprecated 765 @NonNull getBaseApkPath()766 String getBaseApkPath(); 767 768 /** 769 * @see ApplicationInfo#compileSdkVersion 770 * @see R.styleable#AndroidManifest_compileSdkVersion 771 * @hide 772 */ getCompileSdkVersion()773 int getCompileSdkVersion(); 774 775 /** 776 * @see ApplicationInfo#compileSdkVersionCodename 777 * @see R.styleable#AndroidManifest_compileSdkVersionCodename 778 * @hide 779 */ 780 @Nullable getCompileSdkVersionCodeName()781 String getCompileSdkVersionCodeName(); 782 783 /** 784 * @see PackageInfo#configPreferences 785 * @see R.styleable#AndroidManifestUsesConfiguration 786 * @hide 787 */ 788 @Immutable.Ignore 789 @NonNull getConfigPreferences()790 List<ConfigurationInfo> getConfigPreferences(); 791 792 /** 793 * @see PackageInfo#featureGroups 794 * @see R.styleable#AndroidManifestUsesFeature 795 * @hide 796 */ 797 @Immutable.Ignore 798 @NonNull getFeatureGroups()799 List<FeatureGroupInfo> getFeatureGroups(); 800 801 /** 802 * Permissions requested but not in the manifest. These may have been split or migrated from 803 * previous versions/definitions. 804 * @hide 805 */ 806 @NonNull getImplicitPermissions()807 Set<String> getImplicitPermissions(); 808 809 /** 810 * @see ApplicationInfo#installLocation 811 * @see R.styleable#AndroidManifest_installLocation 812 * @hide 813 */ getInstallLocation()814 int getInstallLocation(); 815 816 /** 817 * @see InstrumentationInfo 818 * @see PackageInfo#instrumentation 819 * @see R.styleable#AndroidManifestInstrumentation 820 * @hide 821 */ 822 @Immutable.Ignore 823 @NonNull getInstrumentations()824 List<ParsedInstrumentation> getInstrumentations(); 825 826 /** 827 * For use with {@link com.android.server.pm.KeySetManagerService}. Parsed in {@link 828 * ParsingPackageUtils#TAG_KEY_SETS}. 829 * 830 * @see R.styleable#AndroidManifestKeySet 831 * @see R.styleable#AndroidManifestPublicKey 832 * @hide 833 */ 834 @Immutable.Ignore 835 @NonNull getKeySetMapping()836 Map<String, ArraySet<PublicKey>> getKeySetMapping(); 837 838 /** 839 * @see ApplicationInfo#mKnownActivityEmbeddingCerts 840 * @see R.styleable#AndroidManifestApplication_knownActivityEmbeddingCerts 841 * @hide 842 */ 843 @SuppressWarnings("JavadocReference") 844 @NonNull getKnownActivityEmbeddingCerts()845 Set<String> getKnownActivityEmbeddingCerts(); 846 847 /** 848 * @see ApplicationInfo#manageSpaceActivityName 849 * @see R.styleable#AndroidManifestApplication_manageSpaceActivity 850 * @hide 851 */ 852 @Nullable getManageSpaceActivityName()853 String getManageSpaceActivityName(); 854 855 /** 856 * The package name as declared in the manifest, since the package can be renamed. For example, 857 * static shared libs use synthetic package names. 858 * @hide 859 */ 860 @NonNull getManifestPackageName()861 String getManifestPackageName(); 862 863 /** 864 * @see R.styleable#AndroidManifestUsesSdk_maxSdkVersion 865 * @hide 866 */ getMaxSdkVersion()867 int getMaxSdkVersion(); 868 869 /** 870 * @see ApplicationInfo#getMemtagMode() 871 * @see R.styleable#AndroidManifestApplication_memtagMode 872 * @hide 873 */ 874 @ApplicationInfo.MemtagMode getMemtagMode()875 int getMemtagMode(); 876 877 /** 878 * @see ApplicationInfo#getPageSizeAppCompatFlags() 879 * @see R.styleable#AndroidManifestApplication_pageSizeCompat 880 * @hide 881 */ 882 @ApplicationInfo.PageSizeAppCompatFlags getPageSizeAppCompatFlags()883 int getPageSizeAppCompatFlags(); 884 885 /** 886 * TODO(b/135203078): Make all the Bundles immutable (and non-null by shared empty reference?) 887 * @see R.styleable#AndroidManifestMetaData 888 * @hide 889 */ 890 @Immutable.Ignore 891 @Nullable getMetaData()892 Bundle getMetaData(); 893 894 /** 895 * @see R.attr#mimeGroup 896 * @hide 897 */ 898 @Nullable getMimeGroups()899 Set<String> getMimeGroups(); 900 901 /** 902 * @see R.styleable#AndroidManifestExtensionSdk 903 * @hide 904 */ 905 @Immutable.Ignore 906 @Nullable getMinExtensionVersions()907 SparseIntArray getMinExtensionVersions(); 908 909 /** 910 * @see ApplicationInfo#minSdkVersion 911 * @see R.styleable#AndroidManifestUsesSdk_minSdkVersion 912 * @hide 913 */ getMinSdkVersion()914 int getMinSdkVersion(); 915 916 /** 917 * @see ApplicationInfo#nativeLibraryDir 918 * @hide 919 */ 920 @Nullable getNativeLibraryDir()921 String getNativeLibraryDir(); 922 923 /** 924 * @see ApplicationInfo#nativeLibraryRootDir 925 * @hide 926 */ 927 @Nullable getNativeLibraryRootDir()928 String getNativeLibraryRootDir(); 929 930 /** 931 * If {@link R.styleable#AndroidManifestApplication_label} is a string literal, this is it. 932 * Otherwise, it's stored as {@link #getLabelResourceId()}. 933 * 934 * @see ApplicationInfo#nonLocalizedLabel 935 * @see R.styleable#AndroidManifestApplication_label 936 * @hide 937 */ 938 @Nullable getNonLocalizedLabel()939 CharSequence getNonLocalizedLabel(); 940 941 /** 942 * For system use to migrate from an old package name to a new one, moving over data if 943 * available. 944 * 945 * @see R.styleable#AndroidManifestOriginalPackage 946 * @hide 947 */ 948 @NonNull getOriginalPackages()949 List<String> getOriginalPackages(); 950 951 /** 952 * @see PackageInfo#overlayCategory 953 * @see R.styleable#AndroidManifestResourceOverlay_category 954 * @hide 955 */ 956 @Nullable getOverlayCategory()957 String getOverlayCategory(); 958 959 /** 960 * @see PackageInfo#overlayPriority 961 * @see R.styleable#AndroidManifestResourceOverlay_priority 962 * @hide 963 */ getOverlayPriority()964 int getOverlayPriority(); 965 966 /** 967 * @see PackageInfo#overlayTarget 968 * @see R.styleable#AndroidManifestResourceOverlay_targetPackage 969 * @hide 970 */ 971 @Nullable getOverlayTarget()972 String getOverlayTarget(); 973 974 /** 975 * @see PackageInfo#targetOverlayableName 976 * @see R.styleable#AndroidManifestResourceOverlay_targetName 977 * @hide 978 */ 979 @Nullable getOverlayTargetOverlayableName()980 String getOverlayTargetOverlayableName(); 981 982 /** 983 * Map of overlayable name to actor name. 984 * @hide 985 */ 986 @NonNull getOverlayables()987 Map<String, String> getOverlayables(); 988 989 /** 990 * @see PackageInfo#packageName 991 * @hide 992 */ getPackageName()993 String getPackageName(); 994 995 /** 996 * @see ApplicationInfo#scanSourceDir 997 * @see ApplicationInfo#getCodePath 998 * @hide 999 */ 1000 @NonNull getPath()1001 String getPath(); 1002 1003 /** 1004 * @see ApplicationInfo#permission 1005 * @see R.styleable#AndroidManifestApplication_permission 1006 * @hide 1007 */ 1008 @Nullable getPermission()1009 String getPermission(); 1010 1011 /** 1012 * @see android.content.pm.PermissionGroupInfo 1013 * @see R.styleable#AndroidManifestPermissionGroup 1014 * @hide 1015 */ 1016 @Immutable.Ignore 1017 @NonNull getPermissionGroups()1018 List<ParsedPermissionGroup> getPermissionGroups(); 1019 1020 /** 1021 * @see PermissionInfo 1022 * @see PackageInfo#permissions 1023 * @hide 1024 */ 1025 @Immutable.Ignore 1026 @NonNull getPermissions()1027 List<ParsedPermission> getPermissions(); 1028 1029 /** 1030 * Used to determine the default preferred handler of an {@link Intent}. 1031 * <p> 1032 * Map of component className to intent info inside that component. TODO(b/135203078): Is this 1033 * actually used/working? 1034 * @hide 1035 */ 1036 @Immutable.Ignore 1037 @NonNull getPreferredActivityFilters()1038 List<Pair<String, ParsedIntentInfo>> getPreferredActivityFilters(); 1039 1040 /** 1041 * @see ApplicationInfo#processName 1042 * @see R.styleable#AndroidManifestApplication_process 1043 * @hide 1044 */ 1045 @NonNull getProcessName()1046 String getProcessName(); 1047 1048 /** 1049 * @see android.content.pm.ProcessInfo 1050 * @see R.styleable#AndroidManifestProcess 1051 * @hide 1052 */ 1053 @Immutable.Ignore 1054 @NonNull getProcesses()1055 Map<String, ParsedProcess> getProcesses(); 1056 1057 /** 1058 * Returns the properties set on the application 1059 * @see R.styleable#AndroidManifestProperty 1060 * @hide 1061 */ 1062 @Immutable.Ignore 1063 @NonNull getProperties()1064 Map<String, PackageManager.Property> getProperties(); 1065 1066 /** 1067 * System protected broadcasts. 1068 * 1069 * @see R.styleable#AndroidManifestProtectedBroadcast 1070 * @hide 1071 */ 1072 @NonNull getProtectedBroadcasts()1073 List<String> getProtectedBroadcasts(); 1074 1075 /** 1076 * Set of {@link android.content.ContentProvider ContentProviders} parsed from the manifest. 1077 * <p> 1078 * This contains minimal system state and does not 1079 * provide the same information as {@link ProviderInfo}. Effective state can be queried through 1080 * {@link PackageManager#getProviderInfo(ComponentName, int)} or by 1081 * combining state from from com.android.server.pm.pkg.PackageState and 1082 * {@link PackageUserState}. 1083 * 1084 * @see ProviderInfo 1085 * @see PackageInfo#providers 1086 * @see R.styleable#AndroidManifestProvider 1087 * @hide 1088 */ 1089 @Immutable.Ignore 1090 @NonNull getProviders()1091 List<ParsedProvider> getProviders(); 1092 1093 /** 1094 * Intents that this package may query or require and thus requires visibility into. 1095 * 1096 * @see R.styleable#AndroidManifestQueriesIntent 1097 * @hide 1098 */ 1099 @Immutable.Ignore 1100 @NonNull getQueriesIntents()1101 List<Intent> getQueriesIntents(); 1102 1103 /** 1104 * Other packages that this package may query or require and thus requires visibility into. 1105 * 1106 * @see R.styleable#AndroidManifestQueriesPackage 1107 * @hide 1108 */ 1109 @NonNull getQueriesPackages()1110 List<String> getQueriesPackages(); 1111 1112 /** 1113 * Authorities that this package may query or require and thus requires visibility into. 1114 * 1115 * @see R.styleable#AndroidManifestQueriesProvider 1116 * @hide 1117 */ 1118 @NonNull getQueriesProviders()1119 Set<String> getQueriesProviders(); 1120 1121 /** 1122 * Set of {@link android.content.BroadcastReceiver BroadcastReceivers} parsed from the manifest. 1123 * <p> 1124 * This contains minimal system state and does not 1125 * provide the same information as {@link ActivityInfo}. Effective state can be queried through 1126 * {@link PackageManager#getReceiverInfo(ComponentName, int)} or by 1127 * combining state from from com.android.server.pm.pkg.PackageState and 1128 * {@link PackageUserState}. 1129 * <p> 1130 * Since they share several attributes, receivers are parsed as {@link ParsedActivity}, even 1131 * though they represent different functionality. 1132 * <p> 1133 * TODO(b/135203078): Reconsider this and maybe make ParsedReceiver so it's not so confusing 1134 * 1135 * @see ActivityInfo 1136 * @see PackageInfo#receivers 1137 * @see R.styleable#AndroidManifestReceiver 1138 * @hide 1139 */ 1140 @Immutable.Ignore 1141 @NonNull getReceivers()1142 List<ParsedActivity> getReceivers(); 1143 1144 /** 1145 * @see PackageInfo#reqFeatures 1146 * @see R.styleable#AndroidManifestUsesFeature 1147 * @hide 1148 */ 1149 @Immutable.Ignore 1150 @NonNull getRequestedFeatures()1151 List<FeatureInfo> getRequestedFeatures(); 1152 1153 /** 1154 * All the permissions declared. This is an effective set, and may include permissions 1155 * transformed from split/migrated permissions from previous versions, so may not be exactly 1156 * what the package declares in its manifest. 1157 * 1158 * @see PackageInfo#requestedPermissions 1159 * @see R.styleable#AndroidManifestUsesPermission 1160 * @hide 1161 */ 1162 @NonNull getRequestedPermissions()1163 Set<String> getRequestedPermissions(); 1164 1165 /** 1166 * Whether or not the app requested explicitly resizeable Activities. Null value means nothing 1167 * was explicitly requested. 1168 * 1169 * @see ApplicationInfo#PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE 1170 * @see ApplicationInfo#PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_UNRESIZEABLE 1171 * @see R.styleable#AndroidManifestApplication_resizeableActivity 1172 * @hide 1173 */ 1174 @Nullable getResizeableActivity()1175 Boolean getResizeableActivity(); 1176 1177 /** 1178 * SHA-512 hash of the only APK that can be used to update a system package. 1179 * 1180 * @see R.styleable#AndroidManifestRestrictUpdate 1181 * @hide 1182 */ 1183 @Immutable.Ignore 1184 @Nullable getRestrictUpdateHash()1185 byte[] getRestrictUpdateHash(); 1186 1187 /** 1188 * @see R.styleable#AndroidManifestSdkLibrary_versionMajor 1189 * @hide 1190 */ getSdkLibVersionMajor()1191 int getSdkLibVersionMajor(); 1192 1193 /** 1194 * @see ApplicationInfo#secondaryNativeLibraryDir 1195 * @hide 1196 */ 1197 @Nullable getSecondaryNativeLibraryDir()1198 String getSecondaryNativeLibraryDir(); 1199 1200 /** 1201 * Set of {@link android.app.Service Services} parsed from the manifest. 1202 * <p> 1203 * This contains minimal system state and does not 1204 * provide the same information as {@link ServiceInfo}. Effective state can be queried through 1205 * {@link PackageManager#getServiceInfo(ComponentName, int)} or by 1206 * combining state from from com.android.server.pm.pkg.PackageState and 1207 * {@link PackageUserState}. 1208 * 1209 * @see ServiceInfo 1210 * @see PackageInfo#services 1211 * @see R.styleable#AndroidManifestService 1212 * @hide 1213 */ 1214 @Immutable.Ignore 1215 @NonNull getServices()1216 List<ParsedService> getServices(); 1217 1218 /** 1219 * The signature data of all APKs in this package, which must be exactly the same across the 1220 * base and splits. 1221 * @hide 1222 */ 1223 @Immutable.Ignore 1224 @NonNull getSigningDetails()1225 SigningDetails getSigningDetails(); 1226 1227 /** 1228 * @see ApplicationInfo#splitClassLoaderNames 1229 * @see R.styleable#AndroidManifestApplication_classLoader 1230 * @hide 1231 */ 1232 @Immutable.Ignore 1233 @Nullable getSplitClassLoaderNames()1234 String[] getSplitClassLoaderNames(); 1235 1236 /** 1237 * @see ApplicationInfo#splitSourceDirs 1238 * @see ApplicationInfo#getSplitCodePaths 1239 * @hide 1240 */ 1241 @Immutable.Ignore 1242 @NonNull getSplitCodePaths()1243 String[] getSplitCodePaths(); 1244 1245 /** 1246 * @see ApplicationInfo#splitDependencies 1247 * @hide 1248 */ 1249 @Immutable.Ignore 1250 @NonNull getSplitDependencies()1251 SparseArray<int[]> getSplitDependencies(); 1252 1253 /** 1254 * Flags of any split APKs; ordered by parsed splitName 1255 * @hide 1256 */ 1257 @Immutable.Ignore 1258 @Nullable getSplitFlags()1259 int[] getSplitFlags(); 1260 1261 /** 1262 * TODO(b/135203078): Move split stuff to an inner data class 1263 * 1264 * @see ApplicationInfo#splitNames 1265 * @see PackageInfo#splitNames 1266 * @hide 1267 */ 1268 @Immutable.Ignore 1269 @NonNull getSplitNames()1270 String[] getSplitNames(); 1271 1272 /** 1273 * @see PackageInfo#splitRevisionCodes 1274 * @hide 1275 */ 1276 @Immutable.Ignore 1277 @NonNull getSplitRevisionCodes()1278 int[] getSplitRevisionCodes(); 1279 1280 /** 1281 * @see ApplicationInfo#targetSandboxVersion 1282 * @see R.styleable#AndroidManifest_targetSandboxVersion 1283 * @hide 1284 */ getTargetSandboxVersion()1285 int getTargetSandboxVersion(); 1286 1287 /** 1288 * @see ApplicationInfo#taskAffinity 1289 * @see R.styleable#AndroidManifestApplication_taskAffinity 1290 * @hide 1291 */ 1292 @Nullable getTaskAffinity()1293 String getTaskAffinity(); 1294 1295 /** 1296 * This is an appId, the {@link ApplicationInfo#uid} if the user ID is 1297 * {@link android.os.UserHandle#SYSTEM}. 1298 * 1299 * @deprecated Use {@link PackageState#getAppId()} instead. 1300 * @hide 1301 */ 1302 @Deprecated getUid()1303 int getUid(); 1304 1305 /** 1306 * For use with {@link com.android.server.pm.KeySetManagerService}. Parsed in {@link 1307 * ParsingPackageUtils#TAG_KEY_SETS}. 1308 * 1309 * @see R.styleable#AndroidManifestUpgradeKeySet 1310 * @hide 1311 */ 1312 @NonNull getUpgradeKeySets()1313 Set<String> getUpgradeKeySets(); 1314 1315 /** 1316 * @see R.styleable#AndroidManifestUsesLibrary 1317 * @hide 1318 */ 1319 @NonNull getUsesLibraries()1320 List<String> getUsesLibraries(); 1321 1322 /** 1323 * @see R.styleable#AndroidManifestUsesNativeLibrary 1324 * @hide 1325 */ 1326 @NonNull getUsesNativeLibraries()1327 List<String> getUsesNativeLibraries(); 1328 1329 /** 1330 * Like {@link #getUsesLibraries()}, but marked optional by setting {@link 1331 * R.styleable#AndroidManifestUsesLibrary_required} to false . Application is expected to handle 1332 * absence manually. 1333 * 1334 * @see R.styleable#AndroidManifestUsesLibrary 1335 * @hide 1336 */ 1337 @NonNull getUsesOptionalLibraries()1338 List<String> getUsesOptionalLibraries(); 1339 1340 /** 1341 * Like {@link #getUsesNativeLibraries()}, but marked optional by setting {@link 1342 * R.styleable#AndroidManifestUsesNativeLibrary_required} to false . Application is expected to 1343 * handle absence manually. 1344 * 1345 * @see R.styleable#AndroidManifestUsesNativeLibrary 1346 * @hide 1347 */ 1348 @NonNull getUsesOptionalNativeLibraries()1349 List<String> getUsesOptionalNativeLibraries(); 1350 1351 /** @hide */ 1352 @Immutable.Ignore 1353 @NonNull getUsesPermissions()1354 List<ParsedUsesPermission> getUsesPermissions(); 1355 1356 /** 1357 * TODO(b/135203078): Move SDK library stuff to an inner data class 1358 * 1359 * @see R.styleable#AndroidManifestUsesSdkLibrary 1360 * @hide 1361 */ 1362 @NonNull getUsesSdkLibraries()1363 List<String> getUsesSdkLibraries(); 1364 1365 /** 1366 * @see R.styleable#AndroidManifestUsesSdkLibrary_certDigest 1367 * @hide 1368 */ 1369 @Immutable.Ignore 1370 @Nullable getUsesSdkLibrariesCertDigests()1371 String[][] getUsesSdkLibrariesCertDigests(); 1372 1373 /** 1374 * @see R.styleable#AndroidManifestUsesSdkLibrary_versionMajor 1375 * @hide 1376 */ 1377 @Immutable.Ignore 1378 @Nullable getUsesSdkLibrariesVersionsMajor()1379 long[] getUsesSdkLibrariesVersionsMajor(); 1380 1381 1382 /** 1383 * @see R.styleable#AndroidManifestUsesSdkLibrary_optional 1384 * @hide 1385 */ 1386 @Immutable.Ignore 1387 @Nullable getUsesSdkLibrariesOptional()1388 boolean[] getUsesSdkLibrariesOptional(); 1389 1390 /** 1391 * TODO(b/135203078): Move static library stuff to an inner data class 1392 * 1393 * @see R.styleable#AndroidManifestUsesStaticLibrary 1394 * @hide 1395 */ 1396 @NonNull getUsesStaticLibraries()1397 List<String> getUsesStaticLibraries(); 1398 1399 /** 1400 * @see R.styleable#AndroidManifestUsesStaticLibrary_certDigest 1401 * @hide 1402 */ 1403 @Immutable.Ignore 1404 @Nullable getUsesStaticLibrariesCertDigests()1405 String[][] getUsesStaticLibrariesCertDigests(); 1406 1407 /** 1408 * @see R.styleable#AndroidManifestUsesStaticLibrary_version 1409 * @hide 1410 */ 1411 @Immutable.Ignore 1412 @Nullable getUsesStaticLibrariesVersions()1413 long[] getUsesStaticLibrariesVersions(); 1414 1415 /** 1416 * @see ApplicationInfo#volumeUuid 1417 * @hide 1418 */ 1419 @Nullable getVolumeUuid()1420 String getVolumeUuid(); 1421 1422 /** @hide */ hasPreserveLegacyExternalStorage()1423 boolean hasPreserveLegacyExternalStorage(); 1424 1425 /** 1426 * @see ApplicationInfo#PRIVATE_FLAG_EXT_REQUEST_FOREGROUND_SERVICE_EXEMPTION 1427 * @see R.styleable#AndroidManifestApplication_requestForegroundServiceExemption 1428 * @hide 1429 */ hasRequestForegroundServiceExemption()1430 boolean hasRequestForegroundServiceExemption(); 1431 1432 /** 1433 * @see ApplicationInfo#getRequestRawExternalStorageAccess() 1434 * @see R.styleable#AndroidManifestApplication_requestRawExternalStorageAccess 1435 * @hide 1436 */ hasRequestRawExternalStorageAccess()1437 Boolean hasRequestRawExternalStorageAccess(); 1438 1439 /** @hide */ isApex()1440 boolean isApex(); 1441 1442 1443 /** 1444 * @see R.styleable#AndroidManifestApplication_updatableSystem 1445 * @hide 1446 */ isUpdatableSystem()1447 boolean isUpdatableSystem(); 1448 1449 /** 1450 * @see ApplicationInfo#enabled 1451 * @see R.styleable#AndroidManifestApplication_enabled 1452 * @hide 1453 */ isEnabled()1454 boolean isEnabled(); 1455 1456 /** 1457 * @see ApplicationInfo#FLAG_EXTERNAL_STORAGE 1458 * @hide 1459 */ isExternalStorage()1460 boolean isExternalStorage(); 1461 1462 /** 1463 * @see ApplicationInfo#FLAG_IS_GAME 1464 * @see R.styleable#AndroidManifestApplication_isGame 1465 * @hide 1466 * @deprecated 1467 */ 1468 @Deprecated isGame()1469 boolean isGame(); 1470 1471 /** 1472 * @see ApplicationInfo#PRIVATE_FLAG_HAS_DOMAIN_URLS 1473 * @see R.styleable#AndroidManifestIntentFilter 1474 * @hide 1475 */ isHasDomainUrls()1476 boolean isHasDomainUrls(); 1477 1478 /** 1479 * @see PackageInfo#mOverlayIsStatic 1480 * @hide 1481 */ isOverlayIsStatic()1482 boolean isOverlayIsStatic(); 1483 1484 /** 1485 * @see ApplicationInfo#PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE 1486 * @see R.styleable#AndroidManifestActivity_directBootAware 1487 * @see R.styleable#AndroidManifestProvider_directBootAware 1488 * @see R.styleable#AndroidManifestReceiver_directBootAware 1489 * @see R.styleable#AndroidManifestService_directBootAware 1490 * @hide 1491 */ isPartiallyDirectBootAware()1492 boolean isPartiallyDirectBootAware(); 1493 1494 /** 1495 * If omitted from manifest, returns true if {@link #getTargetSdkVersion()} >= {@link 1496 * android.os.Build.VERSION_CODES#DONUT}. 1497 * 1498 * @see R.styleable#AndroidManifestSupportsScreens_resizeable 1499 * @see ApplicationInfo#FLAG_RESIZEABLE_FOR_SCREENS 1500 * @hide 1501 */ isResizeable()1502 boolean isResizeable(); 1503 1504 /** 1505 * @see ApplicationInfo#PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION 1506 * @see R.styleable#AppWidgetProviderInfo_resizeMode 1507 * @hide 1508 */ isResizeableActivityViaSdkVersion()1509 boolean isResizeableActivityViaSdkVersion(); 1510 1511 /** 1512 * True means that this package/app contains an SDK library. 1513 * @see R.styleable#AndroidManifestSdkLibrary 1514 * @hide 1515 */ isSdkLibrary()1516 boolean isSdkLibrary(); 1517 1518 /** 1519 * @see ApplicationInfo#PRIVATE_FLAG_STATIC_SHARED_LIBRARY 1520 * @see R.styleable#AndroidManifestStaticLibrary 1521 * @hide 1522 */ isStaticSharedLibrary()1523 boolean isStaticSharedLibrary(); 1524 1525 /** 1526 * @see PackageInfo#isStub 1527 * @hide 1528 */ isStub()1529 boolean isStub(); 1530 1531 /** 1532 * Set if the any of components are visible to instant applications. 1533 * 1534 * @see R.styleable#AndroidManifestActivity_visibleToInstantApps 1535 * @see R.styleable#AndroidManifestProvider_visibleToInstantApps 1536 * @see R.styleable#AndroidManifestService_visibleToInstantApps 1537 * @hide 1538 */ isVisibleToInstantApps()1539 boolean isVisibleToInstantApps(); 1540 1541 /** 1542 * @see ApplicationInfo#allowCrossUidActivitySwitchFromBelow 1543 * @see R.styleable#AndroidManifestApplication_allowCrossUidActivitySwitchFromBelow 1544 * @hide 1545 */ isAllowCrossUidActivitySwitchFromBelow()1546 boolean isAllowCrossUidActivitySwitchFromBelow(); 1547 1548 /** 1549 * Returns the intent matching flags. 1550 * @hide 1551 */ getIntentMatchingFlags()1552 int getIntentMatchingFlags(); 1553 } 1554