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

Commit 75f5e68f authored by Piyush Mehrotra's avatar Piyush Mehrotra
Browse files

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
parent 07ae4c71
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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<String> systemPackagesAllowedForAllUsers =
            Sets.newArraySet(PACKAGE_MANAGER_SENTINEL, PLATFORM_PACKAGE_NAME, WALLPAPER_PACKAGE);
    private static final Set<String> systemPackagesAllowedForAllUsers = Sets.newArraySet(
            PACKAGE_MANAGER_SENTINEL, PLATFORM_PACKAGE_NAME, WALLPAPER_PACKAGE, SETTINGS_PACKAGE);

    private final PackageManager mPackageManager;
    private final PackageManagerInternal mPackageManagerInternal;