Fix crash when go to Data usage->Cellular data usage->Removed apps and
users. Ensure that the user info is not null before using it to retrieve user icon and label. If the user info is null, use the default label. Change-Id: If402844d472a15f04c812f20c1c761b3a189a638 Fixes: 29619032
This commit is contained in:
@@ -215,9 +215,12 @@ public class AppDataUsage extends DataUsageBase implements Preference.OnPreferen
|
||||
final int userId = UidDetailProvider.getUserIdForKey(mAppItem.key);
|
||||
final UserManager um = UserManager.get(getActivity());
|
||||
final UserInfo info = um.getUserInfo(userId);
|
||||
final PackageManager pm = getPackageManager();
|
||||
mIcon = Utils.getUserIcon(getActivity(), um, info);
|
||||
mLabel = Utils.getUserLabel(getActivity(), info);
|
||||
if (info != null) {
|
||||
mIcon = Utils.getUserIcon(getActivity(), um, info);
|
||||
mLabel = Utils.getUserLabel(getActivity(), info);
|
||||
} else {
|
||||
mLabel = getContext().getString(R.string.data_usage_uninstalled_apps_users);
|
||||
}
|
||||
mPackageName = getActivity().getPackageName();
|
||||
}
|
||||
removePreference(KEY_UNRESTRICTED_DATA);
|
||||
|
Reference in New Issue
Block a user