diff options
author | Jeff Sharkey <jsharkey@android.com> | 2012-06-12 17:13:12 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2012-06-12 18:41:51 -0700 |
commit | cd4428ce2c03fd355a3093fad6553636da9cef9b (patch) | |
tree | 65362b0872090e0ac859666f9763238e68752da6 /src | |
parent | 292d7e3b8135c93b2f71bb05be81ca71dd03add1 (diff) | |
download | packages_apps_settings-cd4428ce2c03fd355a3093fad6553636da9cef9b.zip packages_apps_settings-cd4428ce2c03fd355a3093fad6553636da9cef9b.tar.gz packages_apps_settings-cd4428ce2c03fd355a3093fad6553636da9cef9b.tar.bz2 |
Storage banner when device in low disk state.
Bug: 6576409
Change-Id: I25f71935e312bf6efa832d10c22e3edbdc18f4fb
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java b/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java index bbf1d01..0211c77 100644 --- a/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java +++ b/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java @@ -16,9 +16,11 @@ package com.android.settings.deviceinfo; +import android.app.ActivityThread; import android.app.DownloadManager; import android.content.Context; import android.content.Intent; +import android.content.pm.IPackageManager; import android.content.res.Resources; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.RectShape; @@ -26,6 +28,7 @@ import android.os.Bundle; import android.os.Environment; import android.os.Handler; import android.os.Message; +import android.os.RemoteException; import android.os.storage.StorageManager; import android.os.storage.StorageVolume; import android.preference.Preference; @@ -53,6 +56,7 @@ public class StorageVolumePreferenceCategory extends PreferenceCategory implemen private Preference[] mPreferences; private Preference mMountTogglePreference; private Preference mFormatPreference; + private Preference mStorageLow; private int[] mColors; private Resources mResources; @@ -204,6 +208,18 @@ public class StorageVolumePreferenceCategory extends PreferenceCategory implemen mFormatPreference.setTitle(R.string.sd_format); mFormatPreference.setSummary(R.string.sd_format_summary); } + + final IPackageManager pm = ActivityThread.getPackageManager(); + try { + if (pm.isStorageLow()) { + mStorageLow = new Preference(getContext()); + mStorageLow.setTitle(R.string.storage_low_title); + mStorageLow.setSummary(R.string.storage_low_summary); + } else { + mStorageLow = null; + } + } catch (RemoteException e) { + } } public StorageVolume getStorageVolume() { @@ -227,6 +243,9 @@ public class StorageVolumePreferenceCategory extends PreferenceCategory implemen } addPreference(mUsageBarPreference); + if (mStorageLow != null) { + addPreference(mStorageLow); + } for (int i = 0; i < numberOfCategories; i++) { addPreference(mPreferences[i]); } |