diff options
Diffstat (limited to 'src/com/android/settings/deviceinfo')
-rw-r--r-- | src/com/android/settings/deviceinfo/StorageMeasurement.java | 2 | ||||
-rw-r--r-- | src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/com/android/settings/deviceinfo/StorageMeasurement.java b/src/com/android/settings/deviceinfo/StorageMeasurement.java index 772ac0dfd..a22ba77ad 100644 --- a/src/com/android/settings/deviceinfo/StorageMeasurement.java +++ b/src/com/android/settings/deviceinfo/StorageMeasurement.java @@ -422,7 +422,7 @@ public class StorageMeasurement { } // Measure misc files not counted under media - if (mIsInternal || mIsPrimary) { + if (measureMedia) { final File path = mIsInternal ? currentEnv.getExternalStorageDirectory() : mVolume.getPathFile(); details.miscSize = measureMisc(imcs, path); diff --git a/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java b/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java index 1599ec7e9..61188ec1c 100644 --- a/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java +++ b/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java @@ -194,8 +194,9 @@ public class StorageVolumePreferenceCategory extends PreferenceCategory { } final boolean isRemovable = mVolume != null ? mVolume.isRemovable() : false; + // Always create the preference since many code rely on it existing + mMountTogglePreference = new Preference(context); if (isRemovable) { - mMountTogglePreference = new Preference(context); mMountTogglePreference.setTitle(R.string.sd_eject); mMountTogglePreference.setSummary(R.string.sd_eject_summary); addPreference(mMountTogglePreference); @@ -240,12 +241,12 @@ public class StorageVolumePreferenceCategory extends PreferenceCategory { final String state = mStorageManager.getVolumeState(mVolume.getPath()); if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) { - mItemAvailable.setSummary(R.string.memory_available_read_only); + mItemAvailable.setTitle(R.string.memory_available_read_only); if (mFormatPreference != null) { removePreference(mFormatPreference); } } else { - mItemAvailable.setSummary(R.string.memory_available); + mItemAvailable.setTitle(R.string.memory_available); } if (Environment.MEDIA_MOUNTED.equals(state) @@ -310,7 +311,9 @@ public class StorageVolumePreferenceCategory extends PreferenceCategory { private static long totalValues(HashMap<String, Long> map, String... keys) { long total = 0; for (String key : keys) { - total += map.get(key); + if (map.containsKey(key)) { + total += map.get(key); + } } return total; } |