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

Commit 2eacc393 authored by Jing Ji's avatar Jing Ji
Browse files

Force a battery tracker update on dumping proto request

There is an internal throttling but it shouldn't be applicable to
the dump request.

Bug: 203105544
Test: dumpsys activity app-restrictions --proto
Change-Id: Iff718224f08df1b63f7f90c210faf3e01bbee1e3
parent b6da699d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -839,6 +839,8 @@ final class AppBatteryTracker extends BaseAppStateTracker<AppBatteryPolicy>

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