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

Commit e64ba8b4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "fragileUserData-apps might keep data on uninstall"

parents 485577cb ae4a4b98
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -704,6 +704,7 @@ package android {
    field public static final int hapticFeedbackEnabled = 16843358; // 0x101025e
    field public static final int hardwareAccelerated = 16843475; // 0x10102d3
    field public static final int hasCode = 16842764; // 0x101000c
    field public static final int hasFragileUserData = 16844192; // 0x10105a0
    field public static final deprecated int headerAmPmTextAppearance = 16843936; // 0x10104a0
    field public static final int headerBackground = 16843055; // 0x101012f
    field public static final deprecated int headerDayOfMonthTextAppearance = 16843927; // 0x1010497
+19 −0
Original line number Diff line number Diff line
@@ -631,6 +631,13 @@ 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.
     * @hide
     */
    public static final int PRIVATE_FLAG_HAS_FRAGILE_USER_DATA = 1 << 24;

    /** @hide */
    @IntDef(flag = true, prefix = { "PRIVATE_FLAG_" }, value = {
            PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE,
@@ -655,6 +662,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
            PRIVATE_FLAG_STATIC_SHARED_LIBRARY,
            PRIVATE_FLAG_VENDOR,
            PRIVATE_FLAG_VIRTUAL_PRELOAD,
            PRIVATE_FLAG_HAS_FRAGILE_USER_DATA,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface ApplicationInfoPrivateFlags {}
@@ -1730,6 +1738,17 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
        return (privateFlags & PRIVATE_FLAG_USES_NON_SDK_API) != 0;
    }

    /**
     * Whether an app needs to keep the app data on uninstall.
     *
     * @return {@code true} if the app indicates that it needs to keep the app data
     *
     * @hide
     */
    public boolean hasFragileUserData() {
        return (privateFlags & PRIVATE_FLAG_HAS_FRAGILE_USER_DATA) != 0;
    }

    private boolean isAllowedToUseHiddenApis() {
        if (isSignedWithPlatformKey()) {
            return true;
+6 −0
Original line number Diff line number Diff line
@@ -3710,6 +3710,12 @@ public class PackageParser {
            ai.privateFlags |= ApplicationInfo.PRIVATE_FLAG_USES_NON_SDK_API;
        }

        if (sa.getBoolean(
                com.android.internal.R.styleable.AndroidManifestApplication_hasFragileUserData,
                false)) {
            ai.privateFlags |= ApplicationInfo.PRIVATE_FLAG_HAS_FRAGILE_USER_DATA;
        }

        if (outError[0] == null) {
            CharSequence pname;
            if (owner.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.FROYO) {
+3 −0
Original line number Diff line number Diff line
@@ -1603,6 +1603,9 @@
        <!-- Declares that this application should be invoked without non-SDK API enforcement -->
        <attr name="usesNonSdkApi" />

        <!-- If {@code true} the user is prompted to keep the app's data on uninstall -->
        <attr name="hasFragileUserData" />

    </declare-styleable>
    <!-- The <code>permission</code> tag declares a security permission that can be
         used to control access from other packages to specific components or
+1 −0
Original line number Diff line number Diff line
@@ -2930,6 +2930,7 @@
        <public name="dataRetentionTime" />
        <public name="selectionDividerHeight" />
        <public name="foregroundServiceType" />
        <public name="hasFragileUserData" />
    </public-group>

    <public-group type="drawable" first-id="0x010800b4">
Loading