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

Commit 3d07ea51 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4574286 from 0b267105 to pi-release

Change-Id: Ifb9869537fcf6ab26338a10937f4e769d0e14ebe
parents b395fcb1 0b267105
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1621,7 +1621,7 @@ static void ShowUsageAndExit(int exitCode = 1) {
            "  -p: capture screenshot to filename.png (requires -o)\n"
            "  -z: generate zipped file (requires -o)\n"
            "  -s: write output to control socket (for init)\n"
            "  -S: write file location to control socket (for init; requires -o and -z)"
            "  -S: write file location to control socket (for init; requires -o and -z)\n"
            "  -q: disable vibrate\n"
            "  -B: send broadcast when finished (requires -o)\n"
            "  -P: send broadcast when started and update system properties on "
@@ -2213,10 +2213,12 @@ int run_main(int argc, char* argv[]) {
    }

    /* vibrate a few but shortly times to let user know it's finished */
    if (do_vibrate) {
        for (int i = 0; i < 3; i++) {
            Vibrate(75);
            usleep((75 + 50) * 1000);
        }
    }

    /* tell activity manager we're done */
    if (do_broadcast) {
+1 −1
Original line number Diff line number Diff line
@@ -615,7 +615,7 @@ sp<SurfaceControl> SurfaceComposerClient::createSurface(
                windowType, ownerUid, &handle, &gbp);
        ALOGE_IF(err, "SurfaceComposerClient::createSurface error %s", strerror(-err));
        if (err == NO_ERROR) {
            sur = new SurfaceControl(this, handle, gbp);
            sur = new SurfaceControl(this, handle, gbp, true /* owned */);
        }
    }
    return sur;
+9 −4
Original line number Diff line number Diff line
@@ -48,8 +48,9 @@ namespace android {
SurfaceControl::SurfaceControl(
        const sp<SurfaceComposerClient>& client,
        const sp<IBinder>& handle,
        const sp<IGraphicBufferProducer>& gbp)
    : mClient(client), mHandle(handle), mGraphicBufferProducer(gbp)
        const sp<IGraphicBufferProducer>& gbp,
        bool owned)
    : mClient(client), mHandle(handle), mGraphicBufferProducer(gbp), mOwned(owned)
{
}

@@ -60,7 +61,9 @@ SurfaceControl::~SurfaceControl()

void SurfaceControl::destroy()
{
    if (isValid()) {
    // Avoid destroying the server-side surface if we are not the owner of it, meaning that we
    // retrieved it from another process.
    if (isValid() && mOwned) {
        mClient->destroySurface(mHandle);
    }
    // clear all references and trigger an IPC now, to make sure things
@@ -184,9 +187,11 @@ sp<SurfaceControl> SurfaceControl::readFromParcel(Parcel* parcel)
    }
    sp<IBinder> gbp;
    parcel->readNullableStrongBinder(&gbp);

    // We aren't the original owner of the surface.
    return new SurfaceControl(new SurfaceComposerClient(
                    interface_cast<ISurfaceComposerClient>(client)),
            handle.get(), interface_cast<IGraphicBufferProducer>(gbp));
            handle.get(), interface_cast<IGraphicBufferProducer>(gbp), false /* owned */);
}

// ----------------------------------------------------------------------------
+3 −1
Original line number Diff line number Diff line
@@ -87,7 +87,8 @@ private:
    SurfaceControl(
            const sp<SurfaceComposerClient>& client,
            const sp<IBinder>& handle,
            const sp<IGraphicBufferProducer>& gbp);
            const sp<IGraphicBufferProducer>& gbp,
            bool owned);

    ~SurfaceControl();

@@ -100,6 +101,7 @@ private:
    sp<IGraphicBufferProducer>  mGraphicBufferProducer;
    mutable Mutex               mLock;
    mutable sp<Surface>         mSurfaceData;
    bool                        mOwned;
};

}; // namespace android