Creates a flag for auto-rotate with face detection

The flag is enabled by default. And will be disabled on foldable
devices.

Test: locally
Bug: 236249360

Change-Id: I8c90533f6011531a4f00af5f2514579638604067
This commit is contained in:
Yi Jiang
2022-12-09 16:33:23 -08:00
parent 7bae5625a6
commit 1145b26ac7
4 changed files with 24 additions and 0 deletions

View File

@@ -80,6 +80,9 @@ public class SmartAutoRotatePreferenceControllerTest {
when(mContext.getResources()).thenReturn(mResources);
when(mContext.getContentResolver()).thenReturn(mContentResolver);
when(mResources.getBoolean(R.bool.config_auto_rotate_face_detection_available)).thenReturn(
true);
doReturn(PACKAGE_NAME).when(mPackageManager).getRotationResolverPackageName();
doReturn(PackageManager.PERMISSION_GRANTED).when(mPackageManager).checkPermission(
Manifest.permission.CAMERA, PACKAGE_NAME);