Merge "Fixed the robo test failed in AutoRotatePreferenceControllerTest and SmartAutoRotatePreferenceControllerTest" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
79343b4680
@@ -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() {
|
||||||
|
|||||||
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user