From 0e4a6dfb3facd926a6424b4274bcab9b9734307c Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Thu, 27 Jul 2017 14:06:22 -0700 Subject: [PATCH] Remove rotation and app bounds from Configuration diff. The presence of these new flags leads to issues with application that do not expect their presence. Since these flags can appear at critical times, such as on orientation change, these issues are brought to the surface often. This CL remedies this problem by first removing the rotation property. It is not used and the original issue of orientation and Configuration alignment has been addressed. For app bounds, the CL reverts the behavior back to identifying diffs as a screen size change. Fixes: 64004417 Test: bit FrameworksServicesTests:com.android.server.wm.AppBoundsTests Test: go/wm-smoke Change-Id: I1fabb564dfb5c13d897336708523cf7cd5099fa0 --- .../java/android/content/pm/ActivityInfo.java | 20 ------- .../android/content/res/Configuration.java | 54 +------------------ core/java/android/view/Display.java | 11 ---- core/java/android/view/Surface.java | 8 +-- .../com/android/server/am/ActivityRecord.java | 11 ---- .../com/android/server/wm/DisplayContent.java | 1 - .../com/android/server/wm/AppBoundsTests.java | 4 +- 7 files changed, 4 insertions(+), 105 deletions(-) diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java index 16c834d18b9e3..18f9e53dc528b 100644 --- a/core/java/android/content/pm/ActivityInfo.java +++ b/core/java/android/content/pm/ActivityInfo.java @@ -763,26 +763,6 @@ public class ActivityInfo extends ComponentInfo * constant starts at the high bits. */ public static final int CONFIG_FONT_SCALE = 0x40000000; - /** - * Bit in {@link #configChanges} that indicates that the activity - * can itself handle changes to the rotation. Set from the - * {@link android.R.attr#configChanges} attribute. This is - * not a core resource configuration, but a higher-level value, so its - * constant starts at the high bits. - * @hide We do not want apps to handle this. It will eventually be moved out of - * {@link Configuration}. - */ - public static final int CONFIG_ROTATION = 0x20000000; - /** - * Bit in {@link #configChanges} that indicates that the activity - * can itself handle changes to the app bounds. Set from the - * {@link android.R.attr#configChanges} attribute. This is - * not a core resource configuration, but a higher-level value, so its - * constant starts at the high bits. - * @hide We do not want apps to handle this. It will eventually be moved out of - * {@link Configuration}. - */ - public static final int CONFIG_APP_BOUNDS = 0x10000000; /** @hide * Unfortunately the constants for config changes in native code are diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java index 7b96c6a3b5f50..af2713199950b 100644 --- a/core/java/android/content/res/Configuration.java +++ b/core/java/android/content/res/Configuration.java @@ -42,8 +42,6 @@ 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 @@ -600,13 +598,6 @@ public final class Configuration implements Parcelable, Comparable