Conditionally remove settings that aren't required on the tablet.
Bug: 2985267 Changes not done : SD card related stuff, as we need some way still to figure out if there is a real SD card in the device. Change-Id: I21c41f18ebe6c050981918481a7f6d69f04b65d0
This commit is contained in:
@@ -49,12 +49,21 @@ public class SoundSettings extends SettingsPreferenceFragment implements
|
||||
private static final String KEY_SOUND_SETTINGS = "sound_settings";
|
||||
private static final String KEY_NOTIFICATION_PULSE = "notification_pulse";
|
||||
private static final String KEY_LOCK_SOUNDS = "lock_sounds";
|
||||
private static final String KEY_RINGTONE = "ringtone";
|
||||
private static final String KEY_NOTIFICATION_SOUND = "notification_sound";
|
||||
private static final String KEY_CATEGORY_CALLS = "category_calls";
|
||||
private static final String KEY_CATEGORY_NOTIFICATION = "category_notification";
|
||||
|
||||
private static final String VALUE_VIBRATE_NEVER = "never";
|
||||
private static final String VALUE_VIBRATE_ALWAYS = "always";
|
||||
private static final String VALUE_VIBRATE_ONLY_SILENT = "silent";
|
||||
private static final String VALUE_VIBRATE_UNLESS_SILENT = "notsilent";
|
||||
|
||||
private static final String[] NEED_VOICE_CAPABILITY = {
|
||||
KEY_RINGTONE, KEY_DTMF_TONE, KEY_CATEGORY_CALLS,
|
||||
KEY_EMERGENCY_TONE
|
||||
};
|
||||
|
||||
private CheckBoxPreference mSilent;
|
||||
|
||||
/*
|
||||
@@ -145,6 +154,14 @@ public class SoundSettings extends SettingsPreferenceFragment implements
|
||||
}
|
||||
}
|
||||
|
||||
if (!Utils.isVoiceCapable(getActivity())) {
|
||||
for (String prefKey : NEED_VOICE_CAPABILITY) {
|
||||
Preference pref = findPreference(prefKey);
|
||||
if (pref != null) {
|
||||
getPreferenceScreen().removePreference(pref);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user