Merge "Excessive battery usage fix." am: 459d0ba244 am: 9a6519978b

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1438012

Change-Id: I582304f7b26cf9a7767b46ceab2aafccafe79cdf
This commit is contained in:
Treehugger Robot
2020-09-25 05:53:05 +00:00
committed by Automerger Merge Worker

View File

@@ -305,6 +305,7 @@ IncrementalService::~IncrementalService() {
} }
mJobCondition.notify_all(); mJobCondition.notify_all();
mJobProcessor.join(); mJobProcessor.join();
mLooper->wake();
mCmdLooperThread.join(); mCmdLooperThread.join();
mTimedQueue->stop(); mTimedQueue->stop();
// Ensure that mounts are destroyed while the service is still valid. // 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() { void IncrementalService::runCmdLooper() {
constexpr auto kTimeoutMsecs = 1000; constexpr auto kTimeoutMsecs = -1;
while (mRunning.load(std::memory_order_relaxed)) { while (mRunning.load(std::memory_order_relaxed)) {
mLooper->pollAll(kTimeoutMsecs); mLooper->pollAll(kTimeoutMsecs);
} }