Merge "Always show backup settings (even if backup is deactivated)." into qt-dev
This commit is contained in:
@@ -639,9 +639,8 @@ public class SettingsActivity extends SettingsBaseActivity
|
||||
showDev, isAdmin)
|
||||
|| somethingChanged;
|
||||
|
||||
boolean enableBackupTile = new BackupSettingsHelper(this).showBackupSettingsForUser();
|
||||
somethingChanged = setTileEnabled(changedList, new ComponentName(packageName,
|
||||
UserBackupSettingsActivity.class.getName()), enableBackupTile, isAdmin)
|
||||
UserBackupSettingsActivity.class.getName()), true, isAdmin)
|
||||
|| somethingChanged;
|
||||
|
||||
somethingChanged = setTileEnabled(changedList, new ComponentName(packageName,
|
||||
|
@@ -28,7 +28,7 @@ public class BackupInactivePreferenceController extends BasePreferenceController
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
if (!new BackupSettingsHelper(mContext).showBackupSettingsForUser()) {
|
||||
if (!new BackupSettingsHelper(mContext).isBackupServiceActive()) {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
}
|
||||
if (PrivacySettingsUtils.isInvisibleKey(mContext, PrivacySettingsUtils.BACKUP_INACTIVE)) {
|
||||
|
@@ -50,14 +50,6 @@ public class BackupSettingsHelper {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
public boolean showBackupSettingsForUser() {
|
||||
// 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.
|
||||
return UserManager.get(mContext).isManagedProfile() || isBackupServiceActive();
|
||||
}
|
||||
|
||||
/**
|
||||
* If there is only one profile, show whether the backup is on or off.
|
||||
* Otherwise, show nothing.
|
||||
|
@@ -123,7 +123,7 @@ public class UserBackupSettingsActivity extends FragmentActivity implements Inde
|
||||
@Override
|
||||
public List<String> getNonIndexableKeys(Context context) {
|
||||
final List<String> keys = super.getNonIndexableKeys(context);
|
||||
if (!new BackupSettingsHelper(context).showBackupSettingsForUser()) {
|
||||
if (!new BackupSettingsHelper(context).isBackupServiceActive()) {
|
||||
keys.add(BACKUP_SEARCH_INDEX_KEY);
|
||||
}
|
||||
return keys;
|
||||
|
Reference in New Issue
Block a user