Don't show warning dialog on opening ASM settings.
On older devices, the activation warning dialog would show upon the switchbar changing to On. This was occurring when the page opens because the status was changing onResume. By shuffling the switchbar changes into the ASMSwitchBarController, we can register our listener after the initialization of the switch bar's first status. Change-Id: I3610d07345684d1e66444981a8059d1c2965e955 Fixes: 37472724 Test: Settings robotests
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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user