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

Commit 2b0d2943 authored by Olivier Nshimiye's avatar Olivier Nshimiye
Browse files

Add enable_private_space_features flag check for Private Space implementation

Bug: 326060689
Test: atest FrameworksMockingServicesTests:com.android.server.pm.UserManagerServiceTest
Test: atest IntentForwarderActivityTest
Test: Manual
Change-Id: Ia636758df0a5b6f63cb58933265d6b436aac67e1
parent d2a2fae7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ flag {
    is_fixed_read_only: true
}

# This flag guards the private space feature and all its implementations excluding the APIs. APIs are guarded by android.os.Flags.allow_private_profile.
flag {
    name: "enable_private_space_features"
    namespace: "profile_experiences"
+1 −0
Original line number Diff line number Diff line
@@ -3189,6 +3189,7 @@ public class UserManager {
            conditional = true)
    @UserHandleAware
    public boolean canAddPrivateProfile() {
        if (!android.multiuser.Flags.enablePrivateSpaceFeatures()) return false;
        if (android.multiuser.Flags.blockPrivateSpaceCreation()) {
            try {
                return mService.canAddPrivateProfile(mUserId);
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ flag {
    bug: "288119641"
}

# This flag guards the private space feature, its APIs, and some of the feature implementations. The flag android.multiuser.Flags.enable_private_space_features exclusively guards all the implementations.
flag {
    name: "allow_private_profile"
    namespace: "profile_experiences"
+1 −0
Original line number Diff line number Diff line
@@ -659,6 +659,7 @@ public class IntentForwarderActivity extends Activity {

    private boolean privateSpaceFlagsEnabled() {
        return android.os.Flags.allowPrivateProfile()
                && android.multiuser.Flags.enablePrivateSpaceFeatures()
                && android.multiuser.Flags.enablePrivateSpaceIntentRedirection();
    }

+1 −0
Original line number Diff line number Diff line
@@ -641,6 +641,7 @@ public class IntentForwarderActivityTest {
    public void shouldForwardToParent_telephony_privateProfile() throws Exception {
        mSetFlagsRule.enableFlags(
                android.os.Flags.FLAG_ALLOW_PRIVATE_PROFILE,
                android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES,
                android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_INTENT_REDIRECTION);

        sComponentName = FORWARD_TO_PARENT_COMPONENT_NAME;
Loading