Merge "[pm] disable deprecated ABI warning dialog for tests with abiOverride" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
53e4343d58
@@ -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 {}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user