From ce37ef51aa72dc84f84a169d118d3e88de00a9c6 Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Mon, 29 Aug 2016 14:28:56 -0700 Subject: [PATCH] Only display System section for current user. Otherwise it will be displayed twice on work profiles. Change-Id: Ic7d21a57f72b9f4a254d574adce90afd7cd27b90 Test: manual verification Fixes: 31108318 --- .../settings/deviceinfo/PrivateVolumeSettings.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java b/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java index 2a84a93c01b..94b19372406 100644 --- a/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java +++ b/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java @@ -300,9 +300,15 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment { } private void addItem(PreferenceGroup group, int titleRes, CharSequence title, int userId) { - if (titleRes == R.string.storage_detail_system && mSystemSize <= 0) { - Log.w(TAG, "Skipping System storage because its size is " + mSystemSize); - return; + if (titleRes == R.string.storage_detail_system) { + if (mSystemSize <= 0) { + Log.w(TAG, "Skipping System storage because its size is " + mSystemSize); + return; + } + if (userId != UserHandle.myUserId()) { + // Only display system on current user. + return; + } } StorageItemPreference item; if (mItemPoolIndex < mItemPreferencePool.size()) {