Merge "Update split context when display size changed" into tm-qpr-dev am: 14bc57382c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20119741 Change-Id: Id80fab27066f9d63ae77409dd2a36675af81ba07 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -118,6 +118,7 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
|
|||||||
private boolean mFreezeDividerWindow = false;
|
private boolean mFreezeDividerWindow = false;
|
||||||
private int mOrientation;
|
private int mOrientation;
|
||||||
private int mRotation;
|
private int mRotation;
|
||||||
|
private int mDensity;
|
||||||
|
|
||||||
private final boolean mDimNonImeSide;
|
private final boolean mDimNonImeSide;
|
||||||
|
|
||||||
@@ -290,9 +291,11 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
|
|||||||
final int rotation = configuration.windowConfiguration.getRotation();
|
final int rotation = configuration.windowConfiguration.getRotation();
|
||||||
final Rect rootBounds = configuration.windowConfiguration.getBounds();
|
final Rect rootBounds = configuration.windowConfiguration.getBounds();
|
||||||
final int orientation = configuration.orientation;
|
final int orientation = configuration.orientation;
|
||||||
|
final int density = configuration.densityDpi;
|
||||||
|
|
||||||
if (mOrientation == orientation
|
if (mOrientation == orientation
|
||||||
&& mRotation == rotation
|
&& mRotation == rotation
|
||||||
|
&& mDensity == density
|
||||||
&& mRootBounds.equals(rootBounds)) {
|
&& mRootBounds.equals(rootBounds)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -303,6 +306,7 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
|
|||||||
mTempRect.set(mRootBounds);
|
mTempRect.set(mRootBounds);
|
||||||
mRootBounds.set(rootBounds);
|
mRootBounds.set(rootBounds);
|
||||||
mRotation = rotation;
|
mRotation = rotation;
|
||||||
|
mDensity = density;
|
||||||
mDividerSnapAlgorithm = getSnapAlgorithm(mContext, mRootBounds, null);
|
mDividerSnapAlgorithm = getSnapAlgorithm(mContext, mRootBounds, null);
|
||||||
initDividerPosition(mTempRect);
|
initDividerPosition(mTempRect);
|
||||||
updateInvisibleRect();
|
updateInvisibleRect();
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.wm.shell.common.split;
|
package com.android.wm.shell.common.split;
|
||||||
|
|
||||||
|
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
|
||||||
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
|
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
@@ -91,6 +92,14 @@ public class SplitLayoutTests extends ShellTestCase {
|
|||||||
// Verify updateConfiguration returns true if the root bounds changed.
|
// Verify updateConfiguration returns true if the root bounds changed.
|
||||||
config.windowConfiguration.setBounds(new Rect(0, 0, 2160, 1080));
|
config.windowConfiguration.setBounds(new Rect(0, 0, 2160, 1080));
|
||||||
assertThat(mSplitLayout.updateConfiguration(config)).isTrue();
|
assertThat(mSplitLayout.updateConfiguration(config)).isTrue();
|
||||||
|
|
||||||
|
// Verify updateConfiguration returns true if the orientation changed.
|
||||||
|
config.orientation = ORIENTATION_LANDSCAPE;
|
||||||
|
assertThat(mSplitLayout.updateConfiguration(config)).isTrue();
|
||||||
|
|
||||||
|
// Verify updateConfiguration returns true if the density changed.
|
||||||
|
config.densityDpi = 123;
|
||||||
|
assertThat(mSplitLayout.updateConfiguration(config)).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user