diff options
author | Jeff Sharkey <jsharkey@android.com> | 2012-06-12 18:54:49 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-06-12 18:54:49 -0700 |
commit | c35b51f3c7746c29672d15e1564b04103c8d32bf (patch) | |
tree | af802229cd72e0137b757df38279cbf5644d0cc6 /src/com/android/settings/deviceinfo | |
parent | 99f27dc554c7937bc1afbcae0c40e364d025ca2d (diff) | |
parent | cd4428ce2c03fd355a3093fad6553636da9cef9b (diff) | |
download | packages_apps_settings-c35b51f3c7746c29672d15e1564b04103c8d32bf.zip packages_apps_settings-c35b51f3c7746c29672d15e1564b04103c8d32bf.tar.gz packages_apps_settings-c35b51f3c7746c29672d15e1564b04103c8d32bf.tar.bz2 |
am cd4428ce: Storage banner when device in low disk state.
* commit 'cd4428ce2c03fd355a3093fad6553636da9cef9b':
Storage banner when device in low disk state.
Diffstat (limited to 'src/com/android/settings/deviceinfo')
-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]); } |