Merge "Creates a flag for auto-rotate with face detection" into tm-qpr-dev

This commit is contained in:
Yi Jiang
2022-12-13 16:27:35 +00:00
committed by Android (Google) Code Review
4 changed files with 24 additions and 0 deletions

View File

@@ -180,6 +180,10 @@ public class SmartAutoRotateController extends TogglePreferenceController implem
* Returns true if there is a {@link RotationResolverService} available
*/
public static boolean isRotationResolverServiceAvailable(Context context) {
if (!context.getResources().getBoolean(
R.bool.config_auto_rotate_face_detection_available)) {
return false;
}
final PackageManager packageManager = context.getPackageManager();
final String resolvePackage = packageManager.getRotationResolverPackageName();
if (TextUtils.isEmpty(resolvePackage)) {