Merge "Get rid of the silent mode pref on xlarge." into honeycomb

This commit is contained in:
Joe Onorato
2011-01-12 15:36:40 -08:00
committed by Android (Google) Code Review
3 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<!-- Whether there is a silent mode checkbox -->
<bool name="has_silent_mode">false</bool>
</resources>

View File

@@ -20,4 +20,6 @@
<bool name="has_intrusive_led">false</bool>
<!-- Whether or not the dock settings are to be displayed for this device when docked -->
<bool name="has_dock_settings">false</bool>
<!-- Whether there is a silent mode checkbox -->
<bool name="has_silent_mode">true</bool>
</resources>

View File

@@ -43,6 +43,7 @@ public class SoundSettings extends SettingsPreferenceFragment implements
private static final String KEY_SILENT = "silent";
private static final String KEY_VIBRATE = "vibrate";
private static final String KEY_RING_VOLUME = "ring_volume";
private static final String KEY_DTMF_TONE = "dtmf_tone";
private static final String KEY_SOUND_EFFECTS = "sound_effects";
private static final String KEY_HAPTIC_FEEDBACK = "haptic_feedback";
@@ -110,6 +111,10 @@ public class SoundSettings extends SettingsPreferenceFragment implements
}
mSilent = (CheckBoxPreference) findPreference(KEY_SILENT);
if (!getResources().getBoolean(R.bool.has_silent_mode)) {
getPreferenceScreen().removePreference(mSilent);
findPreference(KEY_RING_VOLUME).setDependency(null);
}
mVibrate = (ListPreference) findPreference(KEY_VIBRATE);
mVibrate.setOnPreferenceChangeListener(this);