Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f67b9567 authored by Winson's avatar Winson
Browse files

Rename PackageState APIs from feedback

Documents tags for PackageState#getSharedLibraryDependencies,
adjusts "Res" suffixes to "ResourceId", and fixes boolean methods
to be more grammatically correct.

API-Coverage-Bug: 262593427

Bug: 268258907

Test: AndroidPackageTest

Change-Id: I929ce45b1e7fce6c1af8c2994f57045528958ec1
parent 96c2a6b2
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -679,8 +679,9 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
    public static final int PRIVATE_FLAG_PROFILEABLE_BY_SHELL = 1 << 23;

    /**
     * Indicates whether this package requires access to non-SDK APIs.
     * Only system apps and tests are allowed to use this property.
     * Indicates whether this application has declared its user data as fragile,
     * causing the system to prompt the user on whether to keep the user data
     * on uninstall.
     * @hide
     */
    public static final int PRIVATE_FLAG_HAS_FRAGILE_USER_DATA = 1 << 24;
+29 −29
Original line number Diff line number Diff line
@@ -85,69 +85,72 @@ package com.android.server.pm.pkg {
    method @Nullable public String getAppComponentFactory();
    method @Nullable public String getApplicationClassName();
    method @Nullable public String getBackupAgentName();
    method @DrawableRes public int getBannerRes();
    method @DrawableRes public int getBannerResourceId();
    method public int getBaseRevisionCode();
    method public int getCategory();
    method @Nullable public String getClassLoaderName();
    method @Dimension(unit=android.annotation.Dimension.DP) public int getCompatibleWidthLimitDp();
    method @XmlRes public int getDataExtractionRulesRes();
    method @StringRes public int getDescriptionRes();
    method @XmlRes public int getFullBackupContentRes();
    method @XmlRes public int getDataExtractionRulesResourceId();
    method @StringRes public int getDescriptionResourceId();
    method @XmlRes public int getFullBackupContentResourceId();
    method public int getGwpAsanMode();
    method @DrawableRes public int getIconRes();
    method @StringRes public int getLabelRes();
    method @DrawableRes public int getIconResourceId();
    method @StringRes public int getLabelResourceId();
    method @Dimension(unit=android.annotation.Dimension.DP) public int getLargestWidthLimitDp();
    method @NonNull public java.util.List<java.lang.String> getLibraryNames();
    method @XmlRes public int getLocaleConfigRes();
    method @DrawableRes public int getLogoRes();
    method @XmlRes public int getLocaleConfigResourceId();
    method @DrawableRes public int getLogoResourceId();
    method public long getLongVersionCode();
    method public float getMaxAspectRatio();
    method public float getMinAspectRatio();
    method public int getNativeHeapZeroInitialized();
    method @XmlRes public int getNetworkSecurityConfigRes();
    method @XmlRes public int getNetworkSecurityConfigResourceId();
    method @Nullable public String getRequiredAccountType();
    method @Dimension(unit=android.annotation.Dimension.DP) public int getRequiresSmallestWidthDp();
    method @Nullable public String getRestrictedAccountType();
    method @DrawableRes public int getRoundIconRes();
    method @DrawableRes public int getRoundIconResourceId();
    method @Nullable public String getSdkLibraryName();
    method @Nullable public String getSharedUserId();
    method @StringRes public int getSharedUserLabelRes();
    method @StringRes public int getSharedUserLabelResourceId();
    method @NonNull public java.util.List<com.android.server.pm.pkg.AndroidPackageSplit> getSplits();
    method @Nullable public String getStaticSharedLibraryName();
    method @NonNull public java.util.UUID getStorageUuid();
    method public int getTargetSdkVersion();
    method @StyleRes public int getThemeRes();
    method @StyleRes public int getThemeResourceId();
    method public int getUiOptions();
    method @Nullable public String getVersionName();
    method @Nullable public String getZygotePreloadName();
    method public boolean is32BitAbiPreferred();
    method public boolean isAllowAudioPlaybackCapture();
    method public boolean isAllowBackup();
    method public boolean isAllowClearUserData();
    method public boolean isAllowClearUserDataOnFailedRestore();
    method public boolean isAllowNativeHeapPointerTagging();
    method public boolean isAllowTaskReparenting();
    method public boolean isAnyDensity();
    method public boolean isAttributionsUserVisible();
    method public boolean isBackupAllowed();
    method public boolean isBackupInForeground();
    method public boolean isCantSaveState();
    method public boolean isClearUserDataAllowed();
    method public boolean isClearUserDataOnFailedRestoreAllowed();
    method public boolean isCleartextTrafficAllowed();
    method public boolean isCoreApp();
    method public boolean isCrossProfile();
    method public boolean isDebuggable();
    method public boolean isDeclaredHavingCode();
    method public boolean isDefaultToDeviceProtectedStorage();
    method public boolean isDirectBootAware();
    method public boolean isExtractNativeLibs();
    method public boolean isExtraLargeScreensSupported();
    method public boolean isExtractNativeLibrariesRequested();
    method public boolean isFactoryTest();
    method public boolean isForceQueryable();
    method public boolean isFullBackupOnly();
    method public boolean isHardwareAccelerated();
    method public boolean isHasCode();
    method public boolean isHasFragileUserData();
    method public boolean isIsolatedSplitLoading();
    method public boolean isKillAfterRestore();
    method public boolean isKillAfterRestoreAllowed();
    method public boolean isLargeHeap();
    method public boolean isLargeScreensSupported();
    method public boolean isLeavingSharedUser();
    method public boolean isMultiArch();
    method public boolean isNativeLibraryRootRequiresIsa();
    method public boolean isNonSdkApiRequested();
    method public boolean isNormalScreensSupported();
    method public boolean isOnBackInvokedCallbackEnabled();
    method public boolean isPersistent();
    method public boolean isProfileable();
@@ -157,17 +160,14 @@ package com.android.server.pm.pkg {
    method public boolean isResetEnabledSettingsOnAppDataCleared();
    method public boolean isResourceOverlay();
    method public boolean isRestoreAnyVersion();
    method public boolean isRtlSupported();
    method public boolean isSaveStateDisallowed();
    method public boolean isSignedWithPlatformKey();
    method public boolean isSupportsExtraLargeScreens();
    method public boolean isSupportsLargeScreens();
    method public boolean isSupportsNormalScreens();
    method public boolean isSupportsRtl();
    method public boolean isSupportsSmallScreens();
    method public boolean isSmallScreensSupported();
    method public boolean isTaskReparentingAllowed();
    method public boolean isTestOnly();
    method public boolean isUse32BitAbi();
    method public boolean isUseEmbeddedDex();
    method public boolean isUsesCleartextTraffic();
    method public boolean isUsesNonSdkApi();
    method public boolean isUserDataFragile();
    method public boolean isVmSafeMode();
  }

+3 −2
Original line number Diff line number Diff line
@@ -388,7 +388,7 @@ final class PackageAbiHelperImpl implements PackageAbiHelper {
                if (abi32 >= 0) {
                    final String abi = Build.SUPPORTED_32_BIT_ABIS[abi32];
                    if (abi64 >= 0) {
                        if (pkg.isUse32BitAbi()) {
                        if (pkg.is32BitAbiPreferred()) {
                            secondaryCpuAbi = primaryCpuAbi;
                            primaryCpuAbi = abi;
                        } else {
@@ -474,7 +474,8 @@ final class PackageAbiHelperImpl implements PackageAbiHelper {
    private boolean shouldExtractLibs(AndroidPackage pkg, boolean isSystemApp,
            boolean isUpdatedSystemApp) {
        // We shouldn't extract libs if the package is a library or if extractNativeLibs=false
        boolean extractLibs = !AndroidPackageUtils.isLibrary(pkg) && pkg.isExtractNativeLibs();
        boolean extractLibs = !AndroidPackageUtils.isLibrary(pkg)
                && pkg.isExtractNativeLibrariesRequested();
        // We shouldn't attempt to extract libs from system app when it was not updated.
        if (isSystemApp && !isUpdatedSystemApp) {
            extractLibs = false;
+2 −2
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ public class PackageDexOptimizer {
        }

        // We do not dexopt a package with no code.
        if (!pkg.isHasCode()) {
        if (!pkg.isDeclaredHavingCode()) {
            return false;
        }

@@ -287,7 +287,7 @@ public class PackageDexOptimizer {
        // For each code path in the package, this array contains the class loader context that
        // needs to be passed to dexopt in order to ensure correct optimizations.
        boolean[] pathsWithCode = new boolean[paths.size()];
        pathsWithCode[0] = pkg.isHasCode();
        pathsWithCode[0] = pkg.isDeclaredHavingCode();
        for (int i = 1; i < paths.size(); i++) {
            pathsWithCode[i] = (pkg.getSplitFlags()[i - 1] & ApplicationInfo.FLAG_HAS_CODE) != 0;
        }
+1 −1
Original line number Diff line number Diff line
@@ -545,7 +545,7 @@ final class ScanPackageUtils {
     */
    public static void assertCodePolicy(AndroidPackage pkg)
            throws PackageManagerException {
        final boolean shouldHaveCode = pkg.isHasCode();
        final boolean shouldHaveCode = pkg.isDeclaredHavingCode();
        if (shouldHaveCode && !apkHasCode(pkg.getBaseApkPath())) {
            throw new PackageManagerException(INSTALL_FAILED_INVALID_APK,
                    "Package " + pkg.getBaseApkPath() + " code is missing");
Loading