summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/DataUsageSummary.java
diff options
context:
space:
mode:
authorZoltan Szatmary-Ban <szatmz@google.com>2014-12-12 18:48:03 +0000
committerZoltan Szatmary-Ban <szatmz@google.com>2015-01-19 10:53:45 +0000
commit77c1d36de587fe304c7c8abb5ca607fdc0c6cf93 (patch)
tree62be2bc2a4ff55b2a388941cd5383155547331b2 /src/com/android/settings/DataUsageSummary.java
parent906fc4172466e7ddd0886fa51b308ce4e69c266a (diff)
downloadpackages_apps_Settings-77c1d36de587fe304c7c8abb5ca607fdc0c6cf93.zip
packages_apps_Settings-77c1d36de587fe304c7c8abb5ca607fdc0c6cf93.tar.gz
packages_apps_Settings-77c1d36de587fe304c7c8abb5ca607fdc0c6cf93.tar.bz2
Show removed user's data usage under its correct item
Users for which UserManager.getUserInfo returned null were shown as unnamed users on Settings > Data Usage. This behavior has now changed to show their data usage under the same item as UID_REMOVED. Bug: 18174376 Change-Id: I8d172647edb51f7a277b4b714e9b7f3a0b5f3154 (cherry picked from commit cd9b1507fbb6d9f443a4fb1bb8d9d58073c7e5d0)
Diffstat (limited to 'src/com/android/settings/DataUsageSummary.java')
-rw-r--r--src/com/android/settings/DataUsageSummary.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/com/android/settings/DataUsageSummary.java b/src/com/android/settings/DataUsageSummary.java
index 6de7399..473b6db 100644
--- a/src/com/android/settings/DataUsageSummary.java
+++ b/src/com/android/settings/DataUsageSummary.java
@@ -62,6 +62,7 @@ import android.content.Intent;
import android.content.Loader;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
+import android.content.pm.UserInfo;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Color;
@@ -141,6 +142,7 @@ import com.android.settings.sim.SimSettings;
import com.android.settings.widget.ChartDataUsageView;
import com.android.settings.widget.ChartDataUsageView.DataUsageChartListener;
import com.android.settings.widget.ChartNetworkSeriesView;
+
import com.google.android.collect.Lists;
import libcore.util.Objects;
@@ -1695,9 +1697,16 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
collapseKey = uid;
category = AppItem.CATEGORY_APP;
} else {
- // Add to other user item.
- collapseKey = UidDetailProvider.buildKeyForUser(userId);
- category = AppItem.CATEGORY_USER;
+ // If it is a removed user add it to the removed users' key
+ final UserInfo info = mUm.getUserInfo(userId);
+ if (info == null) {
+ collapseKey = UID_REMOVED;
+ category = AppItem.CATEGORY_APP;
+ } else {
+ // Add to other user item.
+ collapseKey = UidDetailProvider.buildKeyForUser(userId);
+ category = AppItem.CATEGORY_USER;
+ }
}
} else if (uid == UID_REMOVED || uid == UID_TETHERING) {
collapseKey = uid;