From 37e2d0e06877d4aa2c2df820142aac0072397f26 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Thu, 4 Dec 2014 17:46:42 -0800 Subject: [PATCH] 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 --- .../java/com/android/server/ConnectivityService.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 0f1ed0af9f..d5e4d23e09 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -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 {