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

Commit b305e160 authored by Wale Ogunwale's avatar Wale Ogunwale Committed by Android (Google) Code Review
Browse files

Merge "Force resize pre-N apps that don't have fixed orientation." into nyc-dev

parents bc56ca34 508ff55e
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -789,6 +789,22 @@ public class ActivityInfo extends ComponentInfo
        }
    }

    /**
     * Returns true if the activity's orientation is fixed.
     * @hide
     */
    boolean isFixedOrientation() {
        return screenOrientation == SCREEN_ORIENTATION_LANDSCAPE
                || screenOrientation == SCREEN_ORIENTATION_PORTRAIT
                || screenOrientation == SCREEN_ORIENTATION_SENSOR_LANDSCAPE
                || screenOrientation == SCREEN_ORIENTATION_SENSOR_PORTRAIT
                || screenOrientation == SCREEN_ORIENTATION_REVERSE_LANDSCAPE
                || screenOrientation == SCREEN_ORIENTATION_REVERSE_PORTRAIT
                || screenOrientation == SCREEN_ORIENTATION_USER_LANDSCAPE
                || screenOrientation == SCREEN_ORIENTATION_USER_PORTRAIT
                || screenOrientation == SCREEN_ORIENTATION_LOCKED;
    }

    /** @hide */
    public static boolean isResizeableMode(int mode) {
        return mode == RESIZE_MODE_RESIZEABLE
+1 −2
Original line number Diff line number Diff line
@@ -3449,8 +3449,7 @@ public class PackageParser {
                }
            } else if (owner.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.N) {
                a.info.resizeMode = RESIZE_MODE_UNRESIZEABLE;
            } else if (a.info.screenOrientation == SCREEN_ORIENTATION_UNSPECIFIED
                    && (a.info.flags & FLAG_IMMERSIVE) == 0) {
            } else if (!a.info.isFixedOrientation() && (a.info.flags & FLAG_IMMERSIVE) == 0) {
                a.info.resizeMode = RESIZE_MODE_FORCE_RESIZEABLE;
            }