Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4835023e authored by Jing Ji's avatar Jing Ji
Browse files

Don't hold the battery stats lock while waiting for completion

Bug: 169013495
Test: Manual

Change-Id: I40b53e5c22eba7e635febdf5b5fc4370c93fdf1d
parent a28729b6
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -276,7 +276,6 @@ public final class BatteryStatsService extends IBatteryStats.Stub
    }

    private void awaitCompletion() {
        synchronized (mLock) {
        final CountDownLatch latch = new CountDownLatch(1);
        mHandler.post(() -> {
            latch.countDown();
@@ -286,7 +285,6 @@ public final class BatteryStatsService extends IBatteryStats.Stub
        } catch (InterruptedException e) {
        }
    }
    }

    /**
     * At the time when the constructor runs, the power manager has not yet been