From 5517ad92dd91e3e5367f729b632e8895852f2b30 Mon Sep 17 00:00:00 2001 From: Johan Redestig Date: Thu, 19 Dec 2013 10:30:01 +0100 Subject: [PATCH] Dont show "Erase SD Card" when there is none On devices with physcal, external SD Cards, the "Erase SD card" option in in Settings/Storage is available even when there is no SD card present, this dont make much sense since you cannot erase a card that is absent. With this change the erase option is bound to the mount toggle which leads to the following consequences: Card present and mounted -> Erase enabled Card present but unmounted -> Erase enabled No card present -> Erase disabled Card present and MTP attached -> Erase disabled Change-Id: I756ae8af3e0565febaf940df5f4991dd89105bd9 --- .../settings/deviceinfo/StorageVolumePreferenceCategory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java b/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java index ed5085a2a50..29b1e924453 100644 --- a/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java +++ b/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java @@ -283,7 +283,7 @@ public class StorageVolumePreferenceCategory extends PreferenceCategory { mFormatPreference.setSummary(mResources.getString(R.string.mtp_ptp_mode_summary)); } } else if (mFormatPreference != null) { - mFormatPreference.setEnabled(true); + mFormatPreference.setEnabled(mMountTogglePreference.isEnabled()); mFormatPreference.setSummary(mResources.getString(R.string.sd_format_summary)); } }