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

Commit 55ddf8f9 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Added support for maxAspectRatio manifest attribute.

- Allows an app to specify the maximum aspect ratio it supports.
- Support for overriding configuration and bounds at the activity
record and app window token level.

Test: cts/.../run-test CtsAppTestCases android.app.cts.AspectRatioTests
Test: bit FrameworksServicesTests:com.android.server.wm.WindowContainerTests
Test: bit FrameworksServicesTests:com.android.server.wm.WindowFrameTests
Bug: 36505427
Bug: 33205955
Bug: 35810513
Change-Id: Ib2d46ed0c546dd903d09d6bb7162a98bd390ba81
parent 837dde71
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -879,6 +879,7 @@ package android {
    field public static final int marqueeRepeatLimit = 16843293; // 0x101021d
    field public static final int matchOrder = 16843855; // 0x101044f
    field public static final int max = 16843062; // 0x1010136
    field public static final int maxAspectRatio = 16844131; // 0x1010563
    field public static final int maxButtonHeight = 16844029; // 0x10104fd
    field public static final int maxDate = 16843584; // 0x1010340
    field public static final int maxEms = 16843095; // 0x1010157
+1 −0
Original line number Diff line number Diff line
@@ -992,6 +992,7 @@ package android {
    field public static final int marqueeRepeatLimit = 16843293; // 0x101021d
    field public static final int matchOrder = 16843855; // 0x101044f
    field public static final int max = 16843062; // 0x1010136
    field public static final int maxAspectRatio = 16844131; // 0x1010563
    field public static final int maxButtonHeight = 16844029; // 0x10104fd
    field public static final int maxDate = 16843584; // 0x1010340
    field public static final int maxEms = 16843095; // 0x1010157
+1 −0
Original line number Diff line number Diff line
@@ -879,6 +879,7 @@ package android {
    field public static final int marqueeRepeatLimit = 16843293; // 0x101021d
    field public static final int matchOrder = 16843855; // 0x101044f
    field public static final int max = 16843062; // 0x1010136
    field public static final int maxAspectRatio = 16844131; // 0x1010563
    field public static final int maxButtonHeight = 16844029; // 0x10104fd
    field public static final int maxDate = 16843584; // 0x1010340
    field public static final int maxEms = 16843095; // 0x1010157
+15 −0
Original line number Diff line number Diff line
@@ -222,6 +222,15 @@ public class ActivityInfo extends ComponentInfo
     */
    public int resizeMode = RESIZE_MODE_RESIZEABLE;

    /**
     * Value indicating the maximum aspect ratio the activity supports.
     * <p>
     * 0 means unset.
     * @See {@link android.R.attr#maxAspectRatio}.
     * @hide
     */
    public float maxAspectRatio;

    /**
     * Name of the VrListenerService component to run for this activity.
     * @see android.R.attr#enableVrMode
@@ -922,6 +931,7 @@ public class ActivityInfo extends ComponentInfo
        requestedVrComponent = orig.requestedVrComponent;
        rotationAnimation = orig.rotationAnimation;
        colorMode = orig.colorMode;
        maxAspectRatio = orig.maxAspectRatio;
    }

    /**
@@ -1064,6 +1074,9 @@ public class ActivityInfo extends ComponentInfo
        if (requestedVrComponent != null) {
            pw.println(prefix + "requestedVrComponent=" + requestedVrComponent);
        }
        if (maxAspectRatio != 0) {
            pw.println(prefix + "maxAspectRatio=" + maxAspectRatio);
        }
        super.dumpBack(pw, prefix, flags);
    }

@@ -1110,6 +1123,7 @@ public class ActivityInfo extends ComponentInfo
        dest.writeString(requestedVrComponent);
        dest.writeInt(rotationAnimation);
        dest.writeInt(colorMode);
        dest.writeFloat(maxAspectRatio);
    }

    public static final Parcelable.Creator<ActivityInfo> CREATOR
@@ -1146,6 +1160,7 @@ public class ActivityInfo extends ComponentInfo
        requestedVrComponent = source.readString();
        rotationAnimation = source.readInt();
        colorMode = source.readInt();
        maxAspectRatio = source.readFloat();
    }

    /**
+9 −0
Original line number Diff line number Diff line
@@ -602,6 +602,15 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
     */
    public int largestWidthLimitDp = 0;

    /**
     * Value indicating the maximum aspect ratio the application supports.
     * <p>
     * 0 means unset.
     * @See {@link android.R.attr#maxAspectRatio}.
     * @hide
     */
    public float maxAspectRatio;

    /**
     * UUID of the storage volume on which this application is being hosted. For
     * apps hosted on the default internal storage at
Loading