Merge "Introduce the sharedUserMaxSdkVersion attribute"

This commit is contained in:
John Wu
2021-08-20 19:38:42 +00:00
committed by Android (Google) Code Review
4 changed files with 14 additions and 0 deletions

View File

@@ -1291,6 +1291,7 @@ package android {
field public static final int shareInterpolator = 16843195; // 0x10101bb
field @Deprecated public static final int sharedUserId = 16842763; // 0x101000b
field @Deprecated public static final int sharedUserLabel = 16843361; // 0x1010261
field public static final int sharedUserMaxSdkVersion;
field public static final int shell = 16844180; // 0x1010594
field public static final int shortcutDisabledMessage = 16844075; // 0x101052b
field public static final int shortcutId = 16844072; // 0x1010528

View File

@@ -996,6 +996,11 @@ public class ParsingPackageUtils {
private static ParseResult<ParsingPackage> parseSharedUser(ParseInput input,
ParsingPackage pkg, TypedArray sa) {
int maxSdkVersion = anInteger(0, R.styleable.AndroidManifest_sharedUserMaxSdkVersion, sa);
if ((maxSdkVersion != 0) && maxSdkVersion < Build.VERSION.RESOURCES_SDK_INT) {
return input.success(pkg);
}
String str = nonConfigString(0, R.styleable.AndroidManifest_sharedUserId, sa);
if (TextUtils.isEmpty(str)) {
return input.success(pkg);

View File

@@ -395,6 +395,12 @@
this attribute unnecessary. -->
<attr name="sharedUserLabel" format="reference" />
<!-- The maximum device SDK version for which the application will remain in the user ID
defined in sharedUserId. Used when the application wants to migrate out of using shared
user ID, but has to maintain backwards compatibility with the API level specified
and before. -->
<attr name="sharedUserMaxSdkVersion" format="integer" />
<!-- Internal version code. This is the number used to determine whether
one version is more recent than another: it has no other meaning than
that higher numbers are more recent. You could use this number to
@@ -1650,6 +1656,7 @@
<attr name="revisionCode" />
<attr name="sharedUserId" />
<attr name="sharedUserLabel" />
<attr name="sharedUserMaxSdkVersion" />
<attr name="installLocation" />
<attr name="isolatedSplits" />
<attr name="isFeatureSplit" />

View File

@@ -3295,6 +3295,7 @@
<eat-comment />
<staging-public-group type="attr" first-id="0x01df0000">
<public name="sharedUserMaxSdkVersion" />
</staging-public-group>
<staging-public-group type="id" first-id="0x01de0000">