Revert "Add support for device state based auto-rotation prefere..."

Revert submission 16745827-device-state-auto-rotation-preferences-aops

Reason for revert: Checking if reason for test failures
Reverted Changes:
I77ed93f04:Add support for device state based auto-rotation p...
I5b2791f54:Add support for device state based auto-rotation p...
If254220ca:Add support for device state based auto-rotation p...
If254220ca:Add support for device state based auto-rotation p...

Fix: 219652963
Change-Id: Id95d5d7bb18a28403a6d3199945044e6617e0772
This commit is contained in:
Christian Göllner
2022-02-16 09:56:15 +00:00
parent 78a0e714c4
commit a663f10c4e
24 changed files with 14 additions and 1106 deletions

View File

@@ -30,7 +30,6 @@ import android.provider.Settings;
import androidx.preference.SwitchPreference;
import com.android.internal.R;
import com.android.internal.view.RotationPolicy;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.testutils.FakeFeatureFactory;
@@ -65,7 +64,6 @@ public class AutoRotatePreferenceControllerTest {
mPreference = new SwitchPreference(RuntimeEnvironment.application);
when(mContext.getPackageManager()).thenReturn(mPackageManager);
when(mContext.getContentResolver()).thenReturn(mContentResolver);
disableDeviceStateRotation();
mController = new AutoRotatePreferenceController(mContext, "auto_rotate");
}
@@ -113,26 +111,6 @@ public class AutoRotatePreferenceControllerTest {
.UNSUPPORTED_ON_DEVICE);
}
@Test
public void getAvailabilityStatus_deviceRotationDisabled_returnsAvailable() {
enableAutoRotationPreference();
disableDeviceStateRotation();
int availability = mController.getAvailabilityStatus();
assertThat(availability).isEqualTo(BasePreferenceController.AVAILABLE);
}
@Test
public void getAvailabilityStatus_deviceRotationEnabled_returnsUnsupported() {
enableAutoRotationPreference();
enableDeviceStateRotation();
int availability = mController.getAvailabilityStatus();
assertThat(availability).isEqualTo(BasePreferenceController.UNSUPPORTED_ON_DEVICE);
}
@Test
public void testIsCheck() {
assertThat(mController.isChecked()).isFalse();
@@ -202,15 +180,4 @@ public class AutoRotatePreferenceControllerTest {
Settings.System.putIntForUser(mContentResolver,
Settings.System.ACCELEROMETER_ROTATION, 0, UserHandle.USER_CURRENT);
}
private void enableDeviceStateRotation() {
when(mContext.getResources().getStringArray(
R.array.config_perDeviceStateRotationLockDefaults)).thenReturn(
new String[]{"0:0", "1:1", "2:2"});
}
private void disableDeviceStateRotation() {
when(mContext.getResources().getStringArray(
R.array.config_perDeviceStateRotationLockDefaults)).thenReturn(new String[]{});
}
}