summaryrefslogtreecommitdiff
path: root/services/usage/java
diff options
context:
space:
mode:
Diffstat (limited to 'services/usage/java')
-rw-r--r--services/usage/java/com/android/server/usage/StorageStatsService.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/services/usage/java/com/android/server/usage/StorageStatsService.java b/services/usage/java/com/android/server/usage/StorageStatsService.java
index 3f39e4f3cf4b..5ad7f8042c01 100644
--- a/services/usage/java/com/android/server/usage/StorageStatsService.java
+++ b/services/usage/java/com/android/server/usage/StorageStatsService.java
@@ -162,6 +162,9 @@ public class StorageStatsService extends IStorageStatsManager.Stub {
return FileUtils.roundStorageSize(mStorage.getPrimaryStorageSize());
} else {
final VolumeInfo vol = mStorage.findVolumeByUuid(volumeUuid);
+ if (vol == null) {
+ throw new IllegalStateException("Volume was unexpected null");
+ }
return FileUtils.roundStorageSize(vol.disk.size);
}
}
@@ -185,6 +188,9 @@ public class StorageStatsService extends IStorageStatsManager.Stub {
return Environment.getDataDirectory().getUsableSpace() + cacheBytes;
} else {
final VolumeInfo vol = mStorage.findVolumeByUuid(volumeUuid);
+ if (vol == null) {
+ throw new IllegalStateException("Volume was unexpected null");
+ }
return vol.getPath().getUsableSpace() + cacheBytes;
}
}