diff options
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()); } } } |