Merge "BatteryStats: Remove too-verbose logging" into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
09612f9435
@@ -1021,32 +1021,24 @@ public final class BatteryStatsService extends IBatteryStats.Stub
|
|||||||
mHandler.post(new Runnable() {
|
mHandler.post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Slog.d(TAG, "begin setBatteryStateLocked");
|
synchronized (mStats) {
|
||||||
try {
|
final boolean onBattery = plugType == BatteryStatsImpl.BATTERY_PLUGGED_NONE;
|
||||||
synchronized (mStats) {
|
if (mStats.isOnBattery() == onBattery) {
|
||||||
final boolean onBattery = plugType == BatteryStatsImpl.BATTERY_PLUGGED_NONE;
|
// The battery state has not changed, so we don't need to sync external
|
||||||
if (mStats.isOnBattery() == onBattery) {
|
// stats immediately.
|
||||||
// The battery state has not changed, so we don't need to sync external
|
mStats.setBatteryStateLocked(status, health, plugType, level, temp, volt,
|
||||||
// stats immediately.
|
chargeUAh, chargeFullUAh);
|
||||||
mStats.setBatteryStateLocked(status, health, plugType, level, temp,
|
return;
|
||||||
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
|
// 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.
|
// immediately here, we may not collect the relevant data later.
|
||||||
updateExternalStatsSync("battery-state", BatteryStatsImpl.ExternalStatsSync.UPDATE_ALL);
|
updateExternalStatsSync("battery-state", BatteryStatsImpl.ExternalStatsSync.UPDATE_ALL);
|
||||||
Slog.d(TAG, "begin setBatteryStateLocked");
|
|
||||||
synchronized (mStats) {
|
synchronized (mStats) {
|
||||||
mStats.setBatteryStateLocked(status, health, plugType, level, temp, volt,
|
mStats.setBatteryStateLocked(status, health, plugType, level, temp, volt,
|
||||||
chargeUAh, chargeFullUAh);
|
chargeUAh, chargeFullUAh);
|
||||||
}
|
}
|
||||||
Slog.d(TAG, "end setBatteryStateLocked");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user