diff options
author | 2023-10-05 15:40:38 -0700 | |
---|---|---|
committer | 2023-10-05 15:40:38 -0700 | |
commit | 1961b2f7b191744f3fc6bb4d32f0da0ce3ee0567 (patch) | |
tree | b9785db180fb54b3a776f645cbb2a7ef480e0cb9 /libs/gui/DisplayEventReceiver.cpp | |
parent | e4b64ebecf894e3047e46894a83ab8d37feabd3e (diff) | |
parent | 313d1596d818bc94fbab3d42b8c50306871f74a5 (diff) |
Merge Android 14
Bug: 298295554
Merged-In: I114a4cf83978f152959a6ec244d322603ff5257b
Change-Id: Ia35ae6e11052fcc3b2bdaabd6dc57d0d223de269
Diffstat (limited to 'libs/gui/DisplayEventReceiver.cpp')
-rw-r--r-- | libs/gui/DisplayEventReceiver.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/libs/gui/DisplayEventReceiver.cpp b/libs/gui/DisplayEventReceiver.cpp index bfb77699c0..6849a95d1e 100644 --- a/libs/gui/DisplayEventReceiver.cpp +++ b/libs/gui/DisplayEventReceiver.cpp @@ -14,15 +14,16 @@ * limitations under the License. */ +#define LOG_TAG "DisplayEventReceiver" + #include <string.h> #include <utils/Errors.h> #include <gui/DisplayEventReceiver.h> -#include <gui/ISurfaceComposer.h> #include <gui/VsyncEventData.h> -#include <private/gui/ComposerService.h> +#include <private/gui/ComposerServiceAIDL.h> #include <private/gui/BitTube.h> @@ -32,21 +33,29 @@ namespace android { // --------------------------------------------------------------------------- -DisplayEventReceiver::DisplayEventReceiver( - ISurfaceComposer::VsyncSource vsyncSource, - ISurfaceComposer::EventRegistrationFlags eventRegistration) { - sp<ISurfaceComposer> sf(ComposerService::getComposerService()); +DisplayEventReceiver::DisplayEventReceiver(gui::ISurfaceComposer::VsyncSource vsyncSource, + EventRegistrationFlags eventRegistration, + const sp<IBinder>& layerHandle) { + sp<gui::ISurfaceComposer> sf(ComposerServiceAIDL::getComposerService()); if (sf != nullptr) { - mEventConnection = sf->createDisplayEventConnection(vsyncSource, eventRegistration); - if (mEventConnection != nullptr) { + mEventConnection = nullptr; + binder::Status status = + sf->createDisplayEventConnection(vsyncSource, + static_cast< + gui::ISurfaceComposer::EventRegistration>( + eventRegistration.get()), + layerHandle, &mEventConnection); + if (status.isOk() && mEventConnection != nullptr) { mDataChannel = std::make_unique<gui::BitTube>(); - const auto status = mEventConnection->stealReceiveChannel(mDataChannel.get()); + status = mEventConnection->stealReceiveChannel(mDataChannel.get()); if (!status.isOk()) { ALOGE("stealReceiveChannel failed: %s", status.toString8().c_str()); mInitError = std::make_optional<status_t>(status.transactionError()); mDataChannel.reset(); mEventConnection.clear(); } + } else { + ALOGE("DisplayEventConnection creation failed: status=%s", status.toString8().c_str()); } } } |