diff options
author | Jason Monk <jmonk@google.com> | 2015-05-08 11:24:03 -0400 |
---|---|---|
committer | Jason Monk <jmonk@google.com> | 2015-05-08 11:24:03 -0400 |
commit | 10e1a94ef7bf7034e0e9bebe471c868abb3825a9 (patch) | |
tree | 00f4af9b440c2a00407e5d22ab263418faaee3f7 /src | |
parent | 59de14e2197e84baf663fa700ee7b2323fbaef6b (diff) | |
download | packages_apps_Settings-10e1a94ef7bf7034e0e9bebe471c868abb3825a9.zip packages_apps_Settings-10e1a94ef7bf7034e0e9bebe471c868abb3825a9.tar.gz packages_apps_Settings-10e1a94ef7bf7034e0e9bebe471c868abb3825a9.tar.bz2 |
Choose correct network template for data history
Bug: 19921796
Change-Id: I90376ed0314c47fcbee21c81b85f60d3cc3312a6
Diffstat (limited to 'src')
-rwxr-xr-x | src/com/android/settings/applications/InstalledAppDetails.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java index a6fee90..73e7b8d 100755 --- a/src/com/android/settings/applications/InstalledAppDetails.java +++ b/src/com/android/settings/applications/InstalledAppDetails.java @@ -246,7 +246,7 @@ public class InstalledAppDetails extends AppInfoBase AppItem app = new AppItem(mAppEntry.info.uid); app.addUid(mAppEntry.info.uid); getLoaderManager().restartLoader(LOADER_CHART_DATA, - ChartDataLoader.buildArgs(NetworkTemplate.buildTemplateMobileWildcard(), app), + ChartDataLoader.buildArgs(getTemplate(getContext()), app), mDataCallbacks); new BatteryUpdater().execute(); } @@ -698,6 +698,16 @@ public class InstalledAppDetails extends AppInfoBase return true; } + private static NetworkTemplate getTemplate(Context context) { + if (DataUsageSummary.hasReadyMobileRadio(context)) { + return NetworkTemplate.buildTemplateMobileWildcard(); + } + if (DataUsageSummary.hasWifiRadio(context)) { + return NetworkTemplate.buildTemplateWifiWildcard(); + } + return NetworkTemplate.buildTemplateEthernet(); + } + public static CharSequence getNotificationSummary(AppEntry appEntry, Context context) { return getNotificationSummary(appEntry, context, new NotificationBackend()); } |