diff --git a/CHANGELOG.md b/CHANGELOG.md index d91003a4b..d7bc8d665 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,8 @@ Version 3.x will be available with a [pro license](http://www.xprivacy.eu/) only **Next release** +* Show application name above usage data ([issue](/../../issues/1949)) + [Open issues](https://github.com/M66B/XPrivacy/issues?state=open) **Version 3.0.3 BETA** diff --git a/src/biz/bokhorst/xprivacy/ActivityUsage.java b/src/biz/bokhorst/xprivacy/ActivityUsage.java index 6cdc8c5e1..59669a1f6 100644 --- a/src/biz/bokhorst/xprivacy/ActivityUsage.java +++ b/src/biz/bokhorst/xprivacy/ActivityUsage.java @@ -394,22 +394,25 @@ public View getView(int position, View convertView, ViewGroup parent) { // Helpers private void updateTitle() { - // Get statistics - long count = 0; - long restricted = 0; - double persec = 0; - try { - @SuppressWarnings("rawtypes") - Map statistics = PrivacyService.getClient().getStatistics(); - count = (Long) statistics.get("restriction_count"); - restricted = (Long) statistics.get("restriction_restricted"); - long uptime = (Long) statistics.get("uptime_milliseconds"); - persec = (double) count / (uptime / 1000); - } catch (Throwable ex) { - Util.bug(null, ex); - } + if (mUid == 0) { + // Get statistics + long count = 0; + long restricted = 0; + double persec = 0; + try { + @SuppressWarnings("rawtypes") + Map statistics = PrivacyService.getClient().getStatistics(); + count = (Long) statistics.get("restriction_count"); + restricted = (Long) statistics.get("restriction_restricted"); + long uptime = (Long) statistics.get("uptime_milliseconds"); + persec = (double) count / (uptime / 1000); + } catch (Throwable ex) { + Util.bug(null, ex); + } - // Set sub title - getActionBar().setSubtitle(String.format("%d/%d %.2f/s", restricted, count, persec)); + // Set sub title + getActionBar().setSubtitle(String.format("%d/%d %.2f/s", restricted, count, persec)); + } else + getActionBar().setSubtitle(TextUtils.join(", ", new ApplicationInfoEx(this, mUid).getApplicationName())); } }