Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9be30772 authored by Fan Zhang's avatar Fan Zhang Committed by android-build-merger
Browse files

Merge "Gracefully handle the case where private volume may be unmountable" into qt-dev

am: 6dd38b46

Change-Id: I4354f0a2482891e95e89c6a15bd44b8633849dfd
parents 1e5d1ba5 6dd38b46
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -150,8 +150,6 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index

        mInternalCategory.addPreference(mInternalSummary);

        int privateCount = 0;

        final StorageManagerVolumeProvider smvp = new StorageManagerVolumeProvider(mStorageManager);
        final PrivateStorageInfo info = PrivateStorageInfo.getPrivateStorageInfo(smvp);
        final long privateTotalBytes = info.totalBytes;
@@ -162,10 +160,16 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index

        for (VolumeInfo vol : volumes) {
            if (vol.getType() == VolumeInfo.TYPE_PRIVATE) {

                if (vol.getState() == VolumeInfo.STATE_UNMOUNTABLE) {
                    mInternalCategory.addPreference(
                            new StorageVolumePreference(context, vol, 0));
                } else {
                    final long volumeTotalBytes = PrivateStorageInfo.getTotalSize(vol,
                            sTotalInternalStorage);
                    mInternalCategory.addPreference(
                            new StorageVolumePreference(context, vol, volumeTotalBytes));
                }
            } else if (vol.getType() == VolumeInfo.TYPE_PUBLIC
                    || vol.getType() == VolumeInfo.TYPE_STUB) {
                mExternalCategory.addPreference(