Merge "Expand ASM activation warning." into oc-dr1-dev am: 64acb2906c

am: 4961451a4e

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

View File

@@ -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));
}
}