Merge "Convert enableGwpAsan to @IntDef and rename to gwpAsanMode." into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
21c6a0f598
@@ -573,7 +573,6 @@ package android {
|
||||
field public static final int elevation = 16843840; // 0x1010440
|
||||
field public static final int ellipsize = 16842923; // 0x10100ab
|
||||
field public static final int ems = 16843096; // 0x1010158
|
||||
field public static final int enableGwpAsan = 16844312; // 0x1010618
|
||||
field public static final int enableVrMode = 16844069; // 0x1010525
|
||||
field public static final int enabled = 16842766; // 0x101000e
|
||||
field public static final int end = 16843996; // 0x10104dc
|
||||
@@ -710,6 +709,7 @@ package android {
|
||||
field public static final int gravity = 16842927; // 0x10100af
|
||||
field public static final int gridViewStyle = 16842865; // 0x1010071
|
||||
field public static final int groupIndicator = 16843019; // 0x101010b
|
||||
field public static final int gwpAsanMode = 16844312; // 0x1010618
|
||||
field public static final int hand_hour = 16843011; // 0x1010103
|
||||
field public static final int hand_minute = 16843012; // 0x1010104
|
||||
field public static final int handle = 16843354; // 0x101025a
|
||||
@@ -11443,7 +11443,7 @@ package android.content.pm {
|
||||
method public int describeContents();
|
||||
method public void dump(android.util.Printer, String);
|
||||
method public static CharSequence getCategoryTitle(android.content.Context, int);
|
||||
method @Nullable public Boolean isGwpAsanEnabled();
|
||||
method public int getGwpAsanMode();
|
||||
method public boolean isProfileableByShell();
|
||||
method public boolean isResourceOverlay();
|
||||
method public boolean isVirtualPreload();
|
||||
@@ -11490,6 +11490,9 @@ package android.content.pm {
|
||||
field public static final int FLAG_UPDATED_SYSTEM_APP = 128; // 0x80
|
||||
field public static final int FLAG_USES_CLEARTEXT_TRAFFIC = 134217728; // 0x8000000
|
||||
field public static final int FLAG_VM_SAFE_MODE = 16384; // 0x4000
|
||||
field public static final int GWP_ASAN_ALWAYS = 1; // 0x1
|
||||
field public static final int GWP_ASAN_DEFAULT = -1; // 0xffffffff
|
||||
field public static final int GWP_ASAN_NEVER = 0; // 0x0
|
||||
field public String appComponentFactory;
|
||||
field public String backupAgentName;
|
||||
field public int category;
|
||||
|
||||
@@ -59,8 +59,6 @@ import java.util.UUID;
|
||||
* <application> tag.
|
||||
*/
|
||||
public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
private static ForBoolean sForBoolean = Parcelling.Cache.getOrCreate(ForBoolean.class);
|
||||
|
||||
/**
|
||||
* Default task affinity of all activities in this application. See
|
||||
* {@link ActivityInfo#taskAffinity} for more information. This comes
|
||||
@@ -1277,12 +1275,37 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
public String zygotePreloadName;
|
||||
|
||||
/**
|
||||
* Indicates if the application has requested GWP-ASan to be enabled, disabled, or left
|
||||
* unspecified. Processes can override this setting.
|
||||
* Default (unspecified) setting of GWP-ASan.
|
||||
*/
|
||||
public static final int GWP_ASAN_DEFAULT = -1;
|
||||
|
||||
/**
|
||||
* Never enable GWP-ASan in this application or process.
|
||||
*/
|
||||
public static final int GWP_ASAN_NEVER = 0;
|
||||
|
||||
/**
|
||||
* Always enable GWP-ASan in this application or process.
|
||||
*/
|
||||
public static final int GWP_ASAN_ALWAYS = 1;
|
||||
|
||||
/**
|
||||
* These constants need to match the values of gwpAsanMode in application manifest.
|
||||
* @hide
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean enableGwpAsan;
|
||||
@IntDef(prefix = {"GWP_ASAN_"}, value = {
|
||||
GWP_ASAN_DEFAULT,
|
||||
GWP_ASAN_NEVER,
|
||||
GWP_ASAN_ALWAYS,
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface GwpAsanMode {}
|
||||
|
||||
/**
|
||||
* Indicates if the application has requested GWP-ASan to be enabled, disabled, or left
|
||||
* unspecified. Processes can override this setting.
|
||||
*/
|
||||
private @GwpAsanMode int gwpAsanMode;
|
||||
|
||||
/**
|
||||
* Represents the default policy. The actual policy used will depend on other properties of
|
||||
@@ -1425,8 +1448,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
pw.println(prefix + "usesNonSdkApi=" + usesNonSdkApi());
|
||||
pw.println(prefix + "allowsPlaybackCapture="
|
||||
+ (isAudioPlaybackCaptureAllowed() ? "true" : "false"));
|
||||
if (enableGwpAsan != null) {
|
||||
pw.println(prefix + "enableGwpAsan=" + enableGwpAsan);
|
||||
if (gwpAsanMode != GWP_ASAN_DEFAULT) {
|
||||
pw.println(prefix + "gwpAsanMode=" + gwpAsanMode);
|
||||
}
|
||||
}
|
||||
super.dumpBack(pw, prefix);
|
||||
@@ -1526,8 +1549,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
if (category != CATEGORY_UNDEFINED) {
|
||||
proto.write(ApplicationInfoProto.Detail.CATEGORY, category);
|
||||
}
|
||||
if (enableGwpAsan != null) {
|
||||
proto.write(ApplicationInfoProto.Detail.ENABLE_GWP_ASAN, enableGwpAsan);
|
||||
if (gwpAsanMode != GWP_ASAN_DEFAULT) {
|
||||
proto.write(ApplicationInfoProto.Detail.ENABLE_GWP_ASAN, gwpAsanMode);
|
||||
}
|
||||
proto.end(detailToken);
|
||||
}
|
||||
@@ -1638,7 +1661,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
mHiddenApiPolicy = orig.mHiddenApiPolicy;
|
||||
hiddenUntilInstalled = orig.hiddenUntilInstalled;
|
||||
zygotePreloadName = orig.zygotePreloadName;
|
||||
enableGwpAsan = orig.enableGwpAsan;
|
||||
gwpAsanMode = orig.gwpAsanMode;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
@@ -1722,7 +1745,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
dest.writeInt(mHiddenApiPolicy);
|
||||
dest.writeInt(hiddenUntilInstalled ? 1 : 0);
|
||||
dest.writeString(zygotePreloadName);
|
||||
sForBoolean.parcel(enableGwpAsan, dest, parcelableFlags);
|
||||
dest.writeInt(gwpAsanMode);
|
||||
}
|
||||
|
||||
public static final @android.annotation.NonNull Parcelable.Creator<ApplicationInfo> CREATOR
|
||||
@@ -1803,7 +1826,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
mHiddenApiPolicy = source.readInt();
|
||||
hiddenUntilInstalled = source.readInt() != 0;
|
||||
zygotePreloadName = source.readString();
|
||||
enableGwpAsan = sForBoolean.unparcel(source);
|
||||
gwpAsanMode = source.readInt();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2182,7 +2205,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
/** {@hide} */ public void setResourcePath(String resourcePath) { scanPublicSourceDir = resourcePath; }
|
||||
/** {@hide} */ public void setBaseResourcePath(String baseResourcePath) { publicSourceDir = baseResourcePath; }
|
||||
/** {@hide} */ public void setSplitResourcePaths(String[] splitResourcePaths) { splitPublicSourceDirs = splitResourcePaths; }
|
||||
/** {@hide} */ public void setGwpAsanEnabled(@Nullable Boolean value) { enableGwpAsan = value; }
|
||||
/** {@hide} */ public void setGwpAsanMode(@GwpAsanMode int value) { gwpAsanMode = value; }
|
||||
|
||||
/** {@hide} */
|
||||
@UnsupportedAppUsage
|
||||
@@ -2194,6 +2217,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
@UnsupportedAppUsage
|
||||
public String getBaseResourcePath() { return publicSourceDir; }
|
||||
/** {@hide} */ public String[] getSplitResourcePaths() { return splitPublicSourceDirs; }
|
||||
@Nullable
|
||||
public Boolean isGwpAsanEnabled() { return enableGwpAsan; }
|
||||
@GwpAsanMode
|
||||
public int getGwpAsanMode() { return gwpAsanMode; }
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package android.content.pm;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
@@ -50,14 +51,13 @@ public class ProcessInfo implements Parcelable {
|
||||
/**
|
||||
* Indicates if the process has requested GWP-ASan to be enabled, disabled, or left unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean enableGwpAsan;
|
||||
public @ApplicationInfo.GwpAsanMode int gwpAsanMode;
|
||||
|
||||
@Deprecated
|
||||
public ProcessInfo(@NonNull ProcessInfo orig) {
|
||||
this.name = orig.name;
|
||||
this.deniedPermissions = orig.deniedPermissions;
|
||||
this.enableGwpAsan = orig.enableGwpAsan;
|
||||
this.gwpAsanMode = orig.gwpAsanMode;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,19 +82,21 @@ public class ProcessInfo implements Parcelable {
|
||||
* The name of the process, fully-qualified based on the app's package name.
|
||||
* @param deniedPermissions
|
||||
* If non-null, these are permissions that are not allowed in this process.
|
||||
* @param enableGwpAsan
|
||||
* @param gwpAsanMode
|
||||
* Indicates if the process has requested GWP-ASan to be enabled, disabled, or left unspecified.
|
||||
*/
|
||||
@DataClass.Generated.Member
|
||||
public ProcessInfo(
|
||||
@NonNull String name,
|
||||
@Nullable ArraySet<String> deniedPermissions,
|
||||
@Nullable Boolean enableGwpAsan) {
|
||||
@ApplicationInfo.GwpAsanMode int gwpAsanMode) {
|
||||
this.name = name;
|
||||
com.android.internal.util.AnnotationValidations.validate(
|
||||
NonNull.class, null, name);
|
||||
this.deniedPermissions = deniedPermissions;
|
||||
this.enableGwpAsan = enableGwpAsan;
|
||||
this.gwpAsanMode = gwpAsanMode;
|
||||
com.android.internal.util.AnnotationValidations.validate(
|
||||
ApplicationInfo.GwpAsanMode.class, null, gwpAsanMode);
|
||||
|
||||
// onConstructed(); // You can define this method to get a callback
|
||||
}
|
||||
@@ -118,11 +120,10 @@ public class ProcessInfo implements Parcelable {
|
||||
|
||||
byte flg = 0;
|
||||
if (deniedPermissions != null) flg |= 0x2;
|
||||
if (enableGwpAsan != null) flg |= 0x4;
|
||||
dest.writeByte(flg);
|
||||
dest.writeString(name);
|
||||
sParcellingForDeniedPermissions.parcel(deniedPermissions, dest, flags);
|
||||
if (enableGwpAsan != null) dest.writeBoolean(enableGwpAsan);
|
||||
dest.writeInt(gwpAsanMode);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -139,13 +140,15 @@ public class ProcessInfo implements Parcelable {
|
||||
byte flg = in.readByte();
|
||||
String _name = in.readString();
|
||||
ArraySet<String> _deniedPermissions = sParcellingForDeniedPermissions.unparcel(in);
|
||||
Boolean _enableGwpAsan = (flg & 0x4) == 0 ? null : (Boolean) in.readBoolean();
|
||||
int _gwpAsanMode = in.readInt();
|
||||
|
||||
this.name = _name;
|
||||
com.android.internal.util.AnnotationValidations.validate(
|
||||
NonNull.class, null, name);
|
||||
this.deniedPermissions = _deniedPermissions;
|
||||
this.enableGwpAsan = _enableGwpAsan;
|
||||
this.gwpAsanMode = _gwpAsanMode;
|
||||
com.android.internal.util.AnnotationValidations.validate(
|
||||
ApplicationInfo.GwpAsanMode.class, null, gwpAsanMode);
|
||||
|
||||
// onConstructed(); // You can define this method to get a callback
|
||||
}
|
||||
@@ -165,10 +168,10 @@ public class ProcessInfo implements Parcelable {
|
||||
};
|
||||
|
||||
@DataClass.Generated(
|
||||
time = 1582840056156L,
|
||||
time = 1584555730519L,
|
||||
codegenVersion = "1.0.15",
|
||||
sourceFile = "frameworks/base/core/java/android/content/pm/ProcessInfo.java",
|
||||
inputSignatures = "public @android.annotation.NonNull java.lang.String name\npublic @android.annotation.Nullable @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForInternedStringArraySet.class) android.util.ArraySet<java.lang.String> deniedPermissions\npublic @android.annotation.Nullable java.lang.Boolean enableGwpAsan\nclass ProcessInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genGetters=true, genSetters=false, genParcelable=true, genAidl=false, genBuilder=false)")
|
||||
inputSignatures = "public @android.annotation.NonNull java.lang.String name\npublic @android.annotation.Nullable @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForInternedStringArraySet.class) android.util.ArraySet<java.lang.String> deniedPermissions\npublic @android.content.pm.ApplicationInfo.GwpAsanMode int gwpAsanMode\nclass ProcessInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genGetters=true, genSetters=false, genParcelable=true, genAidl=false, genBuilder=false)")
|
||||
@Deprecated
|
||||
private void __metadata() {}
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@ public interface ParsingPackage extends ParsingPackageRead {
|
||||
|
||||
ParsingPackage setEnabled(boolean enabled);
|
||||
|
||||
ParsingPackage setGwpAsanEnabled(Boolean enableGwpAsan);
|
||||
ParsingPackage setGwpAsanMode(int gwpAsanMode);
|
||||
|
||||
ParsingPackage setCrossProfile(boolean crossProfile);
|
||||
|
||||
|
||||
@@ -409,9 +409,7 @@ public class ParsingPackageImpl implements ParsingPackage, Parcelable {
|
||||
private boolean allowDontAutoRevokePermissions;
|
||||
private boolean preserveLegacyExternalStorage;
|
||||
|
||||
@Nullable
|
||||
@DataClass.ParcelWith(ForBoolean.class)
|
||||
protected Boolean enableGwpAsan = null;
|
||||
protected int gwpAsanMode;
|
||||
|
||||
// TODO(chiuwinson): Non-null
|
||||
@Nullable
|
||||
@@ -911,7 +909,7 @@ public class ParsingPackageImpl implements ParsingPackage, Parcelable {
|
||||
appInfo.volumeUuid = volumeUuid;
|
||||
appInfo.zygotePreloadName = zygotePreloadName;
|
||||
appInfo.crossProfile = isCrossProfile();
|
||||
appInfo.setGwpAsanEnabled(enableGwpAsan);
|
||||
appInfo.setGwpAsanMode(gwpAsanMode);
|
||||
appInfo.setBaseCodePath(baseCodePath);
|
||||
appInfo.setBaseResourcePath(baseCodePath);
|
||||
appInfo.setCodePath(codePath);
|
||||
@@ -1095,7 +1093,7 @@ public class ParsingPackageImpl implements ParsingPackage, Parcelable {
|
||||
dest.writeBoolean(this.allowDontAutoRevokePermissions);
|
||||
dest.writeBoolean(this.preserveLegacyExternalStorage);
|
||||
dest.writeArraySet(this.mimeGroups);
|
||||
sForBoolean.parcel(this.enableGwpAsan, dest, flags);
|
||||
dest.writeInt(this.gwpAsanMode);
|
||||
}
|
||||
|
||||
public ParsingPackageImpl(Parcel in) {
|
||||
@@ -1255,7 +1253,7 @@ public class ParsingPackageImpl implements ParsingPackage, Parcelable {
|
||||
this.allowDontAutoRevokePermissions = in.readBoolean();
|
||||
this.preserveLegacyExternalStorage = in.readBoolean();
|
||||
this.mimeGroups = (ArraySet<String>) in.readArraySet(boot);
|
||||
this.enableGwpAsan = sForBoolean.unparcel(in);
|
||||
this.gwpAsanMode = in.readInt();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<ParsingPackageImpl> CREATOR =
|
||||
@@ -1978,9 +1976,8 @@ public class ParsingPackageImpl implements ParsingPackage, Parcelable {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Boolean isGwpAsanEnabled() {
|
||||
return enableGwpAsan;
|
||||
public int getGwpAsanMode() {
|
||||
return gwpAsanMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2449,8 +2446,8 @@ public class ParsingPackageImpl implements ParsingPackage, Parcelable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParsingPackageImpl setGwpAsanEnabled(@Nullable Boolean value) {
|
||||
enableGwpAsan = value;
|
||||
public ParsingPackageImpl setGwpAsanMode(int value) {
|
||||
gwpAsanMode = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -847,11 +847,10 @@ public interface ParsingPackageRead extends Parcelable {
|
||||
Set<String> getMimeGroups();
|
||||
|
||||
/**
|
||||
* @see ApplicationInfo#enableGwpAsan
|
||||
* @see R.styleable#AndroidManifest_enableGwpAsan
|
||||
* @see ApplicationInfo#gwpAsanMode
|
||||
* @see R.styleable#AndroidManifest_gwpAsanMode
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean isGwpAsanEnabled();
|
||||
public int getGwpAsanMode();
|
||||
|
||||
// TODO(b/135203078): Hide and enforce going through PackageInfoUtils
|
||||
ApplicationInfo toAppInfoWithoutState();
|
||||
|
||||
@@ -1677,10 +1677,7 @@ public class ParsingPackageUtils {
|
||||
return input.error("Invalid class loader name: " + classLoaderName);
|
||||
}
|
||||
|
||||
if (sa.hasValue(R.styleable.AndroidManifestApplication_enableGwpAsan)) {
|
||||
pkg.setGwpAsanEnabled(
|
||||
sa.getBoolean(R.styleable.AndroidManifestApplication_enableGwpAsan, false));
|
||||
}
|
||||
pkg.setGwpAsanMode(sa.getInt(R.styleable.AndroidManifestApplication_gwpAsanMode, -1));
|
||||
} finally {
|
||||
sa.recycle();
|
||||
}
|
||||
|
||||
@@ -41,8 +41,7 @@ public class ParsedProcess implements Parcelable {
|
||||
@DataClass.ParcelWith(Parcelling.BuiltIn.ForInternedStringSet.class)
|
||||
protected Set<String> deniedPermissions = emptySet();
|
||||
|
||||
@Nullable
|
||||
protected Boolean enableGwpAsan = null;
|
||||
protected int gwpAsanMode = -1;
|
||||
|
||||
public ParsedProcess() {
|
||||
}
|
||||
@@ -58,7 +57,7 @@ public class ParsedProcess implements Parcelable {
|
||||
|
||||
|
||||
|
||||
// Code below generated by codegen v1.0.14.
|
||||
// Code below generated by codegen v1.0.15.
|
||||
//
|
||||
// DO NOT MODIFY!
|
||||
// CHECKSTYLE:OFF Generated code
|
||||
@@ -75,14 +74,14 @@ public class ParsedProcess implements Parcelable {
|
||||
public ParsedProcess(
|
||||
@NonNull String name,
|
||||
@NonNull Set<String> deniedPermissions,
|
||||
@Nullable Boolean enableGwpAsan) {
|
||||
int gwpAsanMode) {
|
||||
this.name = name;
|
||||
com.android.internal.util.AnnotationValidations.validate(
|
||||
NonNull.class, null, name);
|
||||
this.deniedPermissions = deniedPermissions;
|
||||
com.android.internal.util.AnnotationValidations.validate(
|
||||
NonNull.class, null, deniedPermissions);
|
||||
this.enableGwpAsan = enableGwpAsan;
|
||||
this.gwpAsanMode = gwpAsanMode;
|
||||
|
||||
// onConstructed(); // You can define this method to get a callback
|
||||
}
|
||||
@@ -98,8 +97,8 @@ public class ParsedProcess implements Parcelable {
|
||||
}
|
||||
|
||||
@DataClass.Generated.Member
|
||||
public @Nullable Boolean getEnableGwpAsan() {
|
||||
return enableGwpAsan;
|
||||
public int getGwpAsanMode() {
|
||||
return gwpAsanMode;
|
||||
}
|
||||
|
||||
@DataClass.Generated.Member
|
||||
@@ -119,12 +118,9 @@ public class ParsedProcess implements Parcelable {
|
||||
// You can override field parcelling by defining methods like:
|
||||
// void parcelFieldName(Parcel dest, int flags) { ... }
|
||||
|
||||
byte flg = 0;
|
||||
if (enableGwpAsan != null) flg |= 0x4;
|
||||
dest.writeByte(flg);
|
||||
dest.writeString(name);
|
||||
sParcellingForDeniedPermissions.parcel(deniedPermissions, dest, flags);
|
||||
if (enableGwpAsan != null) dest.writeBoolean(enableGwpAsan);
|
||||
dest.writeInt(gwpAsanMode);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -138,10 +134,9 @@ public class ParsedProcess implements Parcelable {
|
||||
// You can override field unparcelling by defining methods like:
|
||||
// static FieldType unparcelFieldName(Parcel in) { ... }
|
||||
|
||||
byte flg = in.readByte();
|
||||
String _name = in.readString();
|
||||
Set<String> _deniedPermissions = sParcellingForDeniedPermissions.unparcel(in);
|
||||
Boolean _enableGwpAsan = (flg & 0x4) == 0 ? null : (Boolean) in.readBoolean();
|
||||
int _gwpAsanMode = in.readInt();
|
||||
|
||||
this.name = _name;
|
||||
com.android.internal.util.AnnotationValidations.validate(
|
||||
@@ -149,7 +144,7 @@ public class ParsedProcess implements Parcelable {
|
||||
this.deniedPermissions = _deniedPermissions;
|
||||
com.android.internal.util.AnnotationValidations.validate(
|
||||
NonNull.class, null, deniedPermissions);
|
||||
this.enableGwpAsan = _enableGwpAsan;
|
||||
this.gwpAsanMode = _gwpAsanMode;
|
||||
|
||||
// onConstructed(); // You can define this method to get a callback
|
||||
}
|
||||
@@ -169,10 +164,10 @@ public class ParsedProcess implements Parcelable {
|
||||
};
|
||||
|
||||
@DataClass.Generated(
|
||||
time = 1582589960479L,
|
||||
codegenVersion = "1.0.14",
|
||||
time = 1584557524776L,
|
||||
codegenVersion = "1.0.15",
|
||||
sourceFile = "frameworks/base/core/java/android/content/pm/parsing/component/ParsedProcess.java",
|
||||
inputSignatures = "protected @android.annotation.NonNull java.lang.String name\nprotected @android.annotation.NonNull @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForInternedStringSet.class) java.util.Set<java.lang.String> deniedPermissions\nprotected @android.annotation.Nullable java.lang.Boolean enableGwpAsan\npublic void addStateFrom(android.content.pm.parsing.component.ParsedProcess)\nclass ParsedProcess extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genGetters=true, genSetters=false, genParcelable=true, genAidl=false, genBuilder=false)")
|
||||
inputSignatures = "protected @android.annotation.NonNull java.lang.String name\nprotected @android.annotation.NonNull @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForInternedStringSet.class) java.util.Set<java.lang.String> deniedPermissions\nprotected int gwpAsanMode\npublic void addStateFrom(android.content.pm.parsing.component.ParsedProcess)\nclass ParsedProcess extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genGetters=true, genSetters=false, genParcelable=true, genAidl=false, genBuilder=false)")
|
||||
@Deprecated
|
||||
private void __metadata() {}
|
||||
|
||||
|
||||
@@ -104,10 +104,7 @@ public class ParsedProcessUtils {
|
||||
return input.error("<process> does not specify android:process");
|
||||
}
|
||||
|
||||
if (sa.hasValue(R.styleable.AndroidManifestProcess_enableGwpAsan)) {
|
||||
proc.enableGwpAsan =
|
||||
sa.getBoolean(R.styleable.AndroidManifestProcess_enableGwpAsan, false);
|
||||
}
|
||||
proc.gwpAsanMode = sa.getInt(R.styleable.AndroidManifestProcess_gwpAsanMode, -1);
|
||||
} finally {
|
||||
sa.recycle();
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ message ApplicationInfoProto {
|
||||
}
|
||||
optional int32 network_security_config_res = 17;
|
||||
optional int32 category = 18;
|
||||
optional bool enable_gwp_asan = 19;
|
||||
optional int32 enable_gwp_asan = 19;
|
||||
}
|
||||
optional Detail detail = 17;
|
||||
}
|
||||
|
||||
@@ -1547,19 +1547,18 @@
|
||||
See the <a href="http://llvm.org/docs/GwpAsan.html">LLVM documentation</a>
|
||||
for more information about this feature.
|
||||
|
||||
<p>This tag can be applied to any tag that allows
|
||||
{@link android.R.styleable#AndroidManifestProcess process} tag:
|
||||
<p>This attribute can be applied to a
|
||||
{@link android.R.styleable#AndroidManifestProcess process} tag, or to an
|
||||
{@link android.R.styleable#AndroidManifestApplication application} tag (to supply
|
||||
a default setting for all application components), or with the
|
||||
{@link android.R.styleable#AndroidManifestProvider provider},
|
||||
{@link android.R.styleable#AndroidManifestService service},
|
||||
{@link android.R.styleable#AndroidManifestReceiver receiver},
|
||||
{@link android.R.styleable#AndroidManifestActivity activity} tag.
|
||||
When multiple components run in the same process,
|
||||
the first component to start determines the behavior of the entire process.
|
||||
|
||||
The default value is {@code false}. -->
|
||||
<attr name="enableGwpAsan" format="boolean" />
|
||||
a default setting for all application components). -->
|
||||
<attr name="gwpAsanMode">
|
||||
<!-- Default behavior: GwpAsan is disabled in user apps, randomly enabled in system apps. -->
|
||||
<enum name="default" value="-1" />
|
||||
<!-- Never enable GwpAsan. -->
|
||||
<enum name="never" value="0" />
|
||||
<!-- Always enable GwpAsan. -->
|
||||
<enum name="always" value="1" />
|
||||
</attr>
|
||||
|
||||
<!-- The <code>manifest</code> tag is the root of an
|
||||
<code>AndroidManifest.xml</code> file,
|
||||
@@ -1826,7 +1825,7 @@
|
||||
The default value is {@code true}. -->
|
||||
<attr name="allowNativeHeapPointerTagging" format="boolean" />
|
||||
|
||||
<attr name="enableGwpAsan" />
|
||||
<attr name="gwpAsanMode" />
|
||||
|
||||
<!-- If {@code true} allow requesting that its permissions don't get automatically
|
||||
revoked when the app is unused for an extended amount of time.
|
||||
@@ -2351,7 +2350,7 @@
|
||||
<declare-styleable name="AndroidManifestProcess" parent="AndroidManifestProcesses">
|
||||
<!-- Required name of the process that is allowed -->
|
||||
<attr name="process" />
|
||||
<attr name="enableGwpAsan" />
|
||||
<attr name="gwpAsanMode" />
|
||||
</declare-styleable>
|
||||
|
||||
<!-- The <code>deny-permission</code> tag specifies that a permission is to be denied
|
||||
|
||||
@@ -3018,7 +3018,7 @@
|
||||
<public name="allowAutoRevokePermissionsExemption" />
|
||||
<public name="preserveLegacyExternalStorage" />
|
||||
<public name="mimeGroup" />
|
||||
<public name="enableGwpAsan" />
|
||||
<public name="gwpAsanMode" />
|
||||
</public-group>
|
||||
|
||||
<public-group type="drawable" first-id="0x010800b5">
|
||||
|
||||
@@ -1665,16 +1665,19 @@ public final class ProcessList {
|
||||
|
||||
private int decideGwpAsanLevel(ProcessRecord app) {
|
||||
// Look at the process attribute first.
|
||||
if (app.processInfo != null && app.processInfo.enableGwpAsan != null) {
|
||||
return app.processInfo.enableGwpAsan ? Zygote.GWP_ASAN_LEVEL_ALWAYS
|
||||
: Zygote.GWP_ASAN_LEVEL_NEVER;
|
||||
if (app.processInfo != null
|
||||
&& app.processInfo.gwpAsanMode != ApplicationInfo.GWP_ASAN_DEFAULT) {
|
||||
return app.processInfo.gwpAsanMode == ApplicationInfo.GWP_ASAN_ALWAYS
|
||||
? Zygote.GWP_ASAN_LEVEL_ALWAYS
|
||||
: Zygote.GWP_ASAN_LEVEL_NEVER;
|
||||
}
|
||||
// Then at the applicaton attribute.
|
||||
if (app.info.isGwpAsanEnabled() != null) {
|
||||
return app.info.isGwpAsanEnabled() ? Zygote.GWP_ASAN_LEVEL_ALWAYS
|
||||
: Zygote.GWP_ASAN_LEVEL_NEVER;
|
||||
if (app.info.getGwpAsanMode() != ApplicationInfo.GWP_ASAN_DEFAULT) {
|
||||
return app.info.getGwpAsanMode() == ApplicationInfo.GWP_ASAN_ALWAYS
|
||||
? Zygote.GWP_ASAN_LEVEL_ALWAYS
|
||||
: Zygote.GWP_ASAN_LEVEL_NEVER;
|
||||
}
|
||||
// If the app does not specify enableGwpAsan, the default behavior is lottery among the
|
||||
// If the app does not specify gwpAsanMode, the default behavior is lottery among the
|
||||
// system apps, and disabled for user apps, unless overwritten by the compat feature.
|
||||
if (mPlatformCompat.isChangeEnabled(GWP_ASAN, app.info)) {
|
||||
return Zygote.GWP_ASAN_LEVEL_ALWAYS;
|
||||
|
||||
@@ -385,8 +385,8 @@ class ProcessRecord implements WindowProcessListener {
|
||||
pw.println(processInfo.deniedPermissions.valueAt(i));
|
||||
}
|
||||
}
|
||||
if (processInfo.enableGwpAsan != null) {
|
||||
pw.print(prefix); pw.println(" enableGwpAsan=" + processInfo.enableGwpAsan);
|
||||
if (processInfo.gwpAsanMode != ApplicationInfo.GWP_ASAN_DEFAULT) {
|
||||
pw.print(prefix); pw.println(" gwpAsanMode=" + processInfo.gwpAsanMode);
|
||||
}
|
||||
}
|
||||
pw.print(prefix); pw.print("mRequiredAbi="); pw.print(mRequiredAbi);
|
||||
@@ -640,9 +640,10 @@ class ProcessRecord implements WindowProcessListener {
|
||||
_service.mPackageManagerInt.getProcessesForUid(_uid);
|
||||
if (processes != null) {
|
||||
procInfo = processes.get(_processName);
|
||||
if (procInfo != null && procInfo.deniedPermissions == null) {
|
||||
// If this process hasn't asked for permissions to be denied, then
|
||||
// we don't care about it.
|
||||
if (procInfo != null && procInfo.deniedPermissions == null
|
||||
&& procInfo.gwpAsanMode == ApplicationInfo.GWP_ASAN_DEFAULT) {
|
||||
// If this process hasn't asked for permissions to be denied, or for a
|
||||
// non-default GwpAsan mode, then we don't care about it.
|
||||
procInfo = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ public class PackageInfoUtils {
|
||||
ParsedProcess proc = procs.get(key);
|
||||
retProcs.put(proc.getName(),
|
||||
new ProcessInfo(proc.getName(), new ArraySet<>(proc.getDeniedPermissions()),
|
||||
proc.getEnableGwpAsan()));
|
||||
proc.getGwpAsanMode()));
|
||||
}
|
||||
return retProcs;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user