Show "Backup service isn't active" if backup isnt active for work

profile

Bug: 127821779

Test: 1) Set up work profile.
2) adb shell bmgr --user 19 activate true
3) Settings -> System -> Backup -> Work -> Shows google backup settings
4) adb shell bmgr --user 19 activate false
5) Settings -> System -> Backup -> Work -> "Backup service isn't active"

Change-Id: Ifc16cf3e69fd9db87d519cbad68f0f8e9d8ef6f3
This commit is contained in:
Chandan Nath
2019-04-01 21:05:15 +01:00
parent dad8b16fa9
commit 9071506902
3 changed files with 9 additions and 20 deletions

View File

@@ -632,10 +632,14 @@ public class SettingsActivity extends SettingsBaseActivity
showDev, isAdmin)
|| somethingChanged;
// Enable/disable backup settings depending on whether backup is activated for the user.
boolean isBackupActive = new BackupSettingsHelper(this).isBackupServiceActive();
// For profiles, we want them to be included in the profile select dialog even if
// backup is not activated.
// For other users, enable/disable backup settings depending on whether backup is activated
// for the user.
boolean enableBackupTile = um.isManagedProfile()
|| new BackupSettingsHelper(this).isBackupServiceActive();
somethingChanged = setTileEnabled(changedList, new ComponentName(packageName,
UserBackupSettingsActivity.class.getName()), isBackupActive, isAdmin)
UserBackupSettingsActivity.class.getName()), enableBackupTile, isAdmin)
|| somethingChanged;
somethingChanged = setTileEnabled(changedList, new ComponentName(packageName,