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

Commit a1e72e66 authored by Olivier Nshimiye's avatar Olivier Nshimiye
Browse files

Add an additional flag guard for Private Space implementation [Services

& PackageInstaller]

This a layer of flag guarding only for the implementation of Private Space features excluding the APIs. The MVP flag allow_private_profile still guards all the features including the APIs.

Bug: 326060689
Test: Manual - a few verifications that some feeatures are unavailable when this flag is disabled
Test: Run presubmits and verify that nothing breaks
Ignore-AOSP-First: Relies on a flag that is not in AOSP

Change-Id: I1ba0c21fc842b79250d26647282e9d019f7664e0
parent abbfff37
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -698,6 +698,7 @@ public class LauncherApps {
        if (mUserManager.isManagedProfile()
                || (android.multiuser.Flags.enableLauncherAppsHiddenProfileChecks()
                    && android.os.Flags.allowPrivateProfile()
                    && android.multiuser.Flags.enablePrivateSpaceFeatures()
                    && mUserManager.isPrivateProfile())) {
            // If it's a managed or private profile, only return the current profile.
            final List result = new ArrayList(1);
+3 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ android_app {
        "androidx.lifecycle_lifecycle-extensions",
        "android.content.pm.flags-aconfig-java",
        "android.os.flags-aconfig-java",
        "android.multiuser.flags-aconfig-java",
    ],

    lint: {
@@ -85,6 +86,7 @@ android_app {
        "androidx.lifecycle_lifecycle-extensions",
        "android.content.pm.flags-aconfig-java",
        "android.os.flags-aconfig-java",
        "android.multiuser.flags-aconfig-java",
    ],
    aaptflags: ["--product tablet"],

@@ -118,6 +120,7 @@ android_app {
        "androidx.lifecycle_lifecycle-extensions",
        "android.content.pm.flags-aconfig-java",
        "android.os.flags-aconfig-java",
        "android.multiuser.flags-aconfig-java",
    ],
    aaptflags: ["--product tv"],

+1 −0
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@ public class UninstallAlertDialogFragment extends DialogFragment implements
                    messageBuilder.append(getString(
                            R.string.uninstall_application_text_current_user_clone_profile));
                } else if (Flags.allowPrivateProfile()
                        && android.multiuser.Flags.enablePrivateSpaceFeatures()
                        && customUserManager.isPrivateProfile()
                        && customUserManager.isSameProfileGroup(dialogInfo.user, myUserHandle)) {
                    messageBuilder.append(
+3 −1
Original line number Diff line number Diff line
@@ -235,7 +235,9 @@ class UninstallRepository(private val context: Context) {
                    messageString = context.getString(
                            R.string.uninstall_application_text_current_user_clone_profile
                    )
                } else if (Flags.allowPrivateProfile() && customUserManager!!.isPrivateProfile()) {
                } else if (Flags.allowPrivateProfile()
                        && android.multiuser.Flags.enablePrivateSpaceFeatures()
                        && customUserManager!!.isPrivateProfile()) {
                    // TODO(b/324244123): Get these Strings from a User Property API.
                    messageString = context.getString(
                            R.string.uninstall_application_text_current_user_private_profile
+2 −1
Original line number Diff line number Diff line
@@ -1419,7 +1419,8 @@ class UserController implements Handler.Callback {

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

    /**
Loading