Expand ASM activation warning.
If the device had ASM enabled by default but still opted to disable ASM for policy reasons, we need to start warning the user. Change-Id: I6a296e95d00413308de3ddc565b42c5f605087e9 Fixes: 62105682 Test: Settings robotest
This commit is contained in:
@@ -168,4 +168,23 @@ public class AutomaticStorageManagementSwitchPreferenceControllerTest {
|
||||
|
||||
verify(transaction, never()).add(any(), eq(ActivationWarningFragment.TAG));
|
||||
}
|
||||
|
||||
@Config(shadows = {SettingsShadowSystemProperties.class})
|
||||
@Test
|
||||
public void togglingOnShouldTriggerWarningFragmentIfEnabledByDefaultAndDisabledByPolicy() {
|
||||
FragmentTransaction transaction = mock(FragmentTransaction.class);
|
||||
when(mFragmentManager.beginTransaction()).thenReturn(transaction);
|
||||
SettingsShadowSystemProperties.set(
|
||||
AutomaticStorageManagementSwitchPreferenceController
|
||||
.STORAGE_MANAGER_ENABLED_BY_DEFAULT_PROPERTY,
|
||||
"true");
|
||||
Settings.Secure.putInt(
|
||||
mContext.getContentResolver(),
|
||||
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY,
|
||||
1);
|
||||
|
||||
mController.onSwitchToggled(true);
|
||||
|
||||
verify(transaction).add(any(), eq(ActivationWarningFragment.TAG));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user