Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7044d44 authored by Robert Carr's avatar Robert Carr Committed by android-build-merger
Browse files

Merge "Propagate error codes from createSurface" into pi-dev am: a912b6ec

am: 07c238b5

Change-Id: Iab558a6e9a8b8e264bb1673a3921bf80969f772c
parents a0c72620 07c238b5
Loading
Loading
Loading
Loading
+21 −3
Original line number Diff line number Diff line
@@ -611,8 +611,26 @@ sp<SurfaceControl> SurfaceComposerClient::createSurface(
        SurfaceControl* parent,
        uint32_t windowType,
        uint32_t ownerUid)
{
    sp<SurfaceControl> s;
    createSurfaceChecked(name, w, h, format, &s, flags, parent, windowType, ownerUid);
    return s;
}

status_t SurfaceComposerClient::createSurfaceChecked(
        const String8& name,
        uint32_t w,
        uint32_t h,
        PixelFormat format,
        sp<SurfaceControl>* outSurface,
        uint32_t flags,
        SurfaceControl* parent,
        uint32_t windowType,
        uint32_t ownerUid)
{
    sp<SurfaceControl> sur;
    status_t err = NO_ERROR;

    if (mStatus == NO_ERROR) {
        sp<IBinder> handle;
        sp<IBinder> parentHandle;
@@ -621,14 +639,14 @@ sp<SurfaceControl> SurfaceComposerClient::createSurface(
        if (parent != nullptr) {
            parentHandle = parent->getHandle();
        }
        status_t err = mClient->createSurface(name, w, h, format, flags, parentHandle,
        err = mClient->createSurface(name, w, h, format, flags, parentHandle,
                windowType, ownerUid, &handle, &gbp);
        ALOGE_IF(err, "SurfaceComposerClient::createSurface error %s", strerror(-err));
        if (err == NO_ERROR) {
            sur = new SurfaceControl(this, handle, gbp, true /* owned */);
            *outSurface = new SurfaceControl(this, handle, gbp, true /* owned */);
        }
    }
    return sur;
    return err;
}

status_t SurfaceComposerClient::destroySurface(const sp<IBinder>& sid) {
+12 −0
Original line number Diff line number Diff line
@@ -115,6 +115,18 @@ public:
            uint32_t ownerUid = 0 // UID of the task
    );

    status_t createSurfaceChecked(
            const String8& name,// name of the surface
            uint32_t w,         // width in pixel
            uint32_t h,         // height in pixel
            PixelFormat format, // pixel-format desired
            sp<SurfaceControl>* outSurface,
            uint32_t flags = 0, // usage flags
            SurfaceControl* parent = nullptr, // parent
            uint32_t windowType = 0, // from WindowManager.java (STATUS_BAR, INPUT_METHOD, etc.)
            uint32_t ownerUid = 0 // UID of the task
    );

    //! Create a virtual display
    static sp<IBinder> createDisplay(const String8& displayName, bool secure);