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

Commit ad67ba79 authored by Song Chun Fan's avatar Song Chun Fan Committed by Automerger Merge Worker
Browse files

Merge "[pm] disable deprecated ABI warning dialog for tests with abiOverride"...

Merge "[pm] disable deprecated ABI warning dialog for tests with abiOverride" into udc-dev am: 53e4343d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23539523



Change-Id: I8a1fc02815992872caad05b85c8bf3511c7758b9
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents d7a6d295 53e4343d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -827,6 +827,12 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
     */
    public static final int PRIVATE_FLAG_EXT_ALLOWLISTED_FOR_HIDDEN_APIS = 1 << 4;

    /**
     * Whether AbiOverride was used when installing this application.
     * @hide
     */
    public static final int PRIVATE_FLAG_EXT_CPU_OVERRIDE = 1 << 5;

    /** @hide */
    @IntDef(flag = true, prefix = { "PRIVATE_FLAG_EXT_" }, value = {
            PRIVATE_FLAG_EXT_PROFILEABLE,
@@ -834,6 +840,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
            PRIVATE_FLAG_EXT_ATTRIBUTIONS_ARE_USER_VISIBLE,
            PRIVATE_FLAG_EXT_ENABLE_ON_BACK_INVOKED_CALLBACK,
            PRIVATE_FLAG_EXT_ALLOWLISTED_FOR_HIDDEN_APIS,
            PRIVATE_FLAG_EXT_CPU_OVERRIDE,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface ApplicationInfoPrivateFlagsExt {}
+6 −3
Original line number Diff line number Diff line
@@ -986,11 +986,14 @@ public class PackageInfoUtils {
    }

    /** @see ApplicationInfo#privateFlagsExt */
    public static int appInfoPrivateFlagsExt(int pkgWithoutStateFlags,
    private static int appInfoPrivateFlagsExt(int pkgWithoutStateFlags,
                                             @Nullable PackageStateInternal pkgSetting) {
        // @formatter:off
        // TODO: Add state specific flags
        return pkgWithoutStateFlags;
        int flags = pkgWithoutStateFlags;
        if (pkgSetting != null) {
            flags |= flag(pkgSetting.getCpuAbiOverride() != null, ApplicationInfo.PRIVATE_FLAG_EXT_CPU_OVERRIDE);
        }
        return flags;
        // @formatter:on
    }

+9 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Handler;
@@ -178,6 +179,14 @@ class AppWarnings {
     * @param r activity record for which the warning may be displayed
     */
    public void showDeprecatedAbiDialogIfNeeded(ActivityRecord r) {
        final boolean isUsingAbiOverride = (r.info.applicationInfo.privateFlagsExt
                & ApplicationInfo.PRIVATE_FLAG_EXT_CPU_OVERRIDE) != 0;
        if (isUsingAbiOverride) {
            // The abiOverride flag was specified during installation, which means that if the app
            // is currently running in 32-bit mode, it is intended. Do not show the warning dialog.
            return;
        }
        // The warning dialog can also be disabled for debugging purpose
        final boolean disableDeprecatedAbiDialog = SystemProperties.getBoolean(
                "debug.wm.disable_deprecated_abi_dialog", false);
        if (disableDeprecatedAbiDialog) {