Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e1ea4b1 authored by Jason Monk's avatar Jason Monk Committed by Android (Google) Code Review
Browse files

Merge "Choose correct network template for data history" into mnc-dev

parents 4d1efa0e 10e1a94e
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -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());
    }