From 75f5e68fe6498837c33bc2a8295b352e40b4bca4 Mon Sep 17 00:00:00 2001 From: Piyush Mehrotra Date: Mon, 2 Jan 2023 15:29:36 +0000 Subject: [PATCH] Make Settings B&R flow work for HSUM Current flow blocks system packages to be backed up for non-system users, unless explicitly allowed. This change modifies that allow list to include settings package. Since settings is crucial part of B&R flow, hence it needs appropriate testing to ensure this works in HSUM. There are many categories of settings for which B&R happens - System, Secure, Global, Device Config (Screen Rotation Lock, Display Density), Locale (Languages, App Languages), Lock Settings (Lock Pattern Visible), Softap Config (Tethering related), Network Policies (SIM specific Data related settings), Wifi Config (wpa_supplicant.conf file) and other SIM specific settings. To cover all bases, we manually test modifying settings from each category and doing B&R to see if changes are reflected. Bug: 259848616 Test: - Set 'auto_time_zone' and 'auto_time' Global settings both to 0 (Default is 1) - Set 'accessibility_display_inversion_enabled' and 'lock_screen_show_notifications' Secure settings to 1 and 0 respectively (opposite of default values) - Set 'screen_off_timeout' System setting to 60000 (Default value - 30000) - Modify settings under System -> Languages & Input -> Languages. Add more languages. - Set Screen Lock to be a pattern. Change Pattern settings to make to make pattern not visible (default is visible). - Change Hotspot settings (Different hotspot name/password) - Add different networks under Wifi. - Set Auto screen rotation (default has auto rotation disabled) - Set SIM specific settings (Set Roaming ON, Modify Data warning and limit setting). - Do backup after settings change. - Restore on a fresh install device and verify all the changes. Change-Id: I53d3c6527903a600049dfb2376c7e140e1e55031 --- .../android/server/backup/utils/BackupEligibilityRules.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/backup/java/com/android/server/backup/utils/BackupEligibilityRules.java b/services/backup/java/com/android/server/backup/utils/BackupEligibilityRules.java index b20ff37260a6f..2ee9174961364 100644 --- a/services/backup/java/com/android/server/backup/utils/BackupEligibilityRules.java +++ b/services/backup/java/com/android/server/backup/utils/BackupEligibilityRules.java @@ -19,6 +19,7 @@ package com.android.server.backup.utils; import static com.android.server.backup.BackupManagerService.MORE_DEBUG; import static com.android.server.backup.BackupManagerService.TAG; import static com.android.server.backup.UserBackupManagerService.PACKAGE_MANAGER_SENTINEL; +import static com.android.server.backup.UserBackupManagerService.SETTINGS_PACKAGE; import static com.android.server.backup.UserBackupManagerService.SHARED_BACKUP_AGENT_PACKAGE; import static com.android.server.backup.UserBackupManagerService.WALLPAPER_PACKAGE; import static com.android.server.pm.PackageManagerService.PLATFORM_PACKAGE_NAME; @@ -56,8 +57,8 @@ import java.util.Set; public class BackupEligibilityRules { private static final boolean DEBUG = false; // List of system packages that are eligible for backup in non-system users. - private static final Set systemPackagesAllowedForAllUsers = - Sets.newArraySet(PACKAGE_MANAGER_SENTINEL, PLATFORM_PACKAGE_NAME, WALLPAPER_PACKAGE); + private static final Set systemPackagesAllowedForAllUsers = Sets.newArraySet( + PACKAGE_MANAGER_SENTINEL, PLATFORM_PACKAGE_NAME, WALLPAPER_PACKAGE, SETTINGS_PACKAGE); private final PackageManager mPackageManager; private final PackageManagerInternal mPackageManagerInternal;