Merge "Put recents input consumer to the top of the display area" into sc-v2-dev am: ac8017a915

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

Change-Id: Iab48bd068fe87c79ffa46b628e7b9587b072ee66
This commit is contained in:
Winson Chung
2021-10-01 00:09:43 +00:00
committed by Automerger Merge Worker
2 changed files with 12 additions and 19 deletions

View File

@@ -48,6 +48,8 @@ import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_INPUT;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.LOGTAG_INPUT_FOCUS; import static com.android.server.wm.WindowManagerService.LOGTAG_INPUT_FOCUS;
import static java.lang.Integer.MAX_VALUE;
import android.annotation.Nullable; import android.annotation.Nullable;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.Region; import android.graphics.Region;
@@ -581,10 +583,11 @@ final class InputMonitor {
if (mAddRecentsAnimationInputConsumerHandle && shouldApplyRecentsInputConsumer) { if (mAddRecentsAnimationInputConsumerHandle && shouldApplyRecentsInputConsumer) {
if (recentsAnimationController.updateInputConsumerForApp( if (recentsAnimationController.updateInputConsumerForApp(
mRecentsAnimationInputConsumer.mWindowHandle)) { mRecentsAnimationInputConsumer.mWindowHandle)) {
final WindowState highestLayerWindow = final DisplayArea targetDA =
recentsAnimationController.getHighestLayerWindow(); recentsAnimationController.getTargetAppDisplayArea();
if (highestLayerWindow != null) { if (targetDA != null) {
mRecentsAnimationInputConsumer.show(mInputTransaction, highestLayerWindow); mRecentsAnimationInputConsumer.reparent(mInputTransaction, targetDA);
mRecentsAnimationInputConsumer.show(mInputTransaction, MAX_VALUE - 1);
mAddRecentsAnimationInputConsumerHandle = false; mAddRecentsAnimationInputConsumerHandle = false;
} }
} }
@@ -597,7 +600,7 @@ final class InputMonitor {
rootTask.getSurfaceControl()); rootTask.getSurfaceControl());
// We set the layer to z=MAX-1 so that it's always on top. // We set the layer to z=MAX-1 so that it's always on top.
mPipInputConsumer.reparent(mInputTransaction, rootTask); mPipInputConsumer.reparent(mInputTransaction, rootTask);
mPipInputConsumer.show(mInputTransaction, Integer.MAX_VALUE - 1); mPipInputConsumer.show(mInputTransaction, MAX_VALUE - 1);
mAddPipInputConsumerHandle = false; mAddPipInputConsumerHandle = false;
} }
} }

View File

@@ -1125,21 +1125,11 @@ public class RecentsAnimationController implements DeathRecipient {
return mTargetActivityRecord.findMainWindow(); return mTargetActivityRecord.findMainWindow();
} }
/** DisplayArea getTargetAppDisplayArea() {
* Returns the window with the highest layer, or null if none is found. if (mTargetActivityRecord == null) {
*/ return null;
public WindowState getHighestLayerWindow() {
int highestLayer = Integer.MIN_VALUE;
Task highestLayerTask = null;
for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
TaskAnimationAdapter adapter = mPendingAnimations.get(i);
int layer = adapter.mTask.getPrefixOrderIndex();
if (layer > highestLayer) {
highestLayer = layer;
highestLayerTask = adapter.mTask;
}
} }
return highestLayerTask.getTopMostActivity().getTopChild(); return mTargetActivityRecord.getDisplayArea();
} }
boolean isAnimatingTask(Task task) { boolean isAnimatingTask(Task task) {