Merge "Account for the focused window before requesting input consumer focus" into sc-dev am: a0a4985d3e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15014045 Change-Id: I87c20dcbb5701c15236a4b49d46f7339699c8ac0
This commit is contained in:
@@ -394,10 +394,23 @@ final class InputMonitor {
|
|||||||
/**
|
/**
|
||||||
* Called when the current input focus changes.
|
* Called when the current input focus changes.
|
||||||
*/
|
*/
|
||||||
private void updateInputFocusRequest() {
|
private void updateInputFocusRequest(InputConsumerImpl recentsAnimationInputConsumer) {
|
||||||
final WindowState focus = mDisplayContent.mCurrentFocus;
|
final WindowState focus = mDisplayContent.mCurrentFocus;
|
||||||
final IBinder focusToken = focus != null ? focus.mInputChannelToken : null;
|
// Request focus for the recents animation input consumer if an input consumer should
|
||||||
|
// be applied for the window.
|
||||||
|
if (recentsAnimationInputConsumer != null && focus != null) {
|
||||||
|
final RecentsAnimationController recentsAnimationController =
|
||||||
|
mService.getRecentsAnimationController();
|
||||||
|
final boolean shouldApplyRecentsInputConsumer = recentsAnimationController != null
|
||||||
|
&& recentsAnimationController.shouldApplyInputConsumer(focus.mActivityRecord);
|
||||||
|
if (shouldApplyRecentsInputConsumer) {
|
||||||
|
requestFocus(recentsAnimationInputConsumer.mWindowHandle.token,
|
||||||
|
recentsAnimationInputConsumer.mName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final IBinder focusToken = focus != null ? focus.mInputChannelToken : null;
|
||||||
if (focusToken == null) {
|
if (focusToken == null) {
|
||||||
mInputFocus = null;
|
mInputFocus = null;
|
||||||
return;
|
return;
|
||||||
@@ -474,8 +487,6 @@ final class InputMonitor {
|
|||||||
|
|
||||||
boolean mInDrag;
|
boolean mInDrag;
|
||||||
|
|
||||||
private boolean mRecentsAnimationFocusOverride;
|
|
||||||
|
|
||||||
private void updateInputWindows(boolean inDrag) {
|
private void updateInputWindows(boolean inDrag) {
|
||||||
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "updateInputWindows");
|
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "updateInputWindows");
|
||||||
|
|
||||||
@@ -491,16 +502,8 @@ final class InputMonitor {
|
|||||||
mInDrag = inDrag;
|
mInDrag = inDrag;
|
||||||
|
|
||||||
resetInputConsumers(mInputTransaction);
|
resetInputConsumers(mInputTransaction);
|
||||||
mRecentsAnimationFocusOverride = false;
|
|
||||||
mDisplayContent.forAllWindows(this, true /* traverseTopToBottom */);
|
mDisplayContent.forAllWindows(this, true /* traverseTopToBottom */);
|
||||||
|
updateInputFocusRequest(mRecentsAnimationInputConsumer);
|
||||||
if (mRecentsAnimationFocusOverride) {
|
|
||||||
requestFocus(mRecentsAnimationInputConsumer.mWindowHandle.token,
|
|
||||||
mRecentsAnimationInputConsumer.mName);
|
|
||||||
} else {
|
|
||||||
updateInputFocusRequest();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!mUpdateInputWindowsImmediately) {
|
if (!mUpdateInputWindowsImmediately) {
|
||||||
mDisplayContent.getPendingTransaction().merge(mInputTransaction);
|
mDisplayContent.getPendingTransaction().merge(mInputTransaction);
|
||||||
@@ -538,7 +541,6 @@ final class InputMonitor {
|
|||||||
mRecentsAnimationInputConsumer.mWindowHandle)) {
|
mRecentsAnimationInputConsumer.mWindowHandle)) {
|
||||||
mRecentsAnimationInputConsumer.show(mInputTransaction, w.mActivityRecord);
|
mRecentsAnimationInputConsumer.show(mInputTransaction, w.mActivityRecord);
|
||||||
mAddRecentsAnimationInputConsumerHandle = false;
|
mAddRecentsAnimationInputConsumerHandle = false;
|
||||||
mRecentsAnimationFocusOverride = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user