Fix issue #17323751: Additional items in aggregated battery stats

- Now aggregate number of times each process has crashed and ANRed.
- Now aggregate total number of connectivity changes.
- Now record connectivity changes in the history.

Crash and ANR counts are new entries at the end of "pr" in checkin.

Connectivity change counts is a new entry at the end of "m" in checkin.

Connectivity changes in the history checkin are Ecn and include the
type of connection and its state.

Change-Id: I0c01186446034cf6c3fb97d45f5e3b5c69a0438a
This commit is contained in:
Dianne Hackborn
2014-12-04 17:46:42 -08:00
parent 1f4d121b74
commit 37e2d0e068

View File

@@ -1524,6 +1524,17 @@ public class ConnectivityService extends IConnectivityManager.Stub
}
final long ident = Binder.clearCallingIdentity();
if (ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction())) {
final IBatteryStats bs = BatteryStatsService.getService();
try {
NetworkInfo ni = intent.getParcelableExtra(
ConnectivityManager.EXTRA_NETWORK_INFO);
bs.noteConnectivityChanged(intent.getIntExtra(
ConnectivityManager.EXTRA_NETWORK_TYPE, ConnectivityManager.TYPE_NONE),
ni != null ? ni.getState().toString() : "?");
} catch (RemoteException e) {
}
}
try {
mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
} finally {