Only show BootSounds preference if has_boot_sounds is true.
am: fd351eaaf1
Change-Id: Iac1ce93f1c9cb063162c2eab14774b720b4eb4e8
This commit is contained in:
@@ -4,9 +4,9 @@
|
|||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
@@ -17,6 +17,8 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<!-- Whether or not the dock settings are to be displayed for this device when docked -->
|
<!-- Whether or not the dock settings are to be displayed for this device when docked -->
|
||||||
<bool name="has_dock_settings">false</bool>
|
<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 -->
|
<!-- Whether there is a silent mode checkbox -->
|
||||||
<bool name="has_silent_mode">true</bool>
|
<bool name="has_silent_mode">true</bool>
|
||||||
<!-- Whether the DEPRECATED power control widget is enabled for this
|
<!-- Whether the DEPRECATED power control widget is enabled for this
|
||||||
|
@@ -209,8 +209,12 @@ public class OtherSoundSettings extends SettingsPreferenceFragment implements In
|
|||||||
pref.init(this);
|
pref.init(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
mBootSounds = (SwitchPreference) findPreference(KEY_BOOT_SOUNDS);
|
if (mContext.getResources().getBoolean(R.bool.has_boot_sounds)) {
|
||||||
mBootSounds.setChecked(SystemProperties.getBoolean(PROPERTY_BOOT_SOUNDS, true));
|
mBootSounds = (SwitchPreference) findPreference(KEY_BOOT_SOUNDS);
|
||||||
|
mBootSounds.setChecked(SystemProperties.getBoolean(PROPERTY_BOOT_SOUNDS, true));
|
||||||
|
} else {
|
||||||
|
removePreference(KEY_BOOT_SOUNDS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -227,7 +231,7 @@ public class OtherSoundSettings extends SettingsPreferenceFragment implements In
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceTreeClick(Preference preference) {
|
public boolean onPreferenceTreeClick(Preference preference) {
|
||||||
if (preference == mBootSounds) {
|
if (mBootSounds != null && preference == mBootSounds) {
|
||||||
SystemProperties.set(PROPERTY_BOOT_SOUNDS, mBootSounds.isChecked() ? "1" : "0");
|
SystemProperties.set(PROPERTY_BOOT_SOUNDS, mBootSounds.isChecked() ? "1" : "0");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user