summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZoltan Szatmary-Ban <szatmz@google.com>2015-01-23 10:57:13 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-01-23 10:57:14 +0000
commit387597a2560826a22dc18cc78ffaed75f9672ff2 (patch)
tree85edb5999c93ef1ffa3775a55a33fbba7adaddb0
parent5f1eb2d72a1a7dfb42398176c24445a906cd380c (diff)
parent77c1d36de587fe304c7c8abb5ca607fdc0c6cf93 (diff)
downloadpackages_apps_Settings-387597a2560826a22dc18cc78ffaed75f9672ff2.zip
packages_apps_Settings-387597a2560826a22dc18cc78ffaed75f9672ff2.tar.gz
packages_apps_Settings-387597a2560826a22dc18cc78ffaed75f9672ff2.tar.bz2
Merge "Show removed user's data usage under its correct item" into lmp-mr1-dev
-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 8ca62fb..f2a2257 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;
@@ -1701,9 +1703,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;