Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8b7ac16 authored by Jeff Brown's avatar Jeff Brown Committed by Android (Google) Code Review
Browse files

Merge "Reset input dispatcher targets when focus changes apps."

parents 4f35092a 5ea29ab7
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -998,8 +998,7 @@ void InputDispatcher::dispatchEventToCurrentInputTargetsLocked(nsecs_t currentTi
void InputDispatcher::resetTargetsLocked() {
    mCurrentInputTargetsValid = false;
    mCurrentInputTargets.clear();
    mInputTargetWaitCause = INPUT_TARGET_WAIT_CAUSE_NONE;
    mInputTargetWaitApplicationHandle.clear();
    resetANRTimeoutsLocked();
}

void InputDispatcher::commitTargetsLocked() {
@@ -1110,6 +1109,7 @@ void InputDispatcher::resetANRTimeoutsLocked() {

    // Reset input target wait timeout.
    mInputTargetWaitCause = INPUT_TARGET_WAIT_CAUSE_NONE;
    mInputTargetWaitApplicationHandle.clear();
}

int32_t InputDispatcher::findFocusedWindowTargetsLocked(nsecs_t currentTime,
@@ -3226,8 +3226,14 @@ void InputDispatcher::setFocusedApplication(
        AutoMutex _l(mLock);

        if (inputApplicationHandle != NULL && inputApplicationHandle->update()) {
            if (mFocusedApplicationHandle != inputApplicationHandle) {
                if (mFocusedApplicationHandle != NULL) {
                    resetTargetsLocked();
                }
                mFocusedApplicationHandle = inputApplicationHandle;
        } else {
            }
        } else if (mFocusedApplicationHandle != NULL) {
            resetTargetsLocked();
            mFocusedApplicationHandle.clear();
        }