Merge "Update Rail Data Collection Frequency" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
25b06f04d4
@@ -609,9 +609,7 @@ public class BatteryStatsImpl extends BatteryStats {
|
|||||||
int UPDATE_RADIO = 0x04;
|
int UPDATE_RADIO = 0x04;
|
||||||
int UPDATE_BT = 0x08;
|
int UPDATE_BT = 0x08;
|
||||||
int UPDATE_RPM = 0x10; // 16
|
int UPDATE_RPM = 0x10; // 16
|
||||||
int UPDATE_RAIL = 0x20; // 32
|
int UPDATE_ALL = UPDATE_CPU | UPDATE_WIFI | UPDATE_RADIO | UPDATE_BT | UPDATE_RPM;
|
||||||
int UPDATE_ALL = UPDATE_CPU | UPDATE_WIFI | UPDATE_RADIO | UPDATE_BT | UPDATE_RPM
|
|
||||||
| UPDATE_RAIL;
|
|
||||||
|
|
||||||
Future<?> scheduleSync(String reason, int flags);
|
Future<?> scheduleSync(String reason, int flags);
|
||||||
Future<?> scheduleCpuSyncDueToRemovedUid(int uid);
|
Future<?> scheduleCpuSyncDueToRemovedUid(int uid);
|
||||||
|
|||||||
@@ -407,6 +407,7 @@ class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStatsSync {
|
|||||||
SynchronousResultReceiver wifiReceiver = null;
|
SynchronousResultReceiver wifiReceiver = null;
|
||||||
SynchronousResultReceiver bluetoothReceiver = null;
|
SynchronousResultReceiver bluetoothReceiver = null;
|
||||||
SynchronousResultReceiver modemReceiver = null;
|
SynchronousResultReceiver modemReceiver = null;
|
||||||
|
boolean railUpdated = false;
|
||||||
|
|
||||||
if ((updateFlags & BatteryStatsImpl.ExternalStatsSync.UPDATE_WIFI) != 0) {
|
if ((updateFlags & BatteryStatsImpl.ExternalStatsSync.UPDATE_WIFI) != 0) {
|
||||||
// We were asked to fetch WiFi data.
|
// We were asked to fetch WiFi data.
|
||||||
@@ -426,6 +427,10 @@ class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStatsSync {
|
|||||||
// Oh well.
|
// Oh well.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
synchronized (mStats) {
|
||||||
|
mStats.updateRailStatsLocked();
|
||||||
|
}
|
||||||
|
railUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((updateFlags & BatteryStatsImpl.ExternalStatsSync.UPDATE_BT) != 0) {
|
if ((updateFlags & BatteryStatsImpl.ExternalStatsSync.UPDATE_BT) != 0) {
|
||||||
@@ -447,6 +452,11 @@ class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStatsSync {
|
|||||||
modemReceiver = new SynchronousResultReceiver("telephony");
|
modemReceiver = new SynchronousResultReceiver("telephony");
|
||||||
mTelephony.requestModemActivityInfo(modemReceiver);
|
mTelephony.requestModemActivityInfo(modemReceiver);
|
||||||
}
|
}
|
||||||
|
if (!railUpdated) {
|
||||||
|
synchronized (mStats) {
|
||||||
|
mStats.updateRailStatsLocked();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final WifiActivityEnergyInfo wifiInfo = awaitControllerInfo(wifiReceiver);
|
final WifiActivityEnergyInfo wifiInfo = awaitControllerInfo(wifiReceiver);
|
||||||
@@ -477,10 +487,6 @@ class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStatsSync {
|
|||||||
mStats.updateRpmStatsLocked();
|
mStats.updateRpmStatsLocked();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((updateFlags & UPDATE_RAIL) != 0) {
|
|
||||||
mStats.updateRailStatsLocked();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bluetoothInfo != null) {
|
if (bluetoothInfo != null) {
|
||||||
if (bluetoothInfo.isValid()) {
|
if (bluetoothInfo.isValid()) {
|
||||||
mStats.updateBluetoothStateLocked(bluetoothInfo);
|
mStats.updateBluetoothStateLocked(bluetoothInfo);
|
||||||
|
|||||||
Reference in New Issue
Block a user