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

Commit 09612f94 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "BatteryStats: Remove too-verbose logging" into oc-dev

parents 05b8b413 63934521
Loading
Loading
Loading
Loading
+8 −16
Original line number Diff line number Diff line
@@ -1021,32 +1021,24 @@ public final class BatteryStatsService extends IBatteryStats.Stub
        mHandler.post(new Runnable() {
            @Override
            public void run() {
                Slog.d(TAG, "begin setBatteryStateLocked");
                try {
                synchronized (mStats) {
                    final boolean onBattery = plugType == BatteryStatsImpl.BATTERY_PLUGGED_NONE;
                    if (mStats.isOnBattery() == onBattery) {
                        // The battery state has not changed, so we don't need to sync external
                        // stats immediately.
                            mStats.setBatteryStateLocked(status, health, plugType, level, temp,
                                    volt,
                        mStats.setBatteryStateLocked(status, health, plugType, level, temp, volt,
                                chargeUAh, chargeFullUAh);
                        return;
                    }
                }
                } finally {
                    Slog.d(TAG, "end setBatteryStateLocked");
                }

                // Sync external stats first as the battery has changed states. If we don't sync
                // immediately here, we may not collect the relevant data later.
                updateExternalStatsSync("battery-state", BatteryStatsImpl.ExternalStatsSync.UPDATE_ALL);
                Slog.d(TAG, "begin setBatteryStateLocked");
                synchronized (mStats) {
                    mStats.setBatteryStateLocked(status, health, plugType, level, temp, volt,
                            chargeUAh, chargeFullUAh);
                }
                Slog.d(TAG, "end setBatteryStateLocked");
            }
        });
    }