From c1f2f2a9d3136ff44b3abf773cec93aacf0ba280 Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Thu, 22 Jun 2017 15:29:42 -0700 Subject: [PATCH] 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 --- .../android/content/res/Configuration.java | 54 +++++++++++++++++++ core/java/android/view/Display.java | 11 ++++ core/java/android/view/Surface.java | 8 ++- .../com/android/server/wm/DisplayContent.java | 2 + 4 files changed, 74 insertions(+), 1 deletion(-) diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java index 6834ba816910f..be31d1b0b5e54 100644 --- a/core/java/android/content/res/Configuration.java +++ b/core/java/android/content/res/Configuration.java @@ -42,6 +42,9 @@ import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.Locale; +import static android.view.Surface.ROTATION_0; +import static android.view.Surface.ROTATION_UNDEFINED; + /** * This class describes all device configuration information that can * impact the resources the application retrieves. This includes both @@ -597,6 +600,13 @@ public final class Configuration implements Parcelable, Comparable