Renamed and moved InputWindow and related files
In preparation for the hierarchy listener interface, moved the
InputWindow structs into libgui and have libinput dependant on libgui.
Also renamed InputWindow to exclude Input since it will be used for more
generic purposes.
Test: Builds and flashes
Bug: 188792659
Change-Id: I24262cbc14d409c00273de0024a672394a959e5f
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index d102e07..001570c 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -31,6 +31,9 @@
namespace android {
+using gui::FocusRequest;
+using gui::WindowInfoHandle;
+
layer_state_t::layer_state_t()
: what(0),
x(0),
@@ -94,9 +97,7 @@
SAFE_PARCEL(output.writeFloat, color.r);
SAFE_PARCEL(output.writeFloat, color.g);
SAFE_PARCEL(output.writeFloat, color.b);
-#ifndef NO_INPUT
- SAFE_PARCEL(inputHandle->writeToParcel, &output);
-#endif
+ SAFE_PARCEL(windowInfoHandle->writeToParcel, &output);
SAFE_PARCEL(output.write, transparentRegion);
SAFE_PARCEL(output.writeUint32, transform);
SAFE_PARCEL(output.writeBool, transformToDisplayInverse);
@@ -205,9 +206,7 @@
color.g = tmpFloat;
SAFE_PARCEL(input.readFloat, &tmpFloat);
color.b = tmpFloat;
-#ifndef NO_INPUT
- SAFE_PARCEL(inputHandle->readFromParcel, &input);
-#endif
+ SAFE_PARCEL(windowInfoHandle->readFromParcel, &input);
SAFE_PARCEL(input.read, transparentRegion);
SAFE_PARCEL(input.readUint32, &transform);
@@ -491,14 +490,10 @@
if (other.what & eHasListenerCallbacksChanged) {
what |= eHasListenerCallbacksChanged;
}
-
-#ifndef NO_INPUT
if (other.what & eInputInfoChanged) {
what |= eInputInfoChanged;
- inputHandle = new InputWindowHandle(*other.inputHandle);
+ windowInfoHandle = new WindowInfoHandle(*other.windowInfoHandle);
}
-#endif
-
if (other.what & eCachedBufferChanged) {
what |= eCachedBufferChanged;
cachedBuffer = other.cachedBuffer;
@@ -589,11 +584,9 @@
bool InputWindowCommands::merge(const InputWindowCommands& other) {
bool changes = false;
-#ifndef NO_INPUT
changes |= !other.focusRequests.empty();
focusRequests.insert(focusRequests.end(), std::make_move_iterator(other.focusRequests.begin()),
std::make_move_iterator(other.focusRequests.end()));
-#endif
changes |= other.syncInputWindows && !syncInputWindows;
syncInputWindows |= other.syncInputWindows;
return changes;
@@ -601,31 +594,23 @@
bool InputWindowCommands::empty() const {
bool empty = true;
-#ifndef NO_INPUT
empty = focusRequests.empty() && !syncInputWindows;
-#endif
return empty;
}
void InputWindowCommands::clear() {
-#ifndef NO_INPUT
focusRequests.clear();
-#endif
syncInputWindows = false;
}
status_t InputWindowCommands::write(Parcel& output) const {
-#ifndef NO_INPUT
SAFE_PARCEL(output.writeParcelableVector, focusRequests);
-#endif
SAFE_PARCEL(output.writeBool, syncInputWindows);
return NO_ERROR;
}
status_t InputWindowCommands::read(const Parcel& input) {
-#ifndef NO_INPUT
SAFE_PARCEL(input.readParcelableVector, &focusRequests);
-#endif
SAFE_PARCEL(input.readBool, &syncInputWindows);
return NO_ERROR;
}