Display total storage for Internal shared storage.

Prior to this change, Settings was using
volume.getPath().getTotalBytes() to calculate the total, which includes
the user-accessible storage, but not the internal partitions. As such,
the total displayed was often missing many GBs (for example, in a 32GB
device, it could display "12.09GB of 25.01GB used".

This change fix this problem by using the total size and creating a
"System" section containing the "missing" storage.

BUG: 24128505

Change-Id: Ic35cd7c8406eff16ac1d97c4b4c233ecde64a6e1
This commit is contained in:
Felipe Leme
2016-05-11 13:58:41 -07:00
parent 41dffe632f
commit 9c7bb2775a
4 changed files with 81 additions and 15 deletions

View File

@@ -2558,6 +2558,8 @@
<string name="storage_detail_cached">Cached data</string>
<!-- Item title describing storage used by other data [CHAR LIMIT=48]-->
<string name="storage_detail_other">Other</string>
<!-- Item title describing internal storage used by the Android System [CHAR LIMIT=48]-->
<string name="storage_detail_system">System</string>
<!-- Item title that will launch a file explorer [CHAR LIMIT=48]-->
<string name="storage_detail_explore">Explore <xliff:g id="name" example="SD card">^1</xliff:g></string>
@@ -2565,6 +2567,10 @@
<string name="storage_detail_dialog_other">Other includes shared files saved by apps, files downloaded from the Internet or Bluetooth, Android files, and so on.
\n\nTo see the entire contents of this <xliff:g id="name" example="SD card">^1</xliff:g>, tap Explore.</string>
<!-- Body of dialog informing user about the storage used by the Android System [CHAR LIMIT=NONE]-->
<string name="storage_detail_dialog_system">System includes files used internally by the Android operating system.
\n\nThese files can\u2019t be viewed individually.</string>
<!-- Body of dialog informing user about other users on a storage device [CHAR LIMIT=NONE]-->
<string name="storage_detail_dialog_user"><xliff:g id="user" example="Guest user">^1</xliff:g> may have saved photos, music, movies, apps, or other data that is taking up <xliff:g id="size" example="1.2 GB">^2</xliff:g> of storage.
\n\nTo view details, switch to <xliff:g id="user" example="Guest user">^1</xliff:g>.</string>