summaryrefslogtreecommitdiff
path: root/libs/gui/tests/EndToEndNativeInputTest.cpp
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-09-23 23:03:42 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-09-23 23:03:42 +0000
commitbedd1169f6756dfa3cd5fdaa9fb0ff3b9c394fbb (patch)
tree5028116da38219c1153b41649c3d780b9d1154d2 /libs/gui/tests/EndToEndNativeInputTest.cpp
parent075b5985cd110425c8ba00e54fb93092273859d3 (diff)
parent1560166e0cff035f8ee9ec2dc11deb1e355970cf (diff)
Merge "Second reland "Let InputFlinger create the server InputChannel""
Diffstat (limited to 'libs/gui/tests/EndToEndNativeInputTest.cpp')
-rw-r--r--libs/gui/tests/EndToEndNativeInputTest.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/libs/gui/tests/EndToEndNativeInputTest.cpp b/libs/gui/tests/EndToEndNativeInputTest.cpp
index 7ff258b980..ef4d870ec7 100644
--- a/libs/gui/tests/EndToEndNativeInputTest.cpp
+++ b/libs/gui/tests/EndToEndNativeInputTest.cpp
@@ -68,12 +68,10 @@ class InputSurface {
public:
InputSurface(const sp<SurfaceControl> &sc, int width, int height) {
mSurfaceControl = sc;
- std::unique_ptr<InputChannel> clientChannel;
- InputChannel::openInputChannelPair("testchannels", mServerChannel, clientChannel);
- mClientChannel = std::move(clientChannel);
mInputFlinger = getInputFlinger();
- mInputFlinger->registerInputChannel(*mServerChannel);
+ mClientChannel = std::make_shared<InputChannel>();
+ mInputFlinger->createInputChannel("testchannels", mClientChannel.get());
populateInputInfo(width, height);
@@ -155,7 +153,7 @@ public:
EXPECT_EQ(0, mev->getFlags() & VERIFIED_MOTION_EVENT_FLAGS);
}
- ~InputSurface() { mInputFlinger->unregisterInputChannel(mServerChannel->getConnectionToken()); }
+ ~InputSurface() { mInputFlinger->removeInputChannel(mClientChannel->getConnectionToken()); }
void doTransaction(std::function<void(SurfaceComposerClient::Transaction&,
const sp<SurfaceControl>&)> transactionBody) {
@@ -192,7 +190,7 @@ private:
}
void populateInputInfo(int width, int height) {
- mInputInfo.token = mServerChannel->getConnectionToken();
+ mInputInfo.token = mClientChannel->getConnectionToken();
mInputInfo.name = "Test info";
mInputInfo.flags = InputWindowInfo::Flag::NOT_TOUCH_MODAL;
mInputInfo.type = InputWindowInfo::Type::BASE_APPLICATION;
@@ -219,7 +217,6 @@ private:
}
public:
sp<SurfaceControl> mSurfaceControl;
- std::unique_ptr<InputChannel> mServerChannel;
std::shared_ptr<InputChannel> mClientChannel;
sp<IInputFlinger> mInputFlinger;