Add a config to control split-screen task dimming
In split-screen when a task is the IME target, the other one is dimmed.
Add a config to enable/disable this functionality.
Test: Manual
Bug: 229090560
Change-Id: Id0935f1badec4620a97b8ea9826d32b94c186b98
Merged-In: If41d89744acd6dcba27085755b6cd3947ee3ad62
diff --git a/libs/WindowManager/Shell/res/values/config.xml b/libs/WindowManager/Shell/res/values/config.xml
index 1b8032b..13474d7 100644
--- a/libs/WindowManager/Shell/res/values/config.xml
+++ b/libs/WindowManager/Shell/res/values/config.xml
@@ -70,4 +70,7 @@
<!-- Animation duration when exit starting window: reveal app -->
<integer name="starting_window_app_reveal_anim_duration">266</integer>
+
+ <!-- Whether to dim a split-screen task when the other is the IME target -->
+ <bool name="config_dimNonImeAttachedSide">true</bool>
</resources>
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
index ba343cb..cbd4ffd 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
@@ -101,6 +101,8 @@
private int mOrientation;
private int mRotation;
+ private final boolean mDimNonImeSide;
+
public SplitLayout(String windowName, Context context, Configuration configuration,
SplitLayoutHandler splitLayoutHandler,
SplitWindowManager.ParentContainerCallbacks parentContainerCallbacks,
@@ -125,6 +127,8 @@
mRootBounds.set(configuration.windowConfiguration.getBounds());
mDividerSnapAlgorithm = getSnapAlgorithm(mContext, mRootBounds);
resetDividerPosition();
+
+ mDimNonImeSide = resources.getBoolean(R.bool.config_dimNonImeAttachedSide);
}
private int getDividerInsets(Resources resources, Display display) {
@@ -719,10 +723,10 @@
// Update target dim values
mLastDim1 = mDimValue1;
mTargetDim1 = imeTargetPosition == SPLIT_POSITION_BOTTOM_OR_RIGHT && showing
- ? ADJUSTED_NONFOCUS_DIM : 0.0f;
+ && mDimNonImeSide ? ADJUSTED_NONFOCUS_DIM : 0.0f;
mLastDim2 = mDimValue2;
mTargetDim2 = imeTargetPosition == SPLIT_POSITION_TOP_OR_LEFT && showing
- ? ADJUSTED_NONFOCUS_DIM : 0.0f;
+ && mDimNonImeSide ? ADJUSTED_NONFOCUS_DIM : 0.0f;
// Calculate target bounds offset for IME
mLastYOffset = mYOffsetForIme;