Merge "Only show BootSounds preference if has_boot_sounds is true." into nyc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
1ff11c5ef0
@@ -17,6 +17,8 @@
|
||||
<resources>
|
||||
<!-- 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 boot sounds checkbox -->
|
||||
<bool name="has_boot_sounds">false</bool>
|
||||
<!-- Whether there is a silent mode checkbox -->
|
||||
<bool name="has_silent_mode">true</bool>
|
||||
<!-- Whether the DEPRECATED power control widget is enabled for this
|
||||
|
@@ -209,8 +209,12 @@ public class OtherSoundSettings extends SettingsPreferenceFragment implements In
|
||||
pref.init(this);
|
||||
}
|
||||
|
||||
mBootSounds = (SwitchPreference) findPreference(KEY_BOOT_SOUNDS);
|
||||
mBootSounds.setChecked(SystemProperties.getBoolean(PROPERTY_BOOT_SOUNDS, true));
|
||||
if (mContext.getResources().getBoolean(R.bool.has_boot_sounds)) {
|
||||
mBootSounds = (SwitchPreference) findPreference(KEY_BOOT_SOUNDS);
|
||||
mBootSounds.setChecked(SystemProperties.getBoolean(PROPERTY_BOOT_SOUNDS, true));
|
||||
} else {
|
||||
removePreference(KEY_BOOT_SOUNDS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -227,7 +231,7 @@ public class OtherSoundSettings extends SettingsPreferenceFragment implements In
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceTreeClick(Preference preference) {
|
||||
if (preference == mBootSounds) {
|
||||
if (mBootSounds != null && preference == mBootSounds) {
|
||||
SystemProperties.set(PROPERTY_BOOT_SOUNDS, mBootSounds.isChecked() ? "1" : "0");
|
||||
return false;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user