From 248fbb180db7cc1f57ab3a8d0387e1c18caf668d Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Mon, 10 Jul 2017 16:26:50 -0700 Subject: [PATCH] Do not use rotation as indicator to relaunch from config change. Rotation is a hidden member inside configuration that should not influence configuration related logic. This CL ensures that we do not consider changes to the rotation as grounds for relaunching an activity. Change-Id: I9e6d4a1a75fd3ee3beb63f307433e9c3fcfd6dd4 Fixes: 63533208 Test: go/wm-smoke Test:cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerConfigChangeTests --- core/java/android/content/pm/ActivityInfo.java | 10 ++++++++++ core/java/android/content/res/Configuration.java | 2 +- .../java/com/android/server/am/ActivityRecord.java | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java index 9a014766c2067..f098f2a7c1430 100644 --- a/core/java/android/content/pm/ActivityInfo.java +++ b/core/java/android/content/pm/ActivityInfo.java @@ -765,6 +765,16 @@ 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; /** @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 ef279b86662a0..68d4cd8c5f7de 100644 --- a/core/java/android/content/res/Configuration.java +++ b/core/java/android/content/res/Configuration.java @@ -1395,7 +1395,7 @@ public final class Configuration implements Parcelable, Comparable