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

Commit 53e12e93 authored by Jeff Chang's avatar Jeff Chang Committed by Automerger Merge Worker
Browse files

Merge "Update context object if split bounds changed" into tm-d1-dev am:...

Merge "Update context object if split bounds changed" into tm-d1-dev am: bceb4a9e am: 7a499f6c am: dca92030

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18881887



Change-Id: I27447da4b09420eadda9c772686298719ea7d598
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 4ad06f85 dca92030
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -216,24 +216,24 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange

    /** Applies new configuration, returns {@code false} if there's no effect to the layout. */
    public boolean updateConfiguration(Configuration configuration) {
        // Always update configuration after orientation changed to make sure to render divider bar
        // with proper resources that matching screen orientation.
        final int orientation = configuration.orientation;
        if (mOrientation != orientation) {
            mContext = mContext.createConfigurationContext(configuration);
            mSplitWindowManager.setConfiguration(configuration);
            mOrientation = orientation;
        }

        // Update the split bounds when necessary. Besides root bounds changed, split bounds need to
        // be updated when the rotation changed to cover the case that users rotated the screen 180
        // degrees.
        // Make sure to render the divider bar with proper resources that matching the screen
        // orientation.
        final int rotation = configuration.windowConfiguration.getRotation();
        final Rect rootBounds = configuration.windowConfiguration.getBounds();
        if (mRotation == rotation && mRootBounds.equals(rootBounds)) {
        final int orientation = configuration.orientation;

        if (mOrientation == orientation
                && mRotation == rotation
                && mRootBounds.equals(rootBounds)) {
            return false;
        }

        mContext = mContext.createConfigurationContext(configuration);
        mSplitWindowManager.setConfiguration(configuration);
        mOrientation = orientation;
        mTempRect.set(mRootBounds);
        mRootBounds.set(rootBounds);
        mRotation = rotation;