diff options
author | Sean Francis-Lyon <seanflyon@google.com> | 2015-06-12 17:46:41 -0700 |
---|---|---|
committer | Sean Francis-Lyon <seanflyon@google.com> | 2015-06-15 18:11:41 -0700 |
commit | c44d0ef1dc67466fe59c1a26a657c2f9043c948b (patch) | |
tree | 02c96526ddf37f21aaa7125c9bbb467f14527df3 /src/com/android/settings/backup/ToggleBackupSettingFragment.java | |
parent | bada978ec3eab48564c29eb4f8169e88975a2da0 (diff) | |
download | packages_apps_Settings-c44d0ef1dc67466fe59c1a26a657c2f9043c948b.zip packages_apps_Settings-c44d0ef1dc67466fe59c1a26a657c2f9043c948b.tar.gz packages_apps_Settings-c44d0ef1dc67466fe59c1a26a657c2f9043c948b.tar.bz2 |
show old legal text in backup settings if full data backup is disabled
Change-Id: Ifc4fa5c4a6180fd4ceb41ca66dc2dd6a58f4f086
Diffstat (limited to 'src/com/android/settings/backup/ToggleBackupSettingFragment.java')
-rw-r--r-- | src/com/android/settings/backup/ToggleBackupSettingFragment.java | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/com/android/settings/backup/ToggleBackupSettingFragment.java b/src/com/android/settings/backup/ToggleBackupSettingFragment.java index bc85bf3..6942a42 100644 --- a/src/com/android/settings/backup/ToggleBackupSettingFragment.java +++ b/src/com/android/settings/backup/ToggleBackupSettingFragment.java @@ -10,6 +10,7 @@ import android.os.RemoteException; import android.os.ServiceManager; import android.preference.Preference; import android.preference.PreferenceScreen; +import android.provider.Settings; import android.util.Log; import android.view.View; import android.widget.TextView; @@ -31,6 +32,11 @@ public class ToggleBackupSettingFragment extends SettingsPreferenceFragment private static final String BACKUP_TOGGLE = "toggle_backup"; + // System setting that governs whether the user is eligible for full app-data backup, + // based on whether they have been presented with the details of what that backup entails + // (usually surfaced somewhere like device setup) + private static final String USER_FULL_DATA_BACKUP_AWARE = "user_full_data_backup_aware"; + private IBackupManager mBackupManager; protected SwitchBar mSwitchBar; @@ -74,7 +80,14 @@ public class ToggleBackupSettingFragment extends SettingsPreferenceFragment mToggleSwitch = mSwitchBar.getSwitch(); // Set up UI. - mSummaryPreference.setSummary(R.string.fullbackup_data_summary); + // If the user has not seen legal text for full data backup (if they OTA from L to M) then + // full data backup will be off and here we want to show the old summary here that does + // not mention full data backup + if (Settings.Secure.getInt(getContentResolver(), USER_FULL_DATA_BACKUP_AWARE, 0) != 0) { + mSummaryPreference.setSummary(R.string.fullbackup_data_summary); + } else { + mSummaryPreference.setSummary(R.string.backup_data_summary); + } try { boolean backupEnabled = mBackupManager == null ? false : mBackupManager.isBackupEnabled(); @@ -155,7 +168,16 @@ public class ToggleBackupSettingFragment extends SettingsPreferenceFragment } private void showEraseBackupDialog() { - CharSequence msg = getResources().getText(R.string.fullbackup_erase_dialog_message); + CharSequence msg; + + // If the user has not seen legal text for full data backup (if they OTA from L to M) then + // full data backup will be off and here we want to show the old erase_dialog_message here + // that does not mention full data backup + if (Settings.Secure.getInt(getContentResolver(), USER_FULL_DATA_BACKUP_AWARE, 0) != 0) { + msg = getResources().getText(R.string.fullbackup_erase_dialog_message); + } else { + msg = getResources().getText(R.string.backup_erase_dialog_message); + } mWaitingForConfirmationDialog = true; |