Merge "Fix auto-rotate summary not updating on devices without smart-auto-rotate" into sc-dev

This commit is contained in:
Abel Tesfaye
2021-03-15 16:27:16 +00:00
committed by Android (Google) Code Review
2 changed files with 25 additions and 13 deletions

View File

@@ -107,6 +107,25 @@ public class SmartAutoRotatePreferenceControllerTest {
assertThat(mController.getSummary()).isEqualTo("Off");
}
@Test
public void updatePreference_settingsIsOff_noSmartAuto_shouldTurnOffToggle() {
disableAutoRotation();
Settings.Secure.putStringForUser(mContentResolver,
CAMERA_AUTOROTATE, null, UserHandle.USER_CURRENT);
assertThat(mController.getSummary()).isEqualTo("Off");
}
@Test
public void updatePreference_settingsIsOn_noSmartAuto_shouldTurnOnToggle() {
enableAutoRotation();
Settings.Secure.putStringForUser(mContentResolver,
CAMERA_AUTOROTATE, null, UserHandle.USER_CURRENT);
assertThat(mController.getSummary()).isEqualTo("On");
}
@Test
public void testGetAvailabilityStatus() {
assertThat(mController.getAvailabilityStatus()).isEqualTo(BasePreferenceController