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

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

Merge "Address ASurfaceControlInputReceiver comments" into main

parents ad87df88 57a62b3e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ per-file android_view_VelocityTracker.* = file:/services/core/java/com/android/s
# WindowManager
per-file android_graphics_BLASTBufferQueue.cpp = file:/services/core/java/com/android/server/wm/OWNERS
per-file android_view_Surface* = file:/services/core/java/com/android/server/wm/OWNERS
per-file android_view_WindowManagerGlobal.cpp = file:/services/core/java/com/android/server/wm/OWNERS
per-file android_window_* = file:/services/core/java/com/android/server/wm/OWNERS

# Resources
+4 −4
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ std::shared_ptr<InputChannel> createInputChannel(
            surfaceControlObj(env,
                              android_view_SurfaceControl_getJavaSurfaceControl(env,
                                                                                surfaceControl));
    jobject clientTokenObj = javaObjectForIBinder(env, clientToken);
    ScopedLocalRef<jobject> clientTokenObj(env, javaObjectForIBinder(env, clientToken));
    ScopedLocalRef<jobject> clientInputTransferTokenObj(
            env,
            android_window_InputTransferToken_getJavaInputTransferToken(env,
@@ -57,7 +57,7 @@ std::shared_ptr<InputChannel> createInputChannel(
            inputChannelObj(env,
                            env->CallStaticObjectMethod(gWindowManagerGlobal.clazz,
                                                        gWindowManagerGlobal.createInputChannel,
                                                        clientTokenObj,
                                                        clientTokenObj.get(),
                                                        hostInputTransferTokenObj.get(),
                                                        surfaceControlObj.get(),
                                                        clientInputTransferTokenObj.get()));
@@ -68,9 +68,9 @@ std::shared_ptr<InputChannel> createInputChannel(
void removeInputChannel(const sp<IBinder>& clientToken) {
    JNIEnv* env = AndroidRuntime::getJNIEnv();

    jobject clientTokenObj(javaObjectForIBinder(env, clientToken));
    ScopedLocalRef<jobject> clientTokenObj(env, javaObjectForIBinder(env, clientToken));
    env->CallStaticObjectMethod(gWindowManagerGlobal.clazz, gWindowManagerGlobal.removeInputChannel,
                                clientTokenObj);
                                clientTokenObj.get());
}

int register_android_view_WindowManagerGlobal(JNIEnv* env) {
+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@ public:
            mClientToken(clientToken),
            mInputTransferToken(inputTransferToken) {}

    // The InputConsumer does not keep the InputReceiver alive so the receiver is cleared once the
    // owner releases it.
    ~InputReceiver() {
        remove();
    }