summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2011-05-27 18:26:15 -0700
committerJeff Sharkey <jsharkey@android.com>2011-06-01 17:48:21 -0700
commit9302986035f46d2868c23db6349fd04b543eb676 (patch)
treec3aa2628ed309b0ca037edb526b2339704aa8be7
parent79e309a9b80096cc02bb80abd6408374a6193418 (diff)
downloadpackages_apps_settings-9302986035f46d2868c23db6349fd04b543eb676.zip
packages_apps_settings-9302986035f46d2868c23db6349fd04b543eb676.tar.gz
packages_apps_settings-9302986035f46d2868c23db6349fd04b543eb676.tar.bz2
Replace INetStatService with TrafficStats.
Change-Id: I679b67f9a51e7951b7c06c67dab4efa9f09297b9
-rw-r--r--src/com/android/settings/RadioInfo.java24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java
index ba07fb5..d45616e 100644
--- a/src/com/android/settings/RadioInfo.java
+++ b/src/com/android/settings/RadioInfo.java
@@ -24,11 +24,11 @@ import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.net.ConnectivityManager;
import android.net.LinkProperties;
+import android.net.TrafficStats;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
-import android.os.INetStatService;
import android.os.Message;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -133,7 +133,6 @@ public class RadioInfo extends Activity {
private TelephonyManager mTelephonyManager;
private Phone phone = null;
private PhoneStateIntentReceiver mPhoneStateReceiver;
- private INetStatService netstat;
private String mPingIpAddrResult;
private String mPingHostnameResult;
@@ -311,8 +310,6 @@ public class RadioInfo extends Activity {
phone.getNeighboringCids(
mHandler.obtainMessage(EVENT_QUERY_NEIGHBORING_CIDS_DONE));
- netstat = INetStatService.Stub.asInterface(ServiceManager.getService("netstat"));
-
CellLocation.requestLocationUpdate();
}
@@ -625,19 +622,16 @@ public class RadioInfo extends Activity {
private final void updateDataStats2() {
Resources r = getResources();
- try {
- long txPackets = netstat.getMobileTxPackets();
- long rxPackets = netstat.getMobileRxPackets();
- long txBytes = netstat.getMobileTxBytes();
- long rxBytes = netstat.getMobileRxBytes();
+ long txPackets = TrafficStats.getMobileTxPackets();
+ long rxPackets = TrafficStats.getMobileRxPackets();
+ long txBytes = TrafficStats.getMobileTxBytes();
+ long rxBytes = TrafficStats.getMobileRxBytes();
- String packets = r.getString(R.string.radioInfo_display_packets);
- String bytes = r.getString(R.string.radioInfo_display_bytes);
+ String packets = r.getString(R.string.radioInfo_display_packets);
+ String bytes = r.getString(R.string.radioInfo_display_bytes);
- sent.setText(txPackets + " " + packets + ", " + txBytes + " " + bytes);
- received.setText(rxPackets + " " + packets + ", " + rxBytes + " " + bytes);
- } catch (RemoteException e) {
- }
+ sent.setText(txPackets + " " + packets + ", " + txBytes + " " + bytes);
+ received.setText(rxPackets + " " + packets + ", " + rxBytes + " " + bytes);
}
/**