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

Commit 59f3a3d8 authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Android (Google) Code Review
Browse files

Merge "Change Instrumentation to call injectInputAfterTransactionApplied"

parents 29dfd621 9f4bc55f
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
import android.view.Window;
import android.view.WindowManagerGlobal;

import com.android.internal.content.ReferrerIntent;

@@ -1102,8 +1103,11 @@ public class Instrumentation {
        if ((event.getSource() & InputDevice.SOURCE_CLASS_POINTER) == 0) {
            event.setSource(InputDevice.SOURCE_TOUCHSCREEN);
        }
        InputManager.getInstance().injectInputEvent(event,
        try {
            WindowManagerGlobal.getWindowManagerService().injectInputAfterTransactionsApplied(event,
                    InputManager.INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH);
        } catch (RemoteException e) {
        }
    }

    /**
+2 −1
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ import android.hardware.configstore.V1_0.OptionalBool;
import android.hardware.display.DisplayManager;
import android.hardware.display.DisplayManagerInternal;
import android.hardware.input.InputManager;
import android.hardware.input.InputManagerInternal;
import android.net.Uri;
import android.os.Binder;
import android.os.Build;
@@ -7438,7 +7439,7 @@ public class WindowManagerService extends IWindowManager.Stub

        new SurfaceControl.Transaction().syncInputWindows().apply(true);

        return mInputManager.injectInputEvent(ev, mode);
        return LocalServices.getService(InputManagerInternal.class).injectInputEvent(ev, mode);
    }

    private void waitForAnimationsToComplete() {