diff options
author | Roshan Pius <rpius@google.com> | 2020-09-21 22:44:44 +0000 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2020-09-21 22:44:44 +0000 |
commit | 015cb700cb3ddfc4d3bb084513f3651128182bc1 (patch) | |
tree | f22ccfc1d0b038b8a96c5019f3c8b58b7882c0fa /libs/gui/tests/EndToEndNativeInputTest.cpp | |
parent | 6e9f864088187ecc59282a80c84a21b5d33a26f3 (diff) |
Revert "Let InputFlinger create the server InputChannel"
Revert submission 12594832-hide_server_input_channel
Reason for revert: <INSERT REASONING HERE>
Reverted Changes:
I7033caf10:Use new create/removeInputChannel().
I35f768c8a:Let InputFlinger create the server InputChannel
Bug: 169083114
Bug: 169088136
Change-Id: Ib6945129936006682cd03cea614fbdfd4f5fa008
Diffstat (limited to 'libs/gui/tests/EndToEndNativeInputTest.cpp')
-rw-r--r-- | libs/gui/tests/EndToEndNativeInputTest.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libs/gui/tests/EndToEndNativeInputTest.cpp b/libs/gui/tests/EndToEndNativeInputTest.cpp index ac795830f3..4d306e7ba9 100644 --- a/libs/gui/tests/EndToEndNativeInputTest.cpp +++ b/libs/gui/tests/EndToEndNativeInputTest.cpp @@ -68,10 +68,12 @@ 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(); - mClientChannel = std::make_shared<InputChannel>(); - mInputFlinger->createInputChannel("testchannels", mClientChannel.get()); + mInputFlinger->registerInputChannel(*mServerChannel); populateInputInfo(width, height); @@ -153,7 +155,7 @@ public: EXPECT_EQ(0, mev->getFlags() & VERIFIED_MOTION_EVENT_FLAGS); } - ~InputSurface() { mInputFlinger->removeInputChannel(mClientChannel->getConnectionToken()); } + ~InputSurface() { mInputFlinger->unregisterInputChannel(mServerChannel->getConnectionToken()); } void doTransaction(std::function<void(SurfaceComposerClient::Transaction&, const sp<SurfaceControl>&)> transactionBody) { @@ -190,7 +192,7 @@ private: } void populateInputInfo(int width, int height) { - mInputInfo.token = mClientChannel->getConnectionToken(); + mInputInfo.token = mServerChannel->getConnectionToken(); mInputInfo.name = "Test info"; mInputInfo.flags = InputWindowInfo::Flag::NOT_TOUCH_MODAL; mInputInfo.type = InputWindowInfo::Type::BASE_APPLICATION; @@ -217,6 +219,7 @@ private: } public: sp<SurfaceControl> mSurfaceControl; + std::unique_ptr<InputChannel> mServerChannel; std::shared_ptr<InputChannel> mClientChannel; sp<IInputFlinger> mInputFlinger; |