Loading core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -9784,6 +9784,14 @@ public final class Settings { public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED = "location_settings_link_to_permissions_enabled"; /** * Flag to enable use of RefactoredBackupManagerService. * * @hide */ public static final String BACKUP_REFACTORED_SERVICE_DISABLED = "backup_refactored_service_disabled"; /** * Settings to backup. This is here so that it's in the same place as the settings * keys and easy to update. Loading core/tests/coretests/src/android/provider/SettingsBackupTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ public class SettingsBackupTest { Settings.Global.APP_IDLE_CONSTANTS, Settings.Global.ASSISTED_GPS_ENABLED, Settings.Global.AUDIO_SAFE_VOLUME_STATE, Settings.Global.BACKUP_REFACTORED_SERVICE_DISABLED, Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD, Settings.Global.BATTERY_DISCHARGE_THRESHOLD, Settings.Global.BLE_SCAN_ALWAYS_AVAILABLE, Loading services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java 0 → 100644 +11372 −0 File added.Preview size limit exceeded, changes collapsed. Show changes services/backup/java/com/android/server/backup/Trampoline.java +15 −2 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import android.os.Process; import android.os.RemoteException; import android.os.SystemProperties; import android.os.UserHandle; import android.provider.Settings; import android.util.Slog; import com.android.internal.util.DumpUtils; Loading Loading @@ -65,6 +66,18 @@ public class Trampoline extends IBackupManager.Stub { mGlobalDisable = SystemProperties.getBoolean(BACKUP_DISABLE_PROPERTY, false); } private BackupManagerServiceInterface createService() { boolean refactoredServiceEnabled = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.BACKUP_REFACTORED_SERVICE_DISABLED, 1) == 0; if (refactoredServiceEnabled) { Slog.i(TAG, "Instantiating RefactoredBackupManagerService"); return new RefactoredBackupManagerService(mContext, this); } Slog.i(TAG, "Instantiating BackupManagerService"); return new BackupManagerService(mContext, this); } // internal control API public void initialize(final int whichUser) { // Note that only the owner user is currently involved in backup/restore Loading @@ -78,7 +91,7 @@ public class Trampoline extends IBackupManager.Stub { synchronized (this) { if (!mSuppressFile.exists()) { mService = new BackupManagerService(mContext, this); mService = createService(); } else { Slog.i(TAG, "Backup inactive in user " + whichUser); } Loading @@ -105,7 +118,7 @@ public class Trampoline extends IBackupManager.Stub { Slog.i(TAG, "Making backup " + (makeActive ? "" : "in") + "active in user " + userHandle); if (makeActive) { mService = new BackupManagerService(mContext, this); mService = createService(); mSuppressFile.delete(); } else { mService = null; Loading Loading
core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -9784,6 +9784,14 @@ public final class Settings { public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED = "location_settings_link_to_permissions_enabled"; /** * Flag to enable use of RefactoredBackupManagerService. * * @hide */ public static final String BACKUP_REFACTORED_SERVICE_DISABLED = "backup_refactored_service_disabled"; /** * Settings to backup. This is here so that it's in the same place as the settings * keys and easy to update. Loading
core/tests/coretests/src/android/provider/SettingsBackupTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ public class SettingsBackupTest { Settings.Global.APP_IDLE_CONSTANTS, Settings.Global.ASSISTED_GPS_ENABLED, Settings.Global.AUDIO_SAFE_VOLUME_STATE, Settings.Global.BACKUP_REFACTORED_SERVICE_DISABLED, Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD, Settings.Global.BATTERY_DISCHARGE_THRESHOLD, Settings.Global.BLE_SCAN_ALWAYS_AVAILABLE, Loading
services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java 0 → 100644 +11372 −0 File added.Preview size limit exceeded, changes collapsed. Show changes
services/backup/java/com/android/server/backup/Trampoline.java +15 −2 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import android.os.Process; import android.os.RemoteException; import android.os.SystemProperties; import android.os.UserHandle; import android.provider.Settings; import android.util.Slog; import com.android.internal.util.DumpUtils; Loading Loading @@ -65,6 +66,18 @@ public class Trampoline extends IBackupManager.Stub { mGlobalDisable = SystemProperties.getBoolean(BACKUP_DISABLE_PROPERTY, false); } private BackupManagerServiceInterface createService() { boolean refactoredServiceEnabled = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.BACKUP_REFACTORED_SERVICE_DISABLED, 1) == 0; if (refactoredServiceEnabled) { Slog.i(TAG, "Instantiating RefactoredBackupManagerService"); return new RefactoredBackupManagerService(mContext, this); } Slog.i(TAG, "Instantiating BackupManagerService"); return new BackupManagerService(mContext, this); } // internal control API public void initialize(final int whichUser) { // Note that only the owner user is currently involved in backup/restore Loading @@ -78,7 +91,7 @@ public class Trampoline extends IBackupManager.Stub { synchronized (this) { if (!mSuppressFile.exists()) { mService = new BackupManagerService(mContext, this); mService = createService(); } else { Slog.i(TAG, "Backup inactive in user " + whichUser); } Loading @@ -105,7 +118,7 @@ public class Trampoline extends IBackupManager.Stub { Slog.i(TAG, "Making backup " + (makeActive ? "" : "in") + "active in user " + userHandle); if (makeActive) { mService = new BackupManagerService(mContext, this); mService = createService(); mSuppressFile.delete(); } else { mService = null; Loading