Merge "Fix issue #17323751: Additional items in aggregated battery stats" into lmp-mr1-dev

This commit is contained in:
Dianne Hackborn
2014-12-05 22:54:07 +00:00
committed by Android (Google) Code Review

View File

@@ -1544,6 +1544,17 @@ public class ConnectivityService extends IConnectivityManager.Stub
} }
final long ident = Binder.clearCallingIdentity(); 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 { try {
mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL); mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
} finally { } finally {