diff options
| author | 2020-09-22 11:39:53 -0700 | |
|---|---|---|
| committer | 2020-09-23 18:17:40 +0000 | |
| commit | 74fcc57ec427bf0a034c7b2a31678b8638a7ec02 (patch) | |
| tree | 538d0020554be3dd577c15ab85d56421492c1ec1 /services/incremental/IncrementalService.cpp | |
| parent | b2bf4c16d163eec67a0a0248d9bb9d836ff3fa84 (diff) | |
Excessive battery usage fix.
Using wake to forcefully wake up the looper instead of 1s timeout.
Bug: 168156055
Test: atest ApkVerityTest:com.android.apkverity.ApkVerityTest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest ChecksumsTest
Change-Id: If65f65f9214b34bf057ed5f1877348d835251d14
Diffstat (limited to 'services/incremental/IncrementalService.cpp')
| -rw-r--r-- | services/incremental/IncrementalService.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/services/incremental/IncrementalService.cpp b/services/incremental/IncrementalService.cpp index a5f0d045948c..e355a20907d8 100644 --- a/services/incremental/IncrementalService.cpp +++ b/services/incremental/IncrementalService.cpp @@ -306,6 +306,7 @@ IncrementalService::~IncrementalService() { } mJobCondition.notify_all(); mJobProcessor.join(); + mLooper->wake(); mCmdLooperThread.join(); mTimedQueue->stop(); // Ensure that mounts are destroyed while the service is still valid. @@ -1378,7 +1379,7 @@ bool IncrementalService::mountExistingImage(std::string_view root) { } void IncrementalService::runCmdLooper() { - constexpr auto kTimeoutMsecs = 1000; + constexpr auto kTimeoutMsecs = -1; while (mRunning.load(std::memory_order_relaxed)) { mLooper->pollAll(kTimeoutMsecs); } |