From e96bcd52a008a25139acf07050a6dc3a5d153009 Mon Sep 17 00:00:00 2001 From: Rhed Jao Date: Fri, 21 Aug 2020 14:48:20 +0800 Subject: Deletes temporary files from thread pool when report is cancel Bug: 163027506 Test: atest dumpstate_test Test: atest dumpstate_smoke_test Test: Manual cancel the bureport from notification. Change-Id: Ic4ab0531e0f598c2d2b820293cd2e6444bbf1abb Merged-In: Ic4ab0531e0f598c2d2b820293cd2e6444bbf1abb (cherry picked from commit 0daac91e7b4b2b9a108be1f57dd77c9813abb90f) --- cmds/dumpstate/dumpstate.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cmds/dumpstate/dumpstate.cpp') diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp index 0fba40e2e7..eefc84f0f1 100644 --- a/cmds/dumpstate/dumpstate.cpp +++ b/cmds/dumpstate/dumpstate.cpp @@ -2689,6 +2689,15 @@ void Dumpstate::Cancel() { } tombstone_data_.clear(); anr_data_.clear(); + + // Instead of shutdown the pool, we delete temporary files directly since + // shutdown blocking the call. + if (dump_pool_) { + dump_pool_->deleteTempFiles(); + } + if (zip_entry_tasks_) { + zip_entry_tasks_->run(/*do_cancel =*/ true); + } } /* -- cgit v1.2.3-59-g8ed1b