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

Commit 607918e9 authored by Oli Thompson's avatar Oli Thompson
Browse files

Backup connected apps

Add new global settings and flag for backing up connected apps

Flag: android.app.admin.backup_connected_apps_settings
Bug: 175067666
Test: manual

Change-Id: I1bddb15a2e1ae6ba319d8bd94081fb5c7b0ef9e7
parent ec90d944
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -314,6 +314,13 @@ flag {
    }
}

flag {
    name: "backup_connected_apps_settings"
    namespace: "enterprise"
    description: "backup and restore connected work and personal apps user settings across devices"
    bug: "175067666"
}

flag {
    name: "headless_single_user_compatibility_fix"
    namespace: "enterprise"
+22 −0
Original line number Diff line number Diff line
@@ -17032,6 +17032,28 @@ public final class Settings {
         */
        public static final String ENABLE_BACK_ANIMATION = "enable_back_animation";
        /**
         * An allow list of packages for which the user has granted the permission to communicate
         * across profiles.
         *
         * @hide
         */
        @Readable
        @FlaggedApi(android.app.admin.flags.Flags.FLAG_BACKUP_CONNECTED_APPS_SETTINGS)
        public static final String CONNECTED_APPS_ALLOWED_PACKAGES =
                "connected_apps_allowed_packages";
        /**
         * A block list of packages for which the user has denied the permission to communicate
         * across profiles.
         *
         * @hide
         */
        @Readable
        @FlaggedApi(android.app.admin.flags.Flags.FLAG_BACKUP_CONNECTED_APPS_SETTINGS)
        public static final String CONNECTED_APPS_DISALLOWED_PACKAGES =
                "connected_apps_disallowed_packages";
        /** @hide */ public static String zenModeToString(int mode) {
            if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
            if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
+2 −0
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@ public class GlobalSettings {
     * NOTE: All settings which are backed up should have a corresponding validator.
     */
    public static final String[] SETTINGS_TO_BACKUP = {
        Settings.Global.CONNECTED_APPS_ALLOWED_PACKAGES,
        Settings.Global.CONNECTED_APPS_DISALLOWED_PACKAGES,
        Settings.Global.APPLY_RAMPING_RINGER,
        Settings.Global.BUGREPORT_IN_POWER_MENU,                        // moved to secure
        Settings.Global.STAY_ON_WHILE_PLUGGED_IN,
+3 −0
Original line number Diff line number Diff line
@@ -51,6 +51,9 @@ public class GlobalSettingsValidators {
    public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();

    static {
        VALIDATORS.put(Global.CONNECTED_APPS_ALLOWED_PACKAGES, new PackageNameListValidator((",")));
        VALIDATORS.put(Global.CONNECTED_APPS_DISALLOWED_PACKAGES,
                new PackageNameListValidator((",")));
        VALIDATORS.put(Global.APPLY_RAMPING_RINGER, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Global.BUGREPORT_IN_POWER_MENU, BOOLEAN_VALIDATOR);
        VALIDATORS.put(