From c1f2f2a9d3136ff44b3abf773cec93aacf0ba280 Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Thu, 22 Jun 2017 15:29:42 -0700 Subject: Add rotation to configuration. Certain activities are dependent on the rotation of the device to determine layout. In these cases, orientation does not provide enough details. This CL adds the field (hidden) to the configuration. Change-Id: Idb3ba10cb4de8838737c25e92264e6cee224e264 Fixes: 32839232 Test: go/wm-smoke --- core/java/android/view/Display.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core/java/android/view/Display.java') diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java index cdb9b8229314..7346a215ed8e 100644 --- a/core/java/android/view/Display.java +++ b/core/java/android/view/Display.java @@ -725,6 +725,17 @@ public final class Display { } } + /** + * Returns the rotation associated with this display as used during layout. This is currently + * derived from the {@link Configuration}. + * + * @hide + */ + @Surface.Rotation + public int getLayoutRotation() { + return mResources.getConfiguration().getRotation(); + } + /** * @deprecated use {@link #getRotation} * @return orientation of this display. -- cgit v1.2.3