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

Commit 60c43670 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove InputChannel::setToken"

parents 4e8e5bdd 6742983a
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -61,7 +61,6 @@ public final class InputChannel implements Parcelable {
    private native void nativeWriteToParcel(Parcel parcel);
    private native void nativeDup(InputChannel target);
    private native IBinder nativeGetToken();
    private native void nativeSetToken(IBinder token);

    private native String nativeGetName();

@@ -185,8 +184,4 @@ public final class InputChannel implements Parcelable {
    public IBinder getToken() {
        return nativeGetToken();
    }

    public void setToken(IBinder token) {
        nativeSetToken(token);
    }
}
+2 −12
Original line number Diff line number Diff line
@@ -276,20 +276,12 @@ static jobject android_view_InputChannel_nativeGetToken(JNIEnv* env, jobject obj
    NativeInputChannel* nativeInputChannel =
        android_view_InputChannel_getNativeInputChannel(env, obj);
    if (nativeInputChannel) {
        return javaObjectForIBinder(env, nativeInputChannel->getInputChannel()->getToken());
        return javaObjectForIBinder(env,
                nativeInputChannel->getInputChannel()->getConnectionToken());
    }
    return 0;
}

static void android_view_InputChannel_nativeSetToken(JNIEnv* env, jobject obj, jobject tokenObj) {
    NativeInputChannel* nativeInputChannel =
        android_view_InputChannel_getNativeInputChannel(env, obj);
    sp<IBinder> token = ibinderForJavaObject(env, tokenObj);
    if (nativeInputChannel != nullptr) {
        nativeInputChannel->getInputChannel()->setToken(token);
    }
}

// ----------------------------------------------------------------------------

static const JNINativeMethod gInputChannelMethods[] = {
@@ -312,8 +304,6 @@ static const JNINativeMethod gInputChannelMethods[] = {
            (void*)android_view_InputChannel_nativeDup },
    { "nativeGetToken", "()Landroid/os/IBinder;",
            (void*)android_view_InputChannel_nativeGetToken },
    { "nativeSetToken", "(Landroid/os/IBinder;)V",
            (void*)android_view_InputChannel_nativeSetToken }
};

int register_android_view_InputChannel(JNIEnv* env) {
+1 −5
Original line number Diff line number Diff line
@@ -496,8 +496,6 @@ public class InputManagerService extends IInputManager.Stub
        }

        InputChannel[] inputChannels = InputChannel.openInputChannelPair(inputChannelName);
        // Give the output channel a token just for identity purposes.
        inputChannels[0].setToken(new Binder());
        nativeRegisterInputMonitor(mPtr, inputChannels[0], displayId, false /*isGestureMonitor*/);
        inputChannels[0].dispose(); // don't need to retain the Java object reference
        return inputChannels[1];
@@ -528,7 +526,6 @@ public class InputManagerService extends IInputManager.Stub
        try {
            InputChannel[] inputChannels = InputChannel.openInputChannelPair(inputChannelName);
            InputMonitorHost host = new InputMonitorHost(inputChannels[0]);
            inputChannels[0].setToken(host.asBinder());
            nativeRegisterInputMonitor(mPtr, inputChannels[0], displayId,
                    true /*isGestureMonitor*/);
            return new InputMonitor(inputChannels[1], host);
@@ -547,7 +544,6 @@ public class InputManagerService extends IInputManager.Stub
        if (inputChannel == null) {
            throw new IllegalArgumentException("inputChannel must not be null.");
        }
        inputChannel.setToken(new Binder());

        nativeRegisterInputChannel(mPtr, inputChannel);
    }
@@ -2188,7 +2184,7 @@ public class InputManagerService extends IInputManager.Stub

        @Override
        public void pilferPointers() {
            nativePilferPointers(mPtr, asBinder());
            nativePilferPointers(mPtr, mInputChannel.getToken());
        }

        @Override
+0 −1
Original line number Diff line number Diff line
@@ -2207,7 +2207,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        mInputChannel = inputChannels[0];
        mClientChannel = inputChannels[1];
        mWmService.mInputManager.registerInputChannel(mInputChannel);
        mClientChannel.setToken(mInputChannel.getToken());
        mInputWindowHandle.token = mInputChannel.getToken();
        if (outInputChannel != null) {
            mClientChannel.transferTo(outInputChannel);
+2 −2
Original line number Diff line number Diff line
@@ -1596,8 +1596,8 @@ static jboolean nativeTransferTouchFocus(JNIEnv* env,
        return JNI_FALSE;
    }

    if (im->getInputManager()->getDispatcher()->
            transferTouchFocus(fromChannel->getToken(), toChannel->getToken())) {
    if (im->getInputManager()->getDispatcher()->transferTouchFocus(
            fromChannel->getConnectionToken(), toChannel->getConnectionToken())) {
        return JNI_TRUE;
    } else {
        return JNI_FALSE;