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

Commit c11ad1d1 authored by Mariia Sandrikova's avatar Mariia Sandrikova
Browse files

Add override orientation to activity proto for CTS.

Also, make @TestApi all overrides that are needed for CTS in follow-up changes.

Bug: 263984287
Test: atest CtsWindowManagerDeviceTestCases:CompatChangeTests
Change-Id: I6b1f4da6e4ee74439ec5536cc20c924b4d11b106
parent 29017244
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -914,6 +914,12 @@ package android.content.pm {
    field public static final long FORCE_NON_RESIZE_APP = 181136395L; // 0xacbec0bL
    field public static final long FORCE_RESIZE_APP = 174042936L; // 0xa5faf38L
    field public static final long NEVER_SANDBOX_DISPLAY_APIS = 184838306L; // 0xb0468a2L
    field public static final long OVERRIDE_CAMERA_COMPAT_DISABLE_FORCE_ROTATION = 263959004L; // 0xfbbb1dcL
    field public static final long OVERRIDE_CAMERA_COMPAT_DISABLE_REFRESH = 264304459L; // 0xfc0f74bL
    field public static final long OVERRIDE_CAMERA_COMPAT_ENABLE_REFRESH_VIA_PAUSE = 264301586L; // 0xfc0ec12L
    field public static final long OVERRIDE_ENABLE_COMPAT_FAKE_FOCUS = 263259275L; // 0xfb1048bL
    field public static final long OVERRIDE_ENABLE_COMPAT_IGNORE_REQUESTED_ORIENTATION = 254631730L; // 0xf2d5f32L
    field public static final long OVERRIDE_LANDSCAPE_ORIENTATION_TO_REVERSE_LANDSCAPE = 266124927L; // 0xfdcbe7fL
    field public static final long OVERRIDE_MIN_ASPECT_RATIO = 174042980L; // 0xa5faf64L
    field public static final long OVERRIDE_MIN_ASPECT_RATIO_EXCLUDE_PORTRAIT_FULLSCREEN = 218959984L; // 0xd0d1070L
    field public static final long OVERRIDE_MIN_ASPECT_RATIO_LARGE = 180326787L; // 0xabf9183L
@@ -923,6 +929,9 @@ package android.content.pm {
    field public static final long OVERRIDE_MIN_ASPECT_RATIO_PORTRAIT_ONLY = 203647190L; // 0xc2368d6L
    field public static final long OVERRIDE_MIN_ASPECT_RATIO_TO_ALIGN_WITH_SPLIT_SCREEN = 208648326L; // 0xc6fb886L
    field public static final long OVERRIDE_SANDBOX_VIEW_BOUNDS_APIS = 237531167L; // 0xe28701fL
    field public static final long OVERRIDE_UNDEFINED_ORIENTATION_TO_NOSENSOR = 265451093L; // 0xfd27655L
    field public static final long OVERRIDE_UNDEFINED_ORIENTATION_TO_PORTRAIT = 265452344L; // 0xfd27b38L
    field public static final long OVERRIDE_USE_DISPLAY_LANDSCAPE_NATURAL_ORIENTATION = 255940284L; // 0xf4156bcL
    field public static final int RESIZE_MODE_RESIZEABLE = 2; // 0x2
  }

+9 −0
Original line number Diff line number Diff line
@@ -1083,6 +1083,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
    @ChangeId
    @Overridable
    @Disabled
    @TestApi
    public static final long OVERRIDE_ENABLE_COMPAT_IGNORE_REQUESTED_ORIENTATION =
            254631730L; // buganizer id

@@ -1142,6 +1143,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
    @ChangeId
    @Overridable
    @Disabled
    @TestApi
    public static final long OVERRIDE_CAMERA_COMPAT_DISABLE_FORCE_ROTATION =
            263959004L; // buganizer id

@@ -1154,6 +1156,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
    @ChangeId
    @Overridable
    @Disabled
    @TestApi
    public static final long OVERRIDE_CAMERA_COMPAT_DISABLE_REFRESH = 264304459L; // buganizer id

    /**
@@ -1166,6 +1169,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
    @ChangeId
    @Overridable
    @Disabled
    @TestApi
    public static final long OVERRIDE_CAMERA_COMPAT_ENABLE_REFRESH_VIA_PAUSE =
            264301586L; // buganizer id

@@ -1292,6 +1296,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
    @ChangeId
    @Disabled
    @Overridable
    @TestApi
    public static final long OVERRIDE_ENABLE_COMPAT_FAKE_FOCUS = 263259275L;

    // Compat framework that per-app overrides rely on only supports booleans. That's why we have
@@ -1307,6 +1312,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
    @ChangeId
    @Disabled
    @Overridable
    @TestApi
    public static final long OVERRIDE_UNDEFINED_ORIENTATION_TO_PORTRAIT = 265452344L;

    /**
@@ -1318,6 +1324,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
    @ChangeId
    @Disabled
    @Overridable
    @TestApi
    public static final long OVERRIDE_UNDEFINED_ORIENTATION_TO_NOSENSOR = 265451093L;

    /**
@@ -1331,6 +1338,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
    @ChangeId
    @Disabled
    @Overridable
    @TestApi
    public static final long OVERRIDE_LANDSCAPE_ORIENTATION_TO_REVERSE_LANDSCAPE = 266124927L;

    /**
@@ -1377,6 +1385,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
    @ChangeId
    @Disabled
    @Overridable
    @TestApi
    public static final long OVERRIDE_USE_DISPLAY_LANDSCAPE_NATURAL_ORIENTATION = 255940284L;

    /**
+1 −0
Original line number Diff line number Diff line
@@ -389,6 +389,7 @@ message ActivityRecordProto {
    optional bool provides_max_bounds = 34;
    optional bool enable_recents_screenshot = 35;
    optional int32 last_drop_input_mode = 36;
    optional int32 override_orientation = 37 [(.android.typedef) = "android.content.pm.ActivityInfo.ScreenOrientation"];
}

/* represents WindowToken */
+2 −0
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@ import static com.android.server.wm.ActivityRecordProto.MIN_ASPECT_RATIO;
import static com.android.server.wm.ActivityRecordProto.NAME;
import static com.android.server.wm.ActivityRecordProto.NUM_DRAWN_WINDOWS;
import static com.android.server.wm.ActivityRecordProto.NUM_INTERESTING_WINDOWS;
import static com.android.server.wm.ActivityRecordProto.OVERRIDE_ORIENTATION;
import static com.android.server.wm.ActivityRecordProto.PIP_AUTO_ENTER_ENABLED;
import static com.android.server.wm.ActivityRecordProto.PROC_ID;
import static com.android.server.wm.ActivityRecordProto.PROVIDES_MAX_BOUNDS;
@@ -10212,6 +10213,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        proto.write(PROVIDES_MAX_BOUNDS, providesMaxBounds());
        proto.write(ENABLE_RECENTS_SCREENSHOT, mEnableRecentsScreenshot);
        proto.write(LAST_DROP_INPUT_MODE, mLastDropInputMode);
        proto.write(OVERRIDE_ORIENTATION, getOverrideOrientation());
    }

    @Override