diff options
3 files changed, 12 insertions, 5 deletions
diff --git a/src/com/android/settings/DateTimeSettings.java b/src/com/android/settings/DateTimeSettings.java index 65a34f420..b7bbc6705 100644 --- a/src/com/android/settings/DateTimeSettings.java +++ b/src/com/android/settings/DateTimeSettings.java @@ -119,6 +119,10 @@ public class DateTimeSettings extends SettingsPreferenceFragment if (currentFormat == null) { currentFormat = ""; } + + // Prevents duplicated values on date format selector. + mDummyDate.set(mDummyDate.get(Calendar.YEAR), mDummyDate.DECEMBER, 31, 13, 0, 0); + for (int i = 0; i < formattedDates.length; i++) { String formatted = DateFormat.getDateFormatForSetting(getActivity(), dateFormats[i]) 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; } |