summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/applications
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-07-12 15:20:13 -0700
committerDianne Hackborn <hackbod@google.com>2012-07-12 16:26:44 -0700
commit1f6ddac9f41f341073e7cedd8f777a43b7d11679 (patch)
tree7d2653082b73abea309a394983516ced73fa97e0 /src/com/android/settings/applications
parentbff90a97555518ed850bd320623e37984ca71a6a (diff)
downloadpackages_apps_settings-1f6ddac9f41f341073e7cedd8f777a43b7d11679.zip
packages_apps_settings-1f6ddac9f41f341073e7cedd8f777a43b7d11679.tar.gz
packages_apps_settings-1f6ddac9f41f341073e7cedd8f777a43b7d11679.tar.bz2
If external storage is emulated, don't show it as separate entries.
The installed app details UI is really complicted for the two-partition internal and external storage case... however, in our lovely new world of emulated external storage, there is no reason for this, since the external storage is using the same partition as internal storage. So in this case, don't show external storage as a separate item, just combine it into the base app size and data size values. Change-Id: Iea0e78f2d532ad50e20fef98740c93b2e897890a
Diffstat (limited to 'src/com/android/settings/applications')
-rw-r--r--src/com/android/settings/applications/ApplicationsState.java5
-rw-r--r--src/com/android/settings/applications/InstalledAppDetails.java43
-rw-r--r--src/com/android/settings/applications/ManageApplications.java3
3 files changed, 33 insertions, 18 deletions
diff --git a/src/com/android/settings/applications/ApplicationsState.java b/src/com/android/settings/applications/ApplicationsState.java
index 3256fb2..cca9086 100644
--- a/src/com/android/settings/applications/ApplicationsState.java
+++ b/src/com/android/settings/applications/ApplicationsState.java
@@ -786,7 +786,10 @@ public class ApplicationsState {
private long getTotalExternalSize(PackageStats ps) {
if (ps != null) {
+ // We also include the cache size here because for non-emulated
+ // we don't automtically clean cache files.
return ps.externalCodeSize + ps.externalDataSize
+ + ps.externalCacheSize
+ ps.externalMediaSize + ps.externalObbSize;
}
return SIZE_INVALID;
@@ -822,7 +825,7 @@ public class ApplicationsState {
long externalCodeSize = stats.externalCodeSize
+ stats.externalObbSize;
long externalDataSize = stats.externalDataSize
- + stats.externalMediaSize + stats.externalCacheSize;
+ + stats.externalMediaSize;
long newSize = externalCodeSize + externalDataSize
+ getTotalInternalSize(stats);
if (entry.size != newSize ||
diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java
index d85c341..22908ab 100644
--- a/src/com/android/settings/applications/InstalledAppDetails.java
+++ b/src/com/android/settings/applications/InstalledAppDetails.java
@@ -384,7 +384,12 @@ public class InstalledAppDetails extends Fragment
mDataSize = (TextView)view.findViewById(R.id.data_size_text);
mExternalCodeSize = (TextView)view.findViewById(R.id.external_code_size_text);
mExternalDataSize = (TextView)view.findViewById(R.id.external_data_size_text);
-
+
+ if (Environment.isExternalStorageEmulated()) {
+ ((View)mExternalCodeSize.getParent()).setVisibility(View.GONE);
+ ((View)mExternalDataSize.getParent()).setVisibility(View.GONE);
+ }
+
// Get Control button panel
View btnPanel = view.findViewById(R.id.control_buttons_panel);
mForceStopButton = (Button) btnPanel.findViewById(R.id.left_button);
@@ -675,22 +680,28 @@ public class InstalledAppDetails extends Fragment
} else {
mHaveSizes = true;
- if (mLastCodeSize != mAppEntry.codeSize) {
- mLastCodeSize = mAppEntry.codeSize;
- mAppSize.setText(getSizeStr(mAppEntry.codeSize));
- }
- if (mLastDataSize != mAppEntry.dataSize) {
- mLastDataSize = mAppEntry.dataSize;
- mDataSize.setText(getSizeStr(mAppEntry.dataSize));
+ long codeSize = mAppEntry.codeSize;
+ long dataSize = mAppEntry.dataSize;
+ if (Environment.isExternalStorageEmulated()) {
+ codeSize += mAppEntry.externalCodeSize;
+ dataSize += mAppEntry.externalDataSize;
+ } else {
+ if (mLastExternalCodeSize != mAppEntry.externalCodeSize) {
+ mLastExternalCodeSize = mAppEntry.externalCodeSize;
+ mExternalCodeSize.setText(getSizeStr(mAppEntry.externalCodeSize));
+ }
+ if (mLastExternalDataSize != mAppEntry.externalDataSize) {
+ mLastExternalDataSize = mAppEntry.externalDataSize;
+ mExternalDataSize.setText(getSizeStr( mAppEntry.externalDataSize));
+ }
}
- if (mLastExternalCodeSize != mAppEntry.externalCodeSize) {
- mLastExternalCodeSize = mAppEntry.externalCodeSize;
- mExternalCodeSize.setText(getSizeStr(mAppEntry.externalCodeSize));
+ if (mLastCodeSize != codeSize) {
+ mLastCodeSize = codeSize;
+ mAppSize.setText(getSizeStr(codeSize));
}
- long nonCacheExtDataSize = mAppEntry.externalDataSize - mAppEntry.externalCacheSize;
- if (mLastExternalDataSize != nonCacheExtDataSize) {
- mLastExternalDataSize = nonCacheExtDataSize;
- mExternalDataSize.setText(getSizeStr(nonCacheExtDataSize));
+ if (mLastDataSize != dataSize) {
+ mLastDataSize = dataSize;
+ mDataSize.setText(getSizeStr(dataSize));
}
long cacheSize = mAppEntry.cacheSize + mAppEntry.externalCacheSize;
if (mLastCacheSize != cacheSize) {
@@ -702,7 +713,7 @@ public class InstalledAppDetails extends Fragment
mTotalSize.setText(getSizeStr(mAppEntry.size));
}
- if ((mAppEntry.dataSize+nonCacheExtDataSize) <= 0 || !mCanClearData) {
+ if ((mAppEntry.dataSize+ mAppEntry.externalDataSize) <= 0 || !mCanClearData) {
mClearDataButton.setEnabled(false);
} else {
mClearDataButton.setEnabled(true);
diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/ManageApplications.java
index 1cc9dcc..1240d43 100644
--- a/src/com/android/settings/applications/ManageApplications.java
+++ b/src/com/android/settings/applications/ManageApplications.java
@@ -341,7 +341,8 @@ public class ManageApplications extends Fragment implements
final int N = mApplications.getCount();
for (int i=0; i<N; i++) {
ApplicationsState.AppEntry ae = mApplications.getAppEntry(i);
- mAppStorage += ae.externalCodeSize + ae.externalDataSize;
+ mAppStorage += ae.externalCodeSize + ae.externalDataSize
+ + ae.externalCacheSize;
}
}
} else {