Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f5678d8 authored by Tiger's avatar Tiger
Browse files

Use mMergedConfig instead of mGlobalConfig while getting winConfigFromWm

Multiple activities in the same process might share the same global
config. In such cases, the global config might NOT describe the bounds
of a window which receives the config. This CL assigns
windowConfiguration from mMergedConfig to winConfigFromWm.

Fix: 360905410
Fix: 298433614
Flag: EXEMPT bugfix
Test: 1. Open 2 instances of Chrome in split-screen mode by selecting
         "New window" from it menu on a large screen device.
      2. Make sure the bounds of winConfigFromWm match the real bounds
         of each instance of Chrome respectively.
Change-Id: Ic444bd400929531f4b8a9d8966bda8ca9f170057
parent 29809687
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -6516,7 +6516,7 @@ public final class ViewRootImpl implements ViewParent,
        }
        Configuration globalConfig = mergedConfiguration.getGlobalConfiguration();
        final Configuration overrideConfig = mergedConfiguration.getOverrideConfiguration();
        Configuration overrideConfig = mergedConfiguration.getOverrideConfiguration();
        if (DEBUG_CONFIGURATION) Log.v(mTag,
                "Applying new config to window " + mWindowAttributes.getTitle()
                        + ", globalConfig: " + globalConfig
@@ -6525,7 +6525,9 @@ public final class ViewRootImpl implements ViewParent,
        final CompatibilityInfo ci = mDisplay.getDisplayAdjustments().getCompatibilityInfo();
        if (!ci.equals(CompatibilityInfo.DEFAULT_COMPATIBILITY_INFO)) {
            globalConfig = new Configuration(globalConfig);
            overrideConfig = new Configuration(overrideConfig);
            ci.applyToConfiguration(mNoncompatDensity, globalConfig);
            ci.applyToConfiguration(mNoncompatDensity, overrideConfig);
        }
        synchronized (sConfigCallbacks) {
@@ -9290,7 +9292,7 @@ public final class ViewRootImpl implements ViewParent,
            boolean insetsPending) throws RemoteException {
        final WindowConfiguration winConfigFromAm = getConfiguration().windowConfiguration;
        final WindowConfiguration winConfigFromWm =
                mLastReportedMergedConfiguration.getGlobalConfiguration().windowConfiguration;
                mLastReportedMergedConfiguration.getMergedConfiguration().windowConfiguration;
        final WindowConfiguration winConfig = getCompatWindowConfiguration();
        final int measuredWidth = mMeasuredWidth;
        final int measuredHeight = mMeasuredHeight;