Fix regression with defaultDisplay adjustments

ag/1542219 introduced a regression where if the display was the default
display, the configuration would still be adjusted as if it were
a non-default display. This fixes that logic to only adjust the
configuration if the display is non-default.

Test: cts-tradefed run cts --module CtsServicesHostTestCases --test android.server.cts.ActivityManagerAppConfigurationTests#testConfigurationUpdatesWhenRotatingToSideFromDocked
Change-Id: Ib2fda8c1651609efa9d20b3e2dace8a122864916
diff --git a/core/java/android/app/ b/core/java/android/app/
index 8adec03..5cc064e 100644
--- a/core/java/android/app/
+++ b/core/java/android/app/
@@ -850,7 +850,10 @@
                         dm = getDisplayMetrics(displayId, daj);
-                        applyNonDefaultDisplayMetricsToConfiguration(dm, tmpConfig);
+                        if (!isDefaultDisplay) {
+                            applyNonDefaultDisplayMetricsToConfiguration(dm, tmpConfig);
+                        }
                         if (hasOverrideConfiguration) {