StorageVolumePreferenceCategory: fix the crash problem when click Settings/Storage

This problem is because of the inconsistency between StorageMeasurement.java and StorageVolumePreferenceCategory.java.

StorageMeasurement.java  will get the size of the details when there is an emulated storage in the internal volume,
but StorageVolumePreferenceCategory.java will show the details of the volume when it's the internal volume
even there is no emulated storage.

Also take this opportunity to thanks Vishal Bhoj for the origen board gave me in LCA-13,
This problem was found and fixed when tried to use the origen board.

Change-Id: I91be425e59e573821f538dd9129e74df9acb09f8
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
diff --git a/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java b/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java
index 61188ec..68b3a1d 100644
--- a/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java
+++ b/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java
@@ -165,7 +165,7 @@
 
         mItemCache.setKey(KEY_CACHE);
 
-        final boolean showDetails = mVolume == null || mVolume.isPrimary();
+        final boolean showDetails =  ((mVolume == null) && Environment.isExternalStorageEmulated()) || ((mVolume != null) &&mVolume.isPrimary());
         if (showDetails) {
             if (showUsers) {
                 addPreference(new PreferenceHeader(context, currentUser.name));
@@ -319,7 +319,7 @@
     }
 
     public void updateDetails(MeasurementDetails details) {
-        final boolean showDetails = mVolume == null || mVolume.isPrimary();
+        final boolean showDetails =  ((mVolume == null) && Environment.isExternalStorageEmulated()) || ((mVolume != null) &&mVolume.isPrimary());
         if (!showDetails) return;
 
         // Count caches as available space, since system manages them