diff options
author | Tony Mantler <nicoya@google.com> | 2015-04-23 15:19:00 -0700 |
---|---|---|
committer | Tony Mantler <nicoya@google.com> | 2015-04-23 15:45:00 -0700 |
commit | 9496a2da0500934353abb6042fab6661eb49555a (patch) | |
tree | c5b6afdab3c771ea1f97b376bdcee0b1f4d2bd0d /packages/SettingsLib | |
parent | 547e4caebe0aac21d0856de96e121b8bf63fd9bd (diff) | |
download | frameworks_base-9496a2da0500934353abb6042fab6661eb49555a.zip frameworks_base-9496a2da0500934353abb6042fab6661eb49555a.tar.gz frameworks_base-9496a2da0500934353abb6042fab6661eb49555a.tar.bz2 |
Add totalSize and availSize queries to StorageMeasurement
Change-Id: I20f9d8546046df3804008ee4068c539549f35cb6
Diffstat (limited to 'packages/SettingsLib')
-rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/deviceinfo/StorageMeasurement.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/deviceinfo/StorageMeasurement.java b/packages/SettingsLib/src/com/android/settingslib/deviceinfo/StorageMeasurement.java index e0af29d..1cf7248 100644 --- a/packages/SettingsLib/src/com/android/settingslib/deviceinfo/StorageMeasurement.java +++ b/packages/SettingsLib/src/com/android/settingslib/deviceinfo/StorageMeasurement.java @@ -32,6 +32,7 @@ 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; @@ -76,6 +77,9 @@ public class StorageMeasurement { Environment.DIRECTORY_DOWNLOADS, Environment.DIRECTORY_ANDROID); public static class MeasurementDetails { + public long totalSize; + public long availSize; + /** * Total apps disk usage. * <p> @@ -121,7 +125,7 @@ public class StorageMeasurement { } public interface MeasurementReceiver { - public void onDetailsChanged(MeasurementDetails details); + void onDetailsChanged(MeasurementDetails details); } private WeakReference<MeasurementReceiver> mReceiver; @@ -370,6 +374,10 @@ public class StorageMeasurement { } } + final File file = mVolume.getPath(); + details.totalSize = file.getTotalSpace(); + details.availSize = file.getFreeSpace(); + // Measure all apps hosted on this volume for all users if (mVolume.getType() == VolumeInfo.TYPE_PRIVATE) { final List<ApplicationInfo> apps = packageManager.getInstalledApplications( |