diff options
author | Alex Buynytskyy <alexbuy@google.com> | 2020-09-22 11:39:53 -0700 |
---|---|---|
committer | Alex Buynytskyy <alexbuy@google.com> | 2020-09-24 21:50:38 +0000 |
commit | bd8444d1e3386f86ac662faa71418e2cd57e1071 (patch) | |
tree | 4e9c025dfffd95466afa075ee5d0da34d5a9c3ff /services/incremental/IncrementalService.cpp | |
parent | 8abad0504e91f887ba01b4cbf8978c6ba8086709 (diff) |
Excessive battery usage fix.
Using wake to forcefully wake up the looper instead of 1s timeout.
Fixed: 168156055
Test: atest ApkVerityTest:com.android.apkverity.ApkVerityTest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: If65f65f9214b34bf057ed5f1877348d835251d14
Merged-In: 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 f7082a9a1a0c..f3940e609b8b 100644 --- a/services/incremental/IncrementalService.cpp +++ b/services/incremental/IncrementalService.cpp @@ -305,6 +305,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. @@ -1377,7 +1378,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); } |