Merge "Prevent to revoke input focus from recentsAnimationInputConsumer" into tm-dev am: 7e6088fa86
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18167461 Change-Id: I6f8c7f61929435fddf7c21be84c8d347f5e4649d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1921,6 +1921,7 @@ static void nativeRemoveCurrentInputFocus(JNIEnv* env, jclass clazz, jlong trans
|
|||||||
FocusRequest request;
|
FocusRequest request;
|
||||||
request.timestamp = systemTime(SYSTEM_TIME_MONOTONIC);
|
request.timestamp = systemTime(SYSTEM_TIME_MONOTONIC);
|
||||||
request.displayId = displayId;
|
request.displayId = displayId;
|
||||||
|
request.windowName = "<null>";
|
||||||
transaction->setFocusedWindow(request);
|
transaction->setFocusedWindow(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -416,8 +416,22 @@ final class InputMonitor {
|
|||||||
|
|
||||||
final IBinder focusToken = focus != null ? focus.mInputChannelToken : null;
|
final IBinder focusToken = focus != null ? focus.mInputChannelToken : null;
|
||||||
if (focusToken == null) {
|
if (focusToken == null) {
|
||||||
|
if (recentsAnimationInputConsumer != null
|
||||||
|
&& recentsAnimationInputConsumer.mWindowHandle != null
|
||||||
|
&& mInputFocus == recentsAnimationInputConsumer.mWindowHandle.token) {
|
||||||
|
// Avoid removing input focus from recentsAnimationInputConsumer.
|
||||||
|
// When the recents animation input consumer has the input focus,
|
||||||
|
// mInputFocus does not match to mDisplayContent.mCurrentFocus. Making it to be
|
||||||
|
// a special case, that do not remove the input focus from it when
|
||||||
|
// mDisplayContent.mCurrentFocus is null. This special case should be removed
|
||||||
|
// once recentAnimationInputConsumer is removed.
|
||||||
|
return;
|
||||||
|
}
|
||||||
// When an app is focused, but its window is not showing yet, remove the input focus
|
// When an app is focused, but its window is not showing yet, remove the input focus
|
||||||
// from the current window.
|
// from the current window. This enforces the input focus to match
|
||||||
|
// mDisplayContent.mCurrentFocus. However, if more special cases are discovered that
|
||||||
|
// the input focus and mDisplayContent.mCurrentFocus are expected to mismatch,
|
||||||
|
// the whole logic of how and when to revoke focus needs to be checked.
|
||||||
if (mDisplayContent.mFocusedApp != null && mInputFocus != null) {
|
if (mDisplayContent.mFocusedApp != null && mInputFocus != null) {
|
||||||
ProtoLog.v(WM_DEBUG_FOCUS_LIGHT, "App %s is focused,"
|
ProtoLog.v(WM_DEBUG_FOCUS_LIGHT, "App %s is focused,"
|
||||||
+ " but the window is not ready. Start a transaction to remove focus from"
|
+ " but the window is not ready. Start a transaction to remove focus from"
|
||||||
|
|||||||
Reference in New Issue
Block a user