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

Commit 1e13e374 authored by Annie Meng's avatar Annie Meng
Browse files

Create a setting for backup/restore agent timeouts

Part of push to make backup and restore agent timeouts configurable. Creates
a Global setting for the current static BackupManagerService timeouts so
that they can be overriden with P/H. We keep the current default values,
which will be updated once we investigate what more appropriate values are.

Remame the constants to better reflect what they're used
for. Next, we will update the framework to use these constants.

This depends on the refactor of how we observe changes to key value
backup settings (ag/3709997).

Bug: 70276070
Test: m -j RunFrameworksServicesRoboTests ROBOTEST_FILTER=BackupAgentTimeoutParametersTest
Change-Id: Id506314ce0c8bd5e4d1d8b4001b26cbad0056c99
parent 5772194a
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -12360,6 +12360,28 @@ public final class Settings {
         * @hide
         */
        public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification";

        /**
         * Backup and restore agent timeout parameters.
         * These parameters are represented by a comma-delimited key-value list.
         *
         * The following strings are supported as keys:
         * <pre>
         *     kv_backup_agent_timeout_millis         (long)
         *     full_backup_agent_timeout_millis       (long)
         *     shared_backup_agent_timeout_millis     (long)
         *     restore_agent_timeout_millis           (long)
         *     restore_agent_finished_timeout_millis  (long)
         * </pre>
         *
         * They map to milliseconds represented as longs.
         *
         * Ex: "kv_backup_agent_timeout_millis=30000,full_backup_agent_timeout_millis=300000"
         *
         * @hide
         */
        public static final String BACKUP_AGENT_TIMEOUT_PARAMETERS =
                "backup_agent_timeout_parameters";
    }

    /**
+2 −1
Original line number Diff line number Diff line
@@ -502,9 +502,10 @@ message GlobalSettingsProto {
    optional SettingProto show_restart_in_crash_dialog = 383 [ (android.privacy).dest = DEST_AUTOMATIC ];
    optional SettingProto show_mute_in_crash_dialog = 384 [ (android.privacy).dest = DEST_AUTOMATIC ];
    optional SettingsProto show_zen_upgrade_notification = 385  [ (android.privacy).dest = DEST_AUTOMATIC ];
    optional SettingsProto backup_agent_timeout_parameters = 386;
    // Please insert fields in the same order as in
    // frameworks/base/core/java/android/provider/Settings.java.
    // Next tag = 386;
    // Next tag = 387;
}

message SecureSettingsProto {
+2 −2
Original line number Diff line number Diff line
@@ -464,8 +464,8 @@ public class SettingsBackupTest {
                    Settings.Global.ZRAM_ENABLED,
                    Settings.Global.OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION,
                    Settings.Global.CHAINED_BATTERY_ATTRIBUTION_ENABLED,
                    Settings.Global.HIDDEN_API_BLACKLIST_EXEMPTIONS);

                    Settings.Global.HIDDEN_API_BLACKLIST_EXEMPTIONS,
                    Settings.Global.BACKUP_AGENT_TIMEOUT_PARAMETERS);
    private static final Set<String> BACKUP_BLACKLISTED_SECURE_SETTINGS =
             newHashSet(
                 Settings.Secure.ACCESSIBILITY_SOFT_KEYBOARD_MODE,
+3 −0
Original line number Diff line number Diff line
@@ -207,4 +207,7 @@
        Else (if negative), turning on dnd manually will surface a dialog that prompts
            user to specify a duration.-->
    <integer name="def_zen_duration">0</integer>

    <!-- Default for Settings.Global.BACKUP_AGENT_TIMEOUT_PARAMETERS -->
    <string name="def_backup_agent_timeout_parameters"></string>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -1253,6 +1253,9 @@ class SettingsProtoDumpUtil {
        dumpSetting(s, p,
                Settings.Global.SHOW_ZEN_UPGRADE_NOTIFICATION,
                GlobalSettingsProto.SHOW_ZEN_UPGRADE_NOTIFICATION);
        dumpSetting(s, p,
                Settings.Global.BACKUP_AGENT_TIMEOUT_PARAMETERS,
                GlobalSettingsProto.BACKUP_AGENT_TIMEOUT_PARAMETERS);
        // Please insert new settings using the same order as in Settings.Global.

        p.end(token);
Loading