Commit fa06c5b0 authored by Vasyl Gello's avatar Vasyl Gello Committed by Michael W

Return WiFi data usage for WiFi-only devices

Fixes "0B of data used" in "Data Usage" summary highlight
in Settings if Telephony is not present or turned off.
Reported-By: default avatarL.W Reek <>
Refactored-By: default avatarMichael W <>
Signed-off-by: default avatarVasyl Gello <>

Change-Id: I9623054c2e6e70060e65e93b18a11e8fb281d5d7
parent b98c5a95
......@@ -38,6 +38,7 @@ import java.util.Date;
import java.util.Locale;
import static;
import static;
import static;
import static;
import static android.telephony.TelephonyManager.SIM_STATE_READY;
......@@ -114,7 +115,24 @@ public class DataUsageController {
return rt;
* Test if device has a Wi-Fi data radio.
private boolean isWiFiSupported() {
return mConnectivityManager.isNetworkSupported(TYPE_WIFI);
public DataUsageInfo getDataUsageInfo() {
if (isMobileDataSupported()) {
return getMobileDataUsageInfo();
} else if (isWiFiSupported()) {
return getWifiDataUsageInfo();
return warn("neither mobile data nor wifi data supported");
public DataUsageInfo getMobileDataUsageInfo() {
final String subscriberId = getActiveSubscriberId(mContext);
if (subscriberId == null) {
return warn("no subscriber id");
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment