[Android] Disable the preference "Automatically detect audio latency" if the Android device running RetroArch is less than Android 4.1. Auto detection won't work on those below it.

This commit is contained in:
Lioncash 2013-10-14 11:57:53 -04:00
parent cae9591c2f
commit 1cb397dac7

View File

@ -3,7 +3,9 @@ package org.retroarch.browser.preferences.fragments;
import org.retroarch.R;
import org.retroarch.browser.preferences.fragments.util.PreferenceListFragment;
import android.os.Build;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
/**
* A {@link PreferenceListFragment} responsible for handling the audio preferences.
@ -17,5 +19,13 @@ public final class AudioPreferenceFragment extends PreferenceListFragment
// Add audio preferences from the XML.
addPreferencesFromResource(R.xml.audio_preferences);
// Disable automatic detection of optimal audio latency if a device is below Android 4.1
final CheckBoxPreference autoDetectAudioLatency = (CheckBoxPreference) findPreference("audio_latency_auto");
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN)
{
autoDetectAudioLatency.setChecked(false);
autoDetectAudioLatency.setEnabled(false);
}
}
}