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

Commit 4740cb69 authored by Jing Ji's avatar Jing Ji Committed by Android (Google) Code Review
Browse files

Merge "Force a battery tracker update on dumping proto request" into tm-dev

parents 53cd2485 2eacc393
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -839,6 +839,8 @@ final class AppBatteryTracker extends BaseAppStateTracker<AppBatteryPolicy>


    @Override
    @Override
    void dumpAsProto(ProtoOutputStream proto, int uid) {
    void dumpAsProto(ProtoOutputStream proto, int uid) {
        // Force an update.
        updateBatteryUsageStatsIfNecessary(mInjector.currentTimeMillis(), true);
        synchronized (mLock) {
        synchronized (mLock) {
            final SparseArray<ImmutableBatteryUsage> uidConsumers = mUidBatteryUsageInWindow;
            final SparseArray<ImmutableBatteryUsage> uidConsumers = mUidBatteryUsageInWindow;
            if (uid != android.os.Process.INVALID_UID) {
            if (uid != android.os.Process.INVALID_UID) {