Still save config on client side when not reporting to activity.

On the client side we have additional protection not to save new
configuration reported by activity manager if the app isn't handling
any of the configuration change that occurred. This is done because
the activity is expected to relaunch for any configuration it doesn't
handle. However, with multi-window support the activity manager doesn't
relaunch an activity if the configuration change doesn't cross a resource
threshold.
We now save the configuration on the client side when activity manager
tells us not to report the changes to the app (i.e. configuration
changed, but wasn't big enough for relaunch)

Bug: 23904868
Change-Id: I54f65cad65c1b8ed5da1165a8b2816adbea41d4b
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index f3539ff..3962abd 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -4399,10 +4399,14 @@
             // onConfigurationChanged
             int diff = activity.mCurrentConfig.diff(config);
             if (diff != 0) {
-                // If this activity doesn't handle any of the config changes
-                // then don't bother calling onConfigurationChanged as we're
-                // going to destroy it.
-                if ((~activity.mActivityInfo.getRealConfigChanged() & diff) == 0) {
+                // If this activity doesn't handle any of the config changes then don't bother
+                // calling onConfigurationChanged as we're going to destroy it.
+                // Except in the case where the configuration changed on the activity manager side,
+                // but wasn't big enough to cause a resource change so the activity wasn't destroyed.
+                // In this case we still want to change the configuration of the activity but not
+                // report it to the app.
+                if ((~activity.mActivityInfo.getRealConfigChanged() & diff) == 0
+                        || !reportToActivity) {
                     shouldChangeConfig = true;
                 }
             }