SettingsRoboTests: fix device state rotation related tests
Fixes: 280015539 Test: atest SettingsRoboTests Change-Id: I0a3cc713f8df0477a172665a60551b456691b17c
This commit is contained in:
@@ -53,6 +53,7 @@ import org.mockito.MockitoAnnotations;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.RuntimeEnvironment;
|
||||
import org.robolectric.annotation.Config;
|
||||
import org.robolectric.shadow.api.Shadow;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
@Config(shadows = ShadowSensorPrivacyManager.class)
|
||||
@@ -171,16 +172,14 @@ public class SmartAutoRotateControllerTest {
|
||||
}
|
||||
|
||||
private void lockDeviceStateRotation() {
|
||||
mDeviceStateAutoRotateSettingsManager.updateSetting(
|
||||
/* deviceState= */0, /* rotationLocked= */ true);
|
||||
mDeviceStateAutoRotateSettingsManager.updateSetting(
|
||||
/* deviceState= */1, /* rotationLocked= */ true);
|
||||
ShadowDeviceStateRotationLockSettingsManager shadowManager =
|
||||
Shadow.extract(mDeviceStateAutoRotateSettingsManager);
|
||||
shadowManager.setRotationLockedForAllStates(true);
|
||||
}
|
||||
|
||||
private void unlockDeviceStateRotation() {
|
||||
mDeviceStateAutoRotateSettingsManager.updateSetting(
|
||||
/* deviceState= */0, /* rotationLocked= */ false);
|
||||
mDeviceStateAutoRotateSettingsManager.updateSetting(
|
||||
/* deviceState= */1, /* rotationLocked= */ true);
|
||||
ShadowDeviceStateRotationLockSettingsManager shadowManager =
|
||||
Shadow.extract(mDeviceStateAutoRotateSettingsManager);
|
||||
shadowManager.setRotationLockedForAllStates(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user