Loading libs/gui/SurfaceComposerClient.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -3118,6 +3118,10 @@ status_t SurfaceComposerClient::removeWindowInfosListener( ->removeWindowInfosListener(windowInfosListener, ComposerServiceAIDL::getComposerService()); } void SurfaceComposerClient::notifyShutdown() { ComposerServiceAIDL::getComposerService()->notifyShutdown(); } // ---------------------------------------------------------------------------- status_t ScreenshotClient::captureDisplay(const DisplayCaptureArgs& captureArgs, Loading libs/gui/aidl/android/gui/ISurfaceComposer.aidl +7 −0 Original line number Diff line number Diff line Loading @@ -573,4 +573,11 @@ interface ISurfaceComposer { @nullable StalledTransactionInfo getStalledTransactionInfo(int pid); SchedulingPolicy getSchedulingPolicy(); /** * Notifies the SurfaceFlinger that the ShutdownThread is running. When it is called, * transaction traces will be captured and writted into a file. * This method should not block the ShutdownThread therefore it's handled asynchronously. */ oneway void notifyShutdown(); } libs/gui/include/gui/SurfaceComposerClient.h +2 −0 Original line number Diff line number Diff line Loading @@ -824,6 +824,8 @@ public: nullptr); status_t removeWindowInfosListener(const sp<gui::WindowInfosListener>& windowInfosListener); static void notifyShutdown(); protected: ReleaseCallbackThread mReleaseCallbackThread; Loading libs/gui/tests/Surface_test.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -985,6 +985,8 @@ public: return binder::Status::ok(); } binder::Status notifyShutdown() override { return binder::Status::ok(); } protected: IBinder* onAsBinder() override { return nullptr; } Loading services/surfaceflinger/SurfaceFlinger.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -1013,8 +1013,9 @@ void SurfaceFlinger::initTransactionTraceWriter() { ALOGD("TransactionTraceWriter: file=%s already exists", filename.c_str()); return; } mTransactionTracing->flush(); ALOGD("TransactionTraceWriter: writing file=%s", filename.c_str()); mTransactionTracing->writeToFile(filename); mTransactionTracing->flush(); }; if (std::this_thread::get_id() == mMainThreadId) { writeFn(); Loading Loading @@ -10335,6 +10336,11 @@ binder::Status SurfaceComposerAIDL::getSchedulingPolicy(gui::SchedulingPolicy* o return gui::getSchedulingPolicy(outPolicy); } binder::Status SurfaceComposerAIDL::notifyShutdown() { TransactionTraceWriter::getInstance().invoke("systemShutdown_", /* overwrite= */ false); return ::android::binder::Status::ok(); } status_t SurfaceComposerAIDL::checkAccessPermission(bool usePermissionCache) { if (!mFlinger->callingThreadHasUnscopedSurfaceFlingerAccess(usePermissionCache)) { IPCThreadState* ipc = IPCThreadState::self(); Loading Loading
libs/gui/SurfaceComposerClient.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -3118,6 +3118,10 @@ status_t SurfaceComposerClient::removeWindowInfosListener( ->removeWindowInfosListener(windowInfosListener, ComposerServiceAIDL::getComposerService()); } void SurfaceComposerClient::notifyShutdown() { ComposerServiceAIDL::getComposerService()->notifyShutdown(); } // ---------------------------------------------------------------------------- status_t ScreenshotClient::captureDisplay(const DisplayCaptureArgs& captureArgs, Loading
libs/gui/aidl/android/gui/ISurfaceComposer.aidl +7 −0 Original line number Diff line number Diff line Loading @@ -573,4 +573,11 @@ interface ISurfaceComposer { @nullable StalledTransactionInfo getStalledTransactionInfo(int pid); SchedulingPolicy getSchedulingPolicy(); /** * Notifies the SurfaceFlinger that the ShutdownThread is running. When it is called, * transaction traces will be captured and writted into a file. * This method should not block the ShutdownThread therefore it's handled asynchronously. */ oneway void notifyShutdown(); }
libs/gui/include/gui/SurfaceComposerClient.h +2 −0 Original line number Diff line number Diff line Loading @@ -824,6 +824,8 @@ public: nullptr); status_t removeWindowInfosListener(const sp<gui::WindowInfosListener>& windowInfosListener); static void notifyShutdown(); protected: ReleaseCallbackThread mReleaseCallbackThread; Loading
libs/gui/tests/Surface_test.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -985,6 +985,8 @@ public: return binder::Status::ok(); } binder::Status notifyShutdown() override { return binder::Status::ok(); } protected: IBinder* onAsBinder() override { return nullptr; } Loading
services/surfaceflinger/SurfaceFlinger.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -1013,8 +1013,9 @@ void SurfaceFlinger::initTransactionTraceWriter() { ALOGD("TransactionTraceWriter: file=%s already exists", filename.c_str()); return; } mTransactionTracing->flush(); ALOGD("TransactionTraceWriter: writing file=%s", filename.c_str()); mTransactionTracing->writeToFile(filename); mTransactionTracing->flush(); }; if (std::this_thread::get_id() == mMainThreadId) { writeFn(); Loading Loading @@ -10335,6 +10336,11 @@ binder::Status SurfaceComposerAIDL::getSchedulingPolicy(gui::SchedulingPolicy* o return gui::getSchedulingPolicy(outPolicy); } binder::Status SurfaceComposerAIDL::notifyShutdown() { TransactionTraceWriter::getInstance().invoke("systemShutdown_", /* overwrite= */ false); return ::android::binder::Status::ok(); } status_t SurfaceComposerAIDL::checkAccessPermission(bool usePermissionCache) { if (!mFlinger->callingThreadHasUnscopedSurfaceFlingerAccess(usePermissionCache)) { IPCThreadState* ipc = IPCThreadState::self(); Loading