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

Commit 57a62b3e authored by Chavi Weingarten's avatar Chavi Weingarten
Browse files

Address ASurfaceControlInputReceiver comments

Test: ASurfaceControlInputReceiverTest
Bug: 329903619
Change-Id: I9051c506ce217bdc6ea941794de06f9e3e026a66
parent ace5c353
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();
    }