diff options
| author | Vishnu Nair <vishnun@google.com> | 2021-11-11 00:56:48 +0000 |
|---|---|---|
| committer | Vishnu Nair <vishnun@google.com> | 2021-11-11 03:14:21 +0000 |
| commit | cbb12e2e76643cbfc293b961d94e69e5a232fcd3 (patch) | |
| tree | 44cc08c3b0f75200e48b196c3395c0e0f6c69ed2 /core/java/android | |
| parent | 1cfd0c754664631ed2371e7d98d4b98b19d7363e (diff) | |
WM: Handle primary display orientation when calculating the transform hint
Query the surface flinger property
ro.surface_flinger.primary_display_orientation to determine the
primary display's install orientation. If the window is on the
primary display, then update the transform hint passed on to the
client.
Bug: 196167822
Test: check initial buffer transforms on displays with a different
install orientation
Change-Id: Idf010cd6be73172ba708820f87046c3ba3cf8001
Merged-In: Idf010cd6be73172ba708820f87046c3ba3cf8001
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/SurfaceControl.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index 8143cf953f19..ffce4617eec6 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -157,6 +157,7 @@ public final class SurfaceControl implements Parcelable { private static native boolean nativeGetAnimationFrameStats(WindowAnimationFrameStats outStats); private static native long[] nativeGetPhysicalDisplayIds(); + private static native long nativeGetPrimaryPhysicalDisplayId(); private static native IBinder nativeGetPhysicalDisplayToken(long physicalDisplayId); private static native IBinder nativeCreateDisplay(String name, boolean secure); private static native void nativeDestroyDisplay(IBinder displayToken); @@ -2266,6 +2267,15 @@ public final class SurfaceControl implements Parcelable { } /** + * Exposed to identify the correct display to apply the primary display orientation. Avoid using + * for any other purpose. + * @hide + */ + public static long getPrimaryPhysicalDisplayId() { + return nativeGetPrimaryPhysicalDisplayId(); + } + + /** * @hide */ public static IBinder getPhysicalDisplayToken(long physicalDisplayId) { |
