Don't shows Files when storage is adopted.

One regression from the previous storage view is that the
Files category should not show at all when the storage is adopted.

Fixes: 36786953
Test: Settings robotest

Change-Id: Ice365fabc3bfa66f4c5526ac78bbbfc5e15b7b35
This commit is contained in:
Daniel Nishi
2017-04-04 10:29:59 -07:00
parent cba520fc9d
commit 1f079fbae4
2 changed files with 96 additions and 1 deletions

View File

@@ -214,6 +214,15 @@ public class StorageItemPreferenceController extends PreferenceController {
mAppPreference = (StorageItemPreference) screen.findPreference(OTHER_APPS_KEY);
mSystemPreference = (StorageItemPreference) screen.findPreference(SYSTEM_KEY);
mFilePreference = (StorageItemPreference) screen.findPreference(FILES_KEY);
final VolumeInfo sharedVolume = mSvp.findEmulatedForPrivate(mVolume);
// If we don't have a shared volume for our internal storage (or the shared volume isn't
// mounted as readable for whatever reason), we should hide the File preference.
final boolean hideFilePreference =
(sharedVolume == null) || !sharedVolume.isMountedReadable();
if (hideFilePreference) {
screen.removePreference(mFilePreference);
}
}
public void onLoadFinished(StorageAsyncLoader.AppsStorageResult data) {