diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2013-09-06 20:05:17 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-06 20:05:18 +0000 |
commit | 4c7de61320f3ea1df8d5cdd3d0645830b67722ea (patch) | |
tree | aceaa8c829f7fc0d6185c8463ae1610891032d44 /src/com/android | |
parent | 421dccd5dd8cdec03bbc704b142f3ca2396f7e40 (diff) | |
parent | 37f3c8f574b984e4980ebf598358726b3f852156 (diff) | |
download | packages_apps_Settings-4c7de61320f3ea1df8d5cdd3d0645830b67722ea.zip packages_apps_Settings-4c7de61320f3ea1df8d5cdd3d0645830b67722ea.tar.gz packages_apps_Settings-4c7de61320f3ea1df8d5cdd3d0645830b67722ea.tar.bz2 |
Merge "Fix bug #10624988 Incorrect mirroring of RAM and Internal Storage for Apps screens in Settings" into klp-dev
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/settings/applications/ManageApplications.java | 10 | ||||
-rw-r--r-- | src/com/android/settings/applications/RunningProcessesView.java | 10 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/ManageApplications.java index d37688c..aa10c9e 100644 --- a/src/com/android/settings/applications/ManageApplications.java +++ b/src/com/android/settings/applications/ManageApplications.java @@ -50,6 +50,7 @@ import android.provider.Settings; import android.support.v4.view.PagerAdapter; import android.support.v4.view.PagerTabStrip; import android.support.v4.view.ViewPager; +import android.text.BidiFormatter; import android.text.format.Formatter; import android.util.Log; import android.view.LayoutInflater; @@ -385,20 +386,21 @@ public class ManageApplications extends Fragment implements return; } if (mTotalStorage > 0) { + BidiFormatter bidiFormatter = BidiFormatter.getInstance(); mColorBar.setRatios((mTotalStorage-mFreeStorage-mAppStorage)/(float)mTotalStorage, mAppStorage/(float)mTotalStorage, mFreeStorage/(float)mTotalStorage); long usedStorage = mTotalStorage - mFreeStorage; if (mLastUsedStorage != usedStorage) { mLastUsedStorage = usedStorage; - String sizeStr = Formatter.formatShortFileSize( - mOwner.getActivity(), usedStorage); + String sizeStr = bidiFormatter.unicodeWrap( + Formatter.formatShortFileSize(mOwner.getActivity(), usedStorage)); mUsedStorageText.setText(mOwner.getActivity().getResources().getString( R.string.service_foreground_processes, sizeStr)); } if (mLastFreeStorage != mFreeStorage) { mLastFreeStorage = mFreeStorage; - String sizeStr = Formatter.formatShortFileSize( - mOwner.getActivity(), mFreeStorage); + String sizeStr = bidiFormatter.unicodeWrap( + Formatter.formatShortFileSize(mOwner.getActivity(), mFreeStorage)); mFreeStorageText.setText(mOwner.getActivity().getResources().getString( R.string.service_background_processes, sizeStr)); } diff --git a/src/com/android/settings/applications/RunningProcessesView.java b/src/com/android/settings/applications/RunningProcessesView.java index 67221ae..52c4841 100644 --- a/src/com/android/settings/applications/RunningProcessesView.java +++ b/src/com/android/settings/applications/RunningProcessesView.java @@ -16,6 +16,7 @@ package com.android.settings.applications; +import android.text.BidiFormatter; import com.android.internal.util.MemInfoReader; import com.android.settings.R; @@ -342,11 +343,14 @@ public class RunningProcessesView extends FrameLayout mLastBackgroundProcessMemory = mState.mBackgroundProcessMemory; mLastAvailMemory = availMem; long freeMem = mLastAvailMemory + mLastBackgroundProcessMemory; - String sizeStr = Formatter.formatShortFileSize(getContext(), freeMem); + BidiFormatter bidiFormatter = BidiFormatter.getInstance(); + String sizeStr = bidiFormatter.unicodeWrap( + Formatter.formatShortFileSize(getContext(), freeMem)); mBackgroundProcessText.setText(getResources().getString( R.string.service_background_processes, sizeStr)); - sizeStr = Formatter.formatShortFileSize(getContext(), - mMemInfoReader.getTotalSize() - freeMem); + sizeStr = bidiFormatter.unicodeWrap( + Formatter.formatShortFileSize(getContext(), + mMemInfoReader.getTotalSize() - freeMem)); mForegroundProcessText.setText(getResources().getString( R.string.service_foreground_processes, sizeStr)); } |