Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 383edb4a authored by Sunny Shao's avatar Sunny Shao
Browse files

Fixed the robo test failed in AutoRotatePreferenceControllerTest

	and SmartAutoRotatePreferenceControllerTest

- Use the correct Settings.System.putIntForUser API.

Fixes: 300200193
Fixes: 300201185
Test: atest AutoRotatePreferenceControllerTest
Test: atest SmartAutoRotatePreferenceControllerTest
Change-Id: Iadd890f21431ccb5d538e40426b0c7d43d46ba52
parent 21c967bc
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -190,15 +190,17 @@ public class AutoRotatePreferenceControllerTest {
    private void enableAutoRotationPreference() {
    private void enableAutoRotationPreference() {
        when(mPackageManager.hasSystemFeature(anyString())).thenReturn(true);
        when(mPackageManager.hasSystemFeature(anyString())).thenReturn(true);
        when(mContext.getResources().getBoolean(anyInt())).thenReturn(true);
        when(mContext.getResources().getBoolean(anyInt())).thenReturn(true);
        Settings.System.putInt(mContentResolver,
        Settings.System.putIntForUser(mContentResolver,
                Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 0);
                Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 0,
                UserHandle.USER_CURRENT);
    }
    }


    private void disableAutoRotationPreference() {
    private void disableAutoRotationPreference() {
        when(mPackageManager.hasSystemFeature(anyString())).thenReturn(true);
        when(mPackageManager.hasSystemFeature(anyString())).thenReturn(true);
        when(mContext.getResources().getBoolean(anyInt())).thenReturn(true);
        when(mContext.getResources().getBoolean(anyInt())).thenReturn(true);
        Settings.System.putInt(mContentResolver,
        Settings.System.putIntForUser(mContentResolver,
                Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 1);
                Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 1,
                UserHandle.USER_CURRENT);
    }
    }


    private void enableAutoRotation() {
    private void enableAutoRotation() {
+6 −4
Original line number Original line Diff line number Diff line
@@ -236,15 +236,17 @@ public class SmartAutoRotatePreferenceControllerTest {
    private void enableAutoRotationPreference() {
    private void enableAutoRotationPreference() {
        when(mPackageManager.hasSystemFeature(anyString())).thenReturn(true);
        when(mPackageManager.hasSystemFeature(anyString())).thenReturn(true);
        when(mResources.getBoolean(anyInt())).thenReturn(true);
        when(mResources.getBoolean(anyInt())).thenReturn(true);
        Settings.System.putInt(mContentResolver,
        Settings.System.putIntForUser(mContentResolver,
                Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 0);
                Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 0,
                UserHandle.USER_CURRENT);
    }
    }


    private void disableAutoRotationPreference() {
    private void disableAutoRotationPreference() {
        when(mPackageManager.hasSystemFeature(anyString())).thenReturn(true);
        when(mPackageManager.hasSystemFeature(anyString())).thenReturn(true);
        when(mResources.getBoolean(anyInt())).thenReturn(true);
        when(mResources.getBoolean(anyInt())).thenReturn(true);
        Settings.System.putInt(mContentResolver,
        Settings.System.putIntForUser(mContentResolver,
                Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 1);
                Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 1,
                UserHandle.USER_CURRENT);
    }
    }


    private void enableAutoRotation() {
    private void enableAutoRotation() {