diff options
author | Tony Mantler <nicoya@google.com> | 2015-05-05 17:59:00 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-05 17:59:01 +0000 |
commit | def4c0c49aeebccbb42d9b82901a7de81782baad (patch) | |
tree | b43313987143473de5c1a12df932ee56577cbe7b /packages | |
parent | 102badf834256e209e1a5f58fde1d67b8fd5ac0b (diff) | |
parent | ca2954830c017c49523d5e2c7cb5916c76a52375 (diff) | |
download | frameworks_base-def4c0c49aeebccbb42d9b82901a7de81782baad.zip frameworks_base-def4c0c49aeebccbb42d9b82901a7de81782baad.tar.gz frameworks_base-def4c0c49aeebccbb42d9b82901a7de81782baad.tar.bz2 |
Merge "Don't crash in StorageMeasurement if volume isn't mounted" into mnc-dev
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/deviceinfo/StorageMeasurement.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/deviceinfo/StorageMeasurement.java b/packages/SettingsLib/src/com/android/settingslib/deviceinfo/StorageMeasurement.java index 1cf7248..c81f22a 100644 --- a/packages/SettingsLib/src/com/android/settingslib/deviceinfo/StorageMeasurement.java +++ b/packages/SettingsLib/src/com/android/settingslib/deviceinfo/StorageMeasurement.java @@ -32,7 +32,6 @@ import android.os.HandlerThread; import android.os.IBinder; import android.os.Looper; import android.os.Message; -import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; import android.os.storage.StorageVolume; @@ -349,6 +348,11 @@ public class StorageMeasurement { final Message finished = mMeasurementHandler.obtainMessage(MeasurementHandler.MSG_COMPLETED, details); + if (mVolume == null || !mVolume.isMountedReadable()) { + finished.sendToTarget(); + return; + } + if (mSharedVolume != null && mSharedVolume.isMountedReadable()) { final File basePath = mSharedVolume.getPathForUser(currentUser); @@ -375,8 +379,10 @@ public class StorageMeasurement { } final File file = mVolume.getPath(); - details.totalSize = file.getTotalSpace(); - details.availSize = file.getFreeSpace(); + if (file != null) { + details.totalSize = file.getTotalSpace(); + details.availSize = file.getFreeSpace(); + } // Measure all apps hosted on this volume for all users if (mVolume.getType() == VolumeInfo.TYPE_PRIVATE) { |