Remove InputChannel::setToken
The token is now assigned in the constructor. It is read-only. When you
open inputchannelpair, the same token is assigned to both server and client
side channels.
Bug: 142581626
Test: presubmit
Change-Id: I603603844b41f478e244b89dcdd1dab7e6260347
diff --git a/services/inputflinger/tests/InputDispatcher_test.cpp b/services/inputflinger/tests/InputDispatcher_test.cpp
index 7d69854..b706a74 100644
--- a/services/inputflinger/tests/InputDispatcher_test.cpp
+++ b/services/inputflinger/tests/InputDispatcher_test.cpp
@@ -470,7 +470,6 @@
const sp<InputDispatcher>& dispatcher, const std::string name, int32_t displayId) :
FakeInputReceiver(dispatcher, name, displayId),
mFocused(false), mFrame(Rect(0, 0, WIDTH, HEIGHT)), mLayoutParamFlags(0) {
- mServerChannel->setToken(new BBinder());
mDispatcher->registerInputChannel(mServerChannel);
inputApplicationHandle->updateInfo();
@@ -478,7 +477,7 @@
}
virtual bool updateInfo() {
- mInfo.token = mServerChannel ? mServerChannel->getToken() : nullptr;
+ mInfo.token = mServerChannel ? mServerChannel->getConnectionToken() : nullptr;
mInfo.name = mName;
mInfo.layoutParamsFlags = mLayoutParamFlags;
mInfo.layoutParamsType = InputWindowInfo::TYPE_APPLICATION;
@@ -859,7 +858,6 @@
FakeMonitorReceiver(const sp<InputDispatcher>& dispatcher, const std::string name,
int32_t displayId, bool isGestureMonitor = false)
: FakeInputReceiver(dispatcher, name, displayId) {
- mServerChannel->setToken(new BBinder());
mDispatcher->registerInputMonitor(mServerChannel, displayId, isGestureMonitor);
}
};