Loading cmds/dumpstate/dumpstate.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -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 " Loading Loading @@ -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) { Loading libs/gui/SurfaceComposerClient.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading libs/gui/SurfaceControl.cpp +9 −4 Original line number Diff line number Diff line Loading @@ -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) { } Loading @@ -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 Loading Loading @@ -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 */); } // ---------------------------------------------------------------------------- Loading libs/gui/include/gui/SurfaceControl.h +3 −1 Original line number Diff line number Diff line Loading @@ -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(); Loading @@ -100,6 +101,7 @@ private: sp<IGraphicBufferProducer> mGraphicBufferProducer; mutable Mutex mLock; mutable sp<Surface> mSurfaceData; bool mOwned; }; }; // namespace android Loading Loading
cmds/dumpstate/dumpstate.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -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 " Loading Loading @@ -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) { Loading
libs/gui/SurfaceComposerClient.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading
libs/gui/SurfaceControl.cpp +9 −4 Original line number Diff line number Diff line Loading @@ -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) { } Loading @@ -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 Loading Loading @@ -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 */); } // ---------------------------------------------------------------------------- Loading
libs/gui/include/gui/SurfaceControl.h +3 −1 Original line number Diff line number Diff line Loading @@ -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(); Loading @@ -100,6 +101,7 @@ private: sp<IGraphicBufferProducer> mGraphicBufferProducer; mutable Mutex mLock; mutable sp<Surface> mSurfaceData; bool mOwned; }; }; // namespace android Loading