am b8555ea9: am 9e1ea4b1: Merge "Choose correct network template for data history" into mnc-dev

* commit 'b8555ea90afb2ff1271f9a1a396eeb7d54211e71':
  Choose correct network template for data history
This commit is contained in:
Jason Monk
2015-05-08 18:32:10 +00:00
committed by Android Git Automerger

View File

@@ -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);
if (mPackageInfo != null) {
new BatteryUpdater().execute();
@@ -700,6 +700,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());
}