Merge "Don't hold the battery stats lock while waiting for completion"
This commit is contained in:
@@ -276,15 +276,13 @@ public final class BatteryStatsService extends IBatteryStats.Stub
|
||||
}
|
||||
|
||||
private void awaitCompletion() {
|
||||
synchronized (mLock) {
|
||||
final CountDownLatch latch = new CountDownLatch(1);
|
||||
mHandler.post(() -> {
|
||||
latch.countDown();
|
||||
});
|
||||
try {
|
||||
latch.await();
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
final CountDownLatch latch = new CountDownLatch(1);
|
||||
mHandler.post(() -> {
|
||||
latch.countDown();
|
||||
});
|
||||
try {
|
||||
latch.await();
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user