Loading libs/gui/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ cc_library_shared { export_shared_lib_headers: [ "libbinder", "libinput", ], // bufferhub is not used when building libgui for vendors Loading libs/gui/LayerState.cpp +18 −1 Original line number Diff line number Diff line Loading @@ -448,19 +448,36 @@ void layer_state_t::merge(const layer_state_t& other) { // ------------------------------- InputWindowCommands ---------------------------------------- void InputWindowCommands::merge(const InputWindowCommands& other) { 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; } void InputWindowCommands::clear() { #ifndef NO_INPUT focusRequests.clear(); #endif syncInputWindows = false; } void InputWindowCommands::write(Parcel& output) const { #ifndef NO_INPUT output.writeParcelableVector(focusRequests); #endif output.writeBool(syncInputWindows); } void InputWindowCommands::read(const Parcel& input) { #ifndef NO_INPUT input.readParcelableVector(&focusRequests); #endif syncInputWindows = input.readBool(); } Loading libs/gui/SurfaceComposerClient.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -1364,6 +1364,21 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setInput return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFocusedWindow( const sp<IBinder>& token, const sp<IBinder>& focusedToken, nsecs_t timestampNanos) { FocusRequest request; request.token = token; request.focusedToken = focusedToken; request.timestamp = timestampNanos; return setFocusedWindow(request); } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFocusedWindow( const FocusRequest& request) { mInputWindowCommands.focusRequests.push_back(request); return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::syncInputWindows() { mInputWindowCommands.syncInputWindows = true; return *this; Loading libs/gui/include/gui/LayerState.h +6 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ #include <math/mat4.h> #ifndef NO_INPUT #include <android/FocusRequest.h> #include <input/InputWindow.h> #endif Loading Loading @@ -283,9 +284,13 @@ struct DisplayState { }; struct InputWindowCommands { #ifndef NO_INPUT std::vector<FocusRequest> focusRequests; #endif bool syncInputWindows{false}; void merge(const InputWindowCommands& other); // Merges the passed in commands and returns true if there were any changes. bool merge(const InputWindowCommands& other); void clear(); void write(Parcel& output) const; void read(const Parcel& input); Loading libs/gui/include/gui/SurfaceComposerClient.h +3 −0 Original line number Diff line number Diff line Loading @@ -507,6 +507,9 @@ public: #ifndef NO_INPUT Transaction& setInputWindowInfo(const sp<SurfaceControl>& sc, const InputWindowInfo& info); Transaction& setFocusedWindow(const sp<IBinder>& token, const sp<IBinder>& focusedToken, nsecs_t timestampNanos); Transaction& setFocusedWindow(const FocusRequest& request); Transaction& syncInputWindows(); #endif Loading Loading
libs/gui/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ cc_library_shared { export_shared_lib_headers: [ "libbinder", "libinput", ], // bufferhub is not used when building libgui for vendors Loading
libs/gui/LayerState.cpp +18 −1 Original line number Diff line number Diff line Loading @@ -448,19 +448,36 @@ void layer_state_t::merge(const layer_state_t& other) { // ------------------------------- InputWindowCommands ---------------------------------------- void InputWindowCommands::merge(const InputWindowCommands& other) { 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; } void InputWindowCommands::clear() { #ifndef NO_INPUT focusRequests.clear(); #endif syncInputWindows = false; } void InputWindowCommands::write(Parcel& output) const { #ifndef NO_INPUT output.writeParcelableVector(focusRequests); #endif output.writeBool(syncInputWindows); } void InputWindowCommands::read(const Parcel& input) { #ifndef NO_INPUT input.readParcelableVector(&focusRequests); #endif syncInputWindows = input.readBool(); } Loading
libs/gui/SurfaceComposerClient.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -1364,6 +1364,21 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setInput return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFocusedWindow( const sp<IBinder>& token, const sp<IBinder>& focusedToken, nsecs_t timestampNanos) { FocusRequest request; request.token = token; request.focusedToken = focusedToken; request.timestamp = timestampNanos; return setFocusedWindow(request); } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFocusedWindow( const FocusRequest& request) { mInputWindowCommands.focusRequests.push_back(request); return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::syncInputWindows() { mInputWindowCommands.syncInputWindows = true; return *this; Loading
libs/gui/include/gui/LayerState.h +6 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ #include <math/mat4.h> #ifndef NO_INPUT #include <android/FocusRequest.h> #include <input/InputWindow.h> #endif Loading Loading @@ -283,9 +284,13 @@ struct DisplayState { }; struct InputWindowCommands { #ifndef NO_INPUT std::vector<FocusRequest> focusRequests; #endif bool syncInputWindows{false}; void merge(const InputWindowCommands& other); // Merges the passed in commands and returns true if there were any changes. bool merge(const InputWindowCommands& other); void clear(); void write(Parcel& output) const; void read(const Parcel& input); Loading
libs/gui/include/gui/SurfaceComposerClient.h +3 −0 Original line number Diff line number Diff line Loading @@ -507,6 +507,9 @@ public: #ifndef NO_INPUT Transaction& setInputWindowInfo(const sp<SurfaceControl>& sc, const InputWindowInfo& info); Transaction& setFocusedWindow(const sp<IBinder>& token, const sp<IBinder>& focusedToken, nsecs_t timestampNanos); Transaction& setFocusedWindow(const FocusRequest& request); Transaction& syncInputWindows(); #endif Loading