Loading libs/gui/ISurfaceComposer.cpp +35 −0 Original line number Diff line number Diff line Loading @@ -497,6 +497,28 @@ public: return result; } status_t onPullAtom(const int32_t atomId, std::string* pulledData, bool* success) { Parcel data, reply; SAFE_PARCEL(data.writeInterfaceToken, ISurfaceComposer::getInterfaceDescriptor()); SAFE_PARCEL(data.writeInt32, atomId); status_t err = remote()->transact(BnSurfaceComposer::ON_PULL_ATOM, data, &reply); if (err != NO_ERROR) { ALOGE("onPullAtom failed to transact: %d", err); return err; } int32_t size = 0; SAFE_PARCEL(reply.readInt32, &size); const void* dataPtr = reply.readInplace(size); if (dataPtr == nullptr) { return UNEXPECTED_NULL; } pulledData->assign((const char*)dataPtr, size); SAFE_PARCEL(reply.readBool, success); return NO_ERROR; } status_t enableVSyncInjections(bool enable) override { Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); Loading Loading @@ -2021,6 +2043,19 @@ status_t BnSurfaceComposer::onTransact( } return overrideHdrTypes(display, hdrTypesVector); } case ON_PULL_ATOM: { CHECK_INTERFACE(ISurfaceComposer, data, reply); int32_t atomId = 0; SAFE_PARCEL(data.readInt32, &atomId); std::string pulledData; bool success; status_t err = onPullAtom(atomId, &pulledData, &success); SAFE_PARCEL(reply->writeByteArray, pulledData.size(), reinterpret_cast<const uint8_t*>(pulledData.data())); SAFE_PARCEL(reply->writeBool, success); return err; } default: { return BBinder::onTransact(code, data, reply, flags); } Loading libs/gui/SurfaceComposerClient.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -1949,6 +1949,11 @@ status_t SurfaceComposerClient::overrideHdrTypes(const sp<IBinder>& display, return ComposerService::getComposerService()->overrideHdrTypes(display, hdrTypes); } status_t SurfaceComposerClient::onPullAtom(const int32_t atomId, std::string* outData, bool* success) { return ComposerService::getComposerService()->onPullAtom(atomId, outData, success); } status_t SurfaceComposerClient::getDisplayedContentSamplingAttributes(const sp<IBinder>& display, ui::PixelFormat* outFormat, ui::Dataspace* outDataspace, Loading libs/gui/include/gui/ISurfaceComposer.h +7 −0 Original line number Diff line number Diff line Loading @@ -275,6 +275,12 @@ public: virtual status_t overrideHdrTypes(const sp<IBinder>& display, const std::vector<ui::Hdr>& hdrTypes) = 0; /* Pulls surfaceflinger atoms global stats and layer stats to pipe to statsd. * * Requires the calling uid be from system server. */ virtual status_t onPullAtom(const int32_t atomId, std::string* outData, bool* success) = 0; virtual status_t enableVSyncInjections(bool enable) = 0; virtual status_t injectVSync(nsecs_t when) = 0; Loading Loading @@ -600,6 +606,7 @@ public: OVERRIDE_HDR_TYPES, ADD_HDR_LAYER_INFO_LISTENER, REMOVE_HDR_LAYER_INFO_LISTENER, ON_PULL_ATOM, // Always append new enum to the end. }; Loading libs/gui/include/gui/SurfaceComposerClient.h +2 −0 Original line number Diff line number Diff line Loading @@ -567,6 +567,8 @@ public: static status_t overrideHdrTypes(const sp<IBinder>& display, const std::vector<ui::Hdr>& hdrTypes); static status_t onPullAtom(const int32_t atomId, std::string* outData, bool* success); static void setDisplayProjection(const sp<IBinder>& token, ui::Rotation orientation, const Rect& layerStackRect, const Rect& displayRect); Loading libs/gui/tests/Surface_test.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -776,6 +776,10 @@ public: const std::vector<ui::Hdr>& /*hdrTypes*/) override { return NO_ERROR; } status_t onPullAtom(const int32_t /*atomId*/, std::string* /*outData*/, bool* /*success*/) override { return NO_ERROR; } status_t enableVSyncInjections(bool /*enable*/) override { return NO_ERROR; } Loading Loading
libs/gui/ISurfaceComposer.cpp +35 −0 Original line number Diff line number Diff line Loading @@ -497,6 +497,28 @@ public: return result; } status_t onPullAtom(const int32_t atomId, std::string* pulledData, bool* success) { Parcel data, reply; SAFE_PARCEL(data.writeInterfaceToken, ISurfaceComposer::getInterfaceDescriptor()); SAFE_PARCEL(data.writeInt32, atomId); status_t err = remote()->transact(BnSurfaceComposer::ON_PULL_ATOM, data, &reply); if (err != NO_ERROR) { ALOGE("onPullAtom failed to transact: %d", err); return err; } int32_t size = 0; SAFE_PARCEL(reply.readInt32, &size); const void* dataPtr = reply.readInplace(size); if (dataPtr == nullptr) { return UNEXPECTED_NULL; } pulledData->assign((const char*)dataPtr, size); SAFE_PARCEL(reply.readBool, success); return NO_ERROR; } status_t enableVSyncInjections(bool enable) override { Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); Loading Loading @@ -2021,6 +2043,19 @@ status_t BnSurfaceComposer::onTransact( } return overrideHdrTypes(display, hdrTypesVector); } case ON_PULL_ATOM: { CHECK_INTERFACE(ISurfaceComposer, data, reply); int32_t atomId = 0; SAFE_PARCEL(data.readInt32, &atomId); std::string pulledData; bool success; status_t err = onPullAtom(atomId, &pulledData, &success); SAFE_PARCEL(reply->writeByteArray, pulledData.size(), reinterpret_cast<const uint8_t*>(pulledData.data())); SAFE_PARCEL(reply->writeBool, success); return err; } default: { return BBinder::onTransact(code, data, reply, flags); } Loading
libs/gui/SurfaceComposerClient.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -1949,6 +1949,11 @@ status_t SurfaceComposerClient::overrideHdrTypes(const sp<IBinder>& display, return ComposerService::getComposerService()->overrideHdrTypes(display, hdrTypes); } status_t SurfaceComposerClient::onPullAtom(const int32_t atomId, std::string* outData, bool* success) { return ComposerService::getComposerService()->onPullAtom(atomId, outData, success); } status_t SurfaceComposerClient::getDisplayedContentSamplingAttributes(const sp<IBinder>& display, ui::PixelFormat* outFormat, ui::Dataspace* outDataspace, Loading
libs/gui/include/gui/ISurfaceComposer.h +7 −0 Original line number Diff line number Diff line Loading @@ -275,6 +275,12 @@ public: virtual status_t overrideHdrTypes(const sp<IBinder>& display, const std::vector<ui::Hdr>& hdrTypes) = 0; /* Pulls surfaceflinger atoms global stats and layer stats to pipe to statsd. * * Requires the calling uid be from system server. */ virtual status_t onPullAtom(const int32_t atomId, std::string* outData, bool* success) = 0; virtual status_t enableVSyncInjections(bool enable) = 0; virtual status_t injectVSync(nsecs_t when) = 0; Loading Loading @@ -600,6 +606,7 @@ public: OVERRIDE_HDR_TYPES, ADD_HDR_LAYER_INFO_LISTENER, REMOVE_HDR_LAYER_INFO_LISTENER, ON_PULL_ATOM, // Always append new enum to the end. }; Loading
libs/gui/include/gui/SurfaceComposerClient.h +2 −0 Original line number Diff line number Diff line Loading @@ -567,6 +567,8 @@ public: static status_t overrideHdrTypes(const sp<IBinder>& display, const std::vector<ui::Hdr>& hdrTypes); static status_t onPullAtom(const int32_t atomId, std::string* outData, bool* success); static void setDisplayProjection(const sp<IBinder>& token, ui::Rotation orientation, const Rect& layerStackRect, const Rect& displayRect); Loading
libs/gui/tests/Surface_test.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -776,6 +776,10 @@ public: const std::vector<ui::Hdr>& /*hdrTypes*/) override { return NO_ERROR; } status_t onPullAtom(const int32_t /*atomId*/, std::string* /*outData*/, bool* /*success*/) override { return NO_ERROR; } status_t enableVSyncInjections(bool /*enable*/) override { return NO_ERROR; } Loading