diff --git a/app/src/main/java/io/github/muntashirakon/AppManager/details/info/AppInfoViewModel.java b/app/src/main/java/io/github/muntashirakon/AppManager/details/info/AppInfoViewModel.java index 363e47af3b3..330934a0a35 100644 --- a/app/src/main/java/io/github/muntashirakon/AppManager/details/info/AppInfoViewModel.java +++ b/app/src/main/java/io/github/muntashirakon/AppManager/details/info/AppInfoViewModel.java @@ -357,10 +357,13 @@ private void loadAppInfoInternal(@NonNull PackageInfo packageInfo, boolean isExt boolean hasUsageAccess = FeatureController.isUsageAccessEnabled() && SelfPermissions.checkUsageStatsPermission(); if (hasUsageAccess) { // Net statistics - if (ArrayUtils.contains(packageInfo.requestedPermissions, Manifest.permission.INTERNET)) { - appInfo.dataUsage = AppUsageStatsManager.getDataUsageForPackage(getApplication(), - applicationInfo.uid, UsageUtils.USAGE_LAST_BOOT); - } else appInfo.dataUsage = null; + AppUsageStatsManager.DataUsage dataUsage; + dataUsage = AppUsageStatsManager.getDataUsageForPackage(getApplication(), + applicationInfo.uid, UsageUtils.USAGE_LAST_BOOT); + if (dataUsage.getTotal() == 0 && !ArrayUtils.contains( + packageInfo.requestedPermissions, Manifest.permission.INTERNET)) { + appInfo.dataUsage = null; + } else appInfo.dataUsage = dataUsage; // Set sizes appInfo.sizeInfo = PackageUtils.getPackageSizeInfo(getApplication(), packageName, userId, Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ? applicationInfo.storageUuid : null);