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

Commit 3d0927b5 authored by Dean Harding's avatar Dean Harding Committed by Android (Google) Code Review
Browse files

Merge "Ignore the dp limitation on config_forceDefaultOrientation in a car."

parents 956ab6ac d12a8044
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2270,7 +2270,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {

        // Only force the default orientation if the screen is xlarge, at least 960dp x 720dp, per
        // http://developer.android.com/guide/practices/screens_support.html#range
        mForceDefaultOrientation = longSizeDp >= 960 && shortSizeDp >= 720 &&
        // For car, ignore the dp limitation. It's physically impossible to rotate the car's screen
        // so if the orientation is forced, we need to respect that no matter what.
        boolean isCar = mContext.getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_AUTOMOTIVE);
        mForceDefaultOrientation = ((longSizeDp >= 960 && shortSizeDp >= 720) || isCar) &&
                res.getBoolean(com.android.internal.R.bool.config_forceDefaultOrientation) &&
                // For debug purposes the next line turns this feature off with:
                // $ adb shell setprop config.override_forced_orient true