Merge "Don't show warning dialog on opening ASM settings." into oc-dev am: 81f98a8fd5
am: c7734f589e
Change-Id: Idc4760b31fa82f2e5387225f3da7c621a8decf4c
This commit is contained in:
@@ -123,9 +123,6 @@ public class AutomaticStorageManagerSettings extends SettingsPreferenceFragment
|
||||
boolean isStorageManagerChecked =
|
||||
Settings.Secure.getInt(getContentResolver(),
|
||||
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_ENABLED, 0) != 0;
|
||||
// Using the setCheckedInternal means the checked status won't propagate through the
|
||||
// listeners -- this will prevent us from accidentally causing a metrics event on resume.
|
||||
mSwitchBar.setCheckedInternal(isStorageManagerChecked);
|
||||
mDaysToRetain.setEnabled(isStorageManagerChecked);
|
||||
}
|
||||
|
||||
|
@@ -52,6 +52,17 @@ public class AutomaticStorageManagerSwitchBarController
|
||||
mDaysToRetainPreference = Preconditions.checkNotNull(daysToRetainPreference);
|
||||
mFragmentManager = Preconditions.checkNotNull(fragmentManager);
|
||||
|
||||
initializeCheckedStatus();
|
||||
}
|
||||
|
||||
private void initializeCheckedStatus() {
|
||||
boolean isStorageManagerChecked =
|
||||
Settings.Secure.getInt(
|
||||
mContext.getContentResolver(),
|
||||
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_ENABLED,
|
||||
0)
|
||||
!= 0;
|
||||
mSwitchBar.setChecked(isStorageManagerChecked);
|
||||
mSwitchBar.addOnSwitchChangeListener(this);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user