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

Commit ec60b260 authored by Jonathan Scott's avatar Jonathan Scott
Browse files

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

cross-profile.

Test: Manual
Fixes: 146128107
Change-Id: I576113d05f594b79656c0ed1ebf6c4fe770bcd1e
parent 2753e748
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -398,6 +398,8 @@ public interface AndroidPackage extends Parcelable {

    boolean isEnabled();

    boolean isCrossProfile();

    boolean isEncryptionAware();

    boolean isExternal();
+3 −0
Original line number Diff line number Diff line
@@ -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));

+14 −0
Original line number Diff line number Diff line
@@ -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();
+2 −0
Original line number Diff line number Diff line
@@ -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);
+6 −0
Original line number Diff line number Diff line
@@ -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