Commit 71eba63a authored by Geoffrey Métais's avatar Geoffrey Métais

Fix "resume on headset insertion" default value

And set settings dependency
parent 021a450c
......@@ -26,13 +26,15 @@
android:summary="@string/enable_headset_detection_summary"
android:title="@string/enable_headset_detection" />
<CheckBoxPreference
android:defaultValue="true"
android:key="enable_play_on_headset_insertion"
android:defaultValue="false"
android:dependency="enable_headset_detection"
android:summary="@string/enable_play_on_headset_insertion_summary"
android:title="@string/enable_play_on_headset_insertion" />
<CheckBoxPreference
android:defaultValue="false"
android:key="enable_steal_remote_control"
android:dependency="enable_headset_detection"
android:summary="@string/enable_steal_remote_control_summary"
android:title="@string/enable_steal_remote_control" />
</PreferenceCategory>
......
......@@ -53,7 +53,6 @@ public class PreferencesAudio extends BasePreferenceFragment implements SharedPr
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
findPreference("enable_play_on_headset_insertion").setVisible(((TwoStatePreference) findPreference("enable_headset_detection")).isChecked());
final HWDecoderUtil.AudioOutput aout = HWDecoderUtil.getAudioOutputFromDevice();
if (aout != HWDecoderUtil.AudioOutput.ALL) {
/* no AudioOutput choice */
......@@ -68,7 +67,6 @@ public class PreferencesAudio extends BasePreferenceFragment implements SharedPr
switch (preference.getKey()){
case "enable_headset_detection":
((PreferencesActivity)getActivity()).detectHeadset(((TwoStatePreference) preference).isChecked());
findPreference("enable_play_on_headset_insertion").setVisible(((TwoStatePreference) preference).isChecked());
return true;
case "enable_steal_remote_control":
PlaybackService.Client.restartService(getActivity());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment