Hide TTS search results if no TTS engine is available
If there is no Text-to-speech engine available/installed then disable page search Bug: 274007225 Test: Manual Change-Id: Id734a69e742d9598be6824177d1a7d115ba6e594
This commit is contained in:
committed by
David Magno
parent
19ca5d6a6e
commit
417b4a8537
@@ -811,6 +811,14 @@ public class TextToSpeechSettings extends SettingsPreferenceFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||||
new BaseSearchIndexProvider(R.xml.tts_settings);
|
new BaseSearchIndexProvider(R.xml.tts_settings) {
|
||||||
|
@Override
|
||||||
|
protected boolean isPageSearchEnabled(Context context) {
|
||||||
|
TtsEngines ttsEngines = new TtsEngines(context);
|
||||||
|
return !ttsEngines.getEngines().isEmpty() &&
|
||||||
|
context.getResources().getBoolean(
|
||||||
|
R.bool.config_show_tts_settings_summary);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user