Merge "Expand ASM activation warning." into oc-dr1-dev

am: 64acb2906c

Change-Id: I980227fd99274364a7160a0e896b9518c2de1dd0
This commit is contained in:
Daniel Nishi
2017-07-11 19:56:41 +00:00
committed by android-build-merger
2 changed files with 30 additions and 3 deletions

View File

@@ -88,9 +88,17 @@ public class AutomaticStorageManagementSwitchPreferenceController extends Prefer
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_ENABLED,
isChecked ? 1 : 0);
boolean storageManagerEnabledByDefault = SystemProperties.getBoolean(
STORAGE_MANAGER_ENABLED_BY_DEFAULT_PROPERTY, false);
if (isChecked && !storageManagerEnabledByDefault) {
final boolean storageManagerEnabledByDefault =
SystemProperties.getBoolean(STORAGE_MANAGER_ENABLED_BY_DEFAULT_PROPERTY, false);
final boolean storageManagerDisabledByPolicy =
Settings.Secure.getInt(
mContext.getContentResolver(),
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY,
0)
!= 0;
// Show warning if it is disabled by default and turning it on or if it was disabled by
// policy and we're turning it on.
if ((isChecked && (!storageManagerEnabledByDefault || storageManagerDisabledByPolicy))) {
ActivationWarningFragment fragment = ActivationWarningFragment.newInstance();
fragment.show(mFragmentManager, ActivationWarningFragment.TAG);
}