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

Commit 64938fb2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "PhoneWindowManager: allow force default rotation for TV"

parents 6b467529 95231217
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2308,9 +2308,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        // http://developer.android.com/guide/practices/screens_support.html#range
        // 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(
        final boolean isCar = mContext.getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_AUTOMOTIVE);
        mForceDefaultOrientation = ((longSizeDp >= 960 && shortSizeDp >= 720) || isCar) &&
        // For TV, it's usually 960dp x 540dp, ignore the size limitation.
        // so if the orientation is forced, we need to respect that no matter what.
        final boolean isTv = mContext.getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_LEANBACK);
        mForceDefaultOrientation = ((longSizeDp >= 960 && shortSizeDp >= 720) || isCar || isTv) &&
                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