diff options
author | Vasu Nori <vnori@google.com> | 2011-01-28 14:32:45 -0800 |
---|---|---|
committer | Vasu Nori <vnori@google.com> | 2011-01-28 17:14:38 -0800 |
commit | a3314e2bdb77dc6d9e70980f76bb45631abe7fb5 (patch) | |
tree | be2d91bcc8de42ac9521691e33cfa235a1f6ad50 /src/com/android/settings/deviceinfo/Memory.java | |
parent | a71551418cfeeb6da335bbc83fca80de4a82fa07 (diff) | |
download | packages_apps_Settings-a3314e2bdb77dc6d9e70980f76bb45631abe7fb5.tar.gz packages_apps_Settings-a3314e2bdb77dc6d9e70980f76bb45631abe7fb5.tar.bz2 packages_apps_Settings-a3314e2bdb77dc6d9e70980f76bb45631abe7fb5.zip |
bug:3402846 fix settings->storage
Change-Id: Icb9e33cb0336f87f43797330f56e9c8fcbe2dfd0
Diffstat (limited to 'src/com/android/settings/deviceinfo/Memory.java')
-rw-r--r-- | src/com/android/settings/deviceinfo/Memory.java | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/com/android/settings/deviceinfo/Memory.java b/src/com/android/settings/deviceinfo/Memory.java index 3e0f0a284..db1ff6554 100644 --- a/src/com/android/settings/deviceinfo/Memory.java +++ b/src/com/android/settings/deviceinfo/Memory.java @@ -181,7 +181,7 @@ public class Memory extends SettingsPreferenceFragment implements OnCancelListen mInternalMediaColor = mRes.getColor(R.color.memory_media_usage); mInternalAppsColor = mRes.getColor(R.color.memory_apps_usage); - mInternalUsedColor = mRes.getColor(R.color.memory_used); + mInternalUsedColor = android.graphics.Color.GRAY; float[] radius = new float[] { 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f @@ -401,23 +401,18 @@ public class Memory extends SettingsPreferenceFragment implements OnCancelListen } private void updateUiExact(long totalSize, long availSize, long mediaSize, long appsSize) { + // There are other things that can take up storage, but we didn't measure it. + // add that unaccounted-for-usage to Apps Usage + final long appsPlusRemaining = totalSize - availSize - mediaSize; + mInternalSize.setSummary(formatSize(totalSize)); mInternalAvail.setSummary(formatSize(availSize)); mInternalMediaUsage.setSummary(formatSize(mediaSize)); - mInternalAppsUsage.setSummary(formatSize(appsSize)); + mInternalAppsUsage.setSummary(formatSize(appsPlusRemaining)); mInternalUsageChart.clear(); mInternalUsageChart.addEntry(mediaSize / (float) totalSize, mInternalMediaColor); - mInternalUsageChart.addEntry(appsSize / (float) totalSize, mInternalAppsColor); - - final long usedSize = totalSize - availSize; - - // There are other things that can take up storage, but we didn't - // measure it. - final long remaining = usedSize - (mediaSize + appsSize); - if (remaining > 0) { - mInternalUsageChart.addEntry(remaining / (float) totalSize, mInternalUsedColor); - } + mInternalUsageChart.addEntry(appsPlusRemaining / (float) totalSize, mInternalAppsColor); mInternalUsageChart.commit(); } |