From 3508963dcf6b8c481ff007ac4928485466990e2f Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Wed, 21 May 2014 15:01:03 -0700 Subject: [PATCH] (DO NOT MERGE) Battery monitoring fixes: - Improve monitoring of level changes to not be confused when it goes up while draining or down while charging. - Put back in connectivity service code to tell battery stats about the interfaces. - Turn back on reporting of mobile radio active state from the RIL. - Fix bug in marshalling/unmarshalling that would cause the UI to show bad data. Change-Id: I733ef52702894cca81a0813eccdfc1023e546fce --- .../java/com/android/server/ConnectivityService.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 0ad5ce269a..7ecf248291 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -5750,10 +5750,11 @@ public class ConnectivityService extends IConnectivityManager.Stub { // updateNetworkSettings(); } // notify battery stats service about this network -// try { - // TODO - //BatteryStatsService.getService().noteNetworkInterfaceType(iface, netType); -// } catch (RemoteException e) { } + try { + BatteryStatsService.getService().noteNetworkInterfaceType( + newNetwork.linkProperties.getInterfaceName(), + newNetwork.networkInfo.getType()); + } catch (RemoteException e) { } notifyNetworkCallbacks(newNetwork, ConnectivityManager.CALLBACK_AVAILABLE); } else { if (DBG && newNetwork.networkRequests.size() != 0) {