Add manifest attribute to signal the intent of an app to operate

cross-profile.

Test: Manual
Fixes: 146128107
Change-Id: I576113d05f594b79656c0ed1ebf6c4fe770bcd1e
This commit is contained in:
Jonathan Scott
2019-12-17 15:22:51 +00:00
parent 2753e74828
commit ec60b2604b
5 changed files with 27 additions and 0 deletions

View File

@@ -398,6 +398,8 @@ public interface AndroidPackage extends Parcelable {
boolean isEnabled();
boolean isCrossProfile();
boolean isEncryptionAware();
boolean isExternal();

View File

@@ -2053,6 +2053,9 @@ public class ApkParseUtils {
sa.getBoolean(R.styleable.AndroidManifestApplication_enabled,
true));
parsingPackage.setCrossProfile(
sa.getBoolean(R.styleable.AndroidManifestApplication_crossProfile, false));
parsingPackage.setIsGame(sa.getBoolean(
R.styleable.AndroidManifestApplication_isGame, false));

View File

@@ -235,6 +235,7 @@ public final class PackageImpl implements ParsingPackage, ParsedPackage, Android
private int descriptionRes;
private String deviceProtectedDataDir;
private boolean enabled;
private boolean crossProfile;
private int flags;
private int fullBackupContent;
private boolean hiddenUntilInstalled;
@@ -1623,6 +1624,12 @@ public final class PackageImpl implements ParsingPackage, ParsedPackage, Android
return this;
}
@Override
public PackageImpl setCrossProfile(boolean crossProfile) {
this.crossProfile = crossProfile;
return this;
}
@Override
public PackageImpl setUiOptions(int uiOptions) {
this.uiOptions = uiOptions;
@@ -2817,6 +2824,11 @@ public final class PackageImpl implements ParsingPackage, ParsedPackage, Android
return enabled;
}
@Override
public boolean isCrossProfile() {
return crossProfile;
}
@Override
public String getManageSpaceActivityName() {
return manageSpaceActivityName;
@@ -3024,6 +3036,7 @@ public final class PackageImpl implements ParsingPackage, ParsedPackage, Android
dest.writeInt(this.descriptionRes);
dest.writeString(this.deviceProtectedDataDir);
dest.writeBoolean(this.enabled);
dest.writeBoolean(this.crossProfile);
dest.writeInt(this.flags);
dest.writeInt(this.fullBackupContent);
dest.writeBoolean(this.hiddenUntilInstalled);
@@ -3174,6 +3187,7 @@ public final class PackageImpl implements ParsingPackage, ParsedPackage, Android
this.descriptionRes = in.readInt();
this.deviceProtectedDataDir = in.readString();
this.enabled = in.readBoolean();
this.crossProfile = in.readBoolean();
this.flags = in.readInt();
this.fullBackupContent = in.readInt();
this.hiddenUntilInstalled = in.readBoolean();

View File

@@ -227,6 +227,8 @@ public interface ParsingPackage extends AndroidPackage {
ParsingPackage setEnabled(boolean enabled);
ParsingPackage setCrossProfile(boolean crossProfile);
ParsingPackage setFullBackupContent(int fullBackupContent);
ParsingPackage setHasDomainUrls(boolean hasDomainUrls);

View File

@@ -1753,6 +1753,12 @@
The default value is {@code false}. -->
<attr name="forceQueryable" format="boolean" />
<!-- If {@code true} indicates that this application is capable of presenting a unified
interface representing multiple profiles.
The default value is {@code false}. -->
<attr name="crossProfile" format="boolean" />
</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