am b7d94e74: am aeb57eda: Pass the locale code in the help url for help pages.

* commit 'b7d94e74e1342c5583883e596fd268745a5a25b6':
  Pass the locale code in the help url for help pages.
diff --git a/src/com/android/settings/DateTimeSettings.java b/src/com/android/settings/DateTimeSettings.java
index 65a34f4..b7bbc67 100644
--- a/src/com/android/settings/DateTimeSettings.java
+++ b/src/com/android/settings/DateTimeSettings.java
@@ -119,6 +119,10 @@
         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 772ac0d..a22ba77 100644
--- a/src/com/android/settings/deviceinfo/StorageMeasurement.java
+++ b/src/com/android/settings/deviceinfo/StorageMeasurement.java
@@ -422,7 +422,7 @@
             }
 
             // 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 1599ec7..61188ec 100644
--- a/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java
+++ b/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java
@@ -194,8 +194,9 @@
         }
 
         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 @@
         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 @@
     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;
     }