From 600daddb679e356f5767a9e898751cc4c1cba3b4 Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Tue, 25 Jul 2017 10:48:42 -0700 Subject: Do not report app bound differences as a Configuration change. App bounds are an internal Configuration field and should not influence the diff that determines whether the Configuration has changed. This changelist ensures this by introducing a new flag that is identified server side and filtered before informing the client that the configuration has changed. Change-Id: Ibf1387f73eaa9b39e6213e1a1109c4cd57554e7c Fixes: 63927944 Test: bit FrameworksServicesTests:com.android.server.wm.AppBoundsTests#testAppBoundsConfigurationDiff Test: go/wm-smoke --- core/java/android/content/pm/ActivityInfo.java | 12 ++++++++++-- core/java/android/content/res/Configuration.java | 2 +- .../core/java/com/android/server/am/ActivityRecord.java | 7 +++++++ .../src/com/android/server/wm/AppBoundsTests.java | 14 ++++++++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java index f098f2a7c143..16c834d18b9e 100644 --- a/core/java/android/content/pm/ActivityInfo.java +++ b/core/java/android/content/pm/ActivityInfo.java @@ -28,8 +28,6 @@ import android.util.Printer; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import static android.view.WindowManager.LayoutParams.ROTATION_ANIMATION_ROTATE; - /** * Information you can retrieve about a particular application * activity or receiver. This corresponds to information collected @@ -775,6 +773,16 @@ public class ActivityInfo extends ComponentInfo * {@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 68d4cd8c5f7d..7b96c6a3b5f5 100644 --- a/core/java/android/content/res/Configuration.java +++ b/core/java/android/content/res/Configuration.java @@ -1445,7 +1445,7 @@ public final class Configuration implements Parcelable, Comparable