Only display System section for current user.

Otherwise it will be displayed twice on work profiles.

Change-Id: Ic7d21a57f72b9f4a254d574adce90afd7cd27b90
Test: manual verification
Fixes: 31108318
This commit is contained in:
Felipe Leme
2016-08-29 14:28:56 -07:00
parent eed4d98eca
commit ce37ef51aa

View File

@@ -300,10 +300,16 @@ 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) {
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()) {
item = mItemPreferencePool.get(mItemPoolIndex);