AIDL-ize InputManager IInputFlinger interface.
Use AIDL interface to define the IInputFlinger interface and replace
the manual interface.
Bug:155425003
Test: atest libgui_test, atest libinput_test.
Change-Id: Ibad036b8ceb3a3f5c6d58f8de4ea8c79379d29b5
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index e43446a..1030b82 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -55,7 +55,7 @@
output.writeFloat(color.g);
output.writeFloat(color.b);
#ifndef NO_INPUT
- inputInfo.write(output);
+ inputHandle->writeToParcel(&output);
#endif
output.write(transparentRegion);
output.writeUint32(transform);
@@ -152,7 +152,7 @@
color.b = input.readFloat();
#ifndef NO_INPUT
- inputInfo = InputWindowInfo::read(input);
+ inputHandle->readFromParcel(&input);
#endif
input.read(transparentRegion);
@@ -404,7 +404,7 @@
#ifndef NO_INPUT
if (other.what & eInputInfoChanged) {
what |= eInputInfoChanged;
- inputInfo = other.inputInfo;
+ inputHandle = new InputWindowHandle(*other.inputHandle);
}
#endif
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 16b46df..d797a35 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -1359,7 +1359,7 @@
mStatus = BAD_INDEX;
return *this;
}
- s->inputInfo = info;
+ s->inputHandle = new InputWindowHandle(info);
s->what |= layer_state_t::eInputInfoChanged;
return *this;
}
diff --git a/libs/gui/include/gui/LayerState.h b/libs/gui/include/gui/LayerState.h
index e60f677..00ae220 100644
--- a/libs/gui/include/gui/LayerState.h
+++ b/libs/gui/include/gui/LayerState.h
@@ -201,7 +201,7 @@
mat4 colorTransform;
#ifndef NO_INPUT
- InputWindowInfo inputInfo;
+ sp<InputWindowHandle> inputHandle = new InputWindowHandle();
#endif
client_cache_t cachedBuffer;
diff --git a/libs/gui/tests/EndToEndNativeInputTest.cpp b/libs/gui/tests/EndToEndNativeInputTest.cpp
index 32c7fc2..152f7ad 100644
--- a/libs/gui/tests/EndToEndNativeInputTest.cpp
+++ b/libs/gui/tests/EndToEndNativeInputTest.cpp
@@ -36,15 +36,16 @@
#include <gui/SurfaceComposerClient.h>
#include <gui/SurfaceControl.h>
-#include <input/InputWindow.h>
-#include <input/IInputFlinger.h>
-#include <input/InputTransport.h>
+#include <android/os/IInputFlinger.h>
#include <input/Input.h>
+#include <input/InputTransport.h>
+#include <input/InputWindow.h>
#include <ui/DisplayConfig.h>
#include <ui/Rect.h>
#include <ui/Region.h>
+using android::os::IInputFlinger;
namespace android {
namespace test {
@@ -71,7 +72,7 @@
InputChannel::openInputChannelPair("testchannels", mServerChannel, mClientChannel);
mInputFlinger = getInputFlinger();
- mInputFlinger->registerInputChannel(mServerChannel);
+ mInputFlinger->registerInputChannel(mServerChannel->getInfo());
populateInputInfo(width, height);
@@ -153,9 +154,7 @@
EXPECT_EQ(0, mev->getFlags() & VERIFIED_MOTION_EVENT_FLAGS);
}
- ~InputSurface() {
- mInputFlinger->unregisterInputChannel(mServerChannel);
- }
+ ~InputSurface() { mInputFlinger->unregisterInputChannel(mServerChannel->getInfo()); }
void doTransaction(std::function<void(SurfaceComposerClient::Transaction&,
const sp<SurfaceControl>&)> transactionBody) {