InputDispatcher: Look up channel by token.

When comparing InputChannels coming from the client (for example to see if
a connection has dissapeared in the latest list), we need to compare by token
not by equality since of course they will now be different objects
each call to setInputWindows.

Bug: 80101428
Bug: 113136004
Bug: 111440400
Test: Manual
Change-Id: Ic384822df8418c80fb5578213149863044f890f4
diff --git a/services/inputflinger/tests/InputDispatcher_test.cpp b/services/inputflinger/tests/InputDispatcher_test.cpp
index 0780704..e860db5 100644
--- a/services/inputflinger/tests/InputDispatcher_test.cpp
+++ b/services/inputflinger/tests/InputDispatcher_test.cpp
@@ -338,7 +338,6 @@
             const std::string name, int32_t displayId) :
                 mDispatcher(dispatcher), mName(name), mDisplayId(displayId) {
             InputChannel::openInputChannelPair(name, mServerChannel, mClientChannel);
-            mServerChannel->setToken(new BBinder());
 
             mConsumer = new InputConsumer(mClientChannel);
         }
@@ -370,6 +369,7 @@
             InputWindowHandle(inputApplicationHandle),
             FakeInputReceiver(dispatcher, name, displayId),
             mFocused(false) {
+            mServerChannel->setToken(new BBinder());
             mDispatcher->registerInputChannel(mServerChannel, displayId);
     }