FileDocCategorySizeDatePackage
MockableCheckVoiceData.javaAPI DocAndroid 5.1 API1907Thu Mar 12 22:22:44 GMT 2015com.android.speech.tts

MockableCheckVoiceData

public class MockableCheckVoiceData extends android.app.Activity

Fields Summary
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle savedInstanceState)

        MockableTextToSpeechService.IDelegate delegate =
                MockableTextToSpeechService.getMocker();

        ArrayList<String> availableLangs = delegate.getAvailableVoices();
        ArrayList<String> unavailableLangs = delegate.getUnavailableVoices();

        final Intent returnVal = new Intent();

        // Returns early.
        if (availableLangs == null) {
            setResult(TextToSpeech.Engine.CHECK_VOICE_DATA_FAIL, returnVal);
            finish();
            return;
        }

        returnVal.putStringArrayListExtra(TextToSpeech.Engine.EXTRA_AVAILABLE_VOICES,
                    availableLangs);

        if (unavailableLangs != null && unavailableLangs.size() > 0) {
            returnVal.putStringArrayListExtra(TextToSpeech.Engine.EXTRA_UNAVAILABLE_VOICES,
                    unavailableLangs);
        }

        setResult(TextToSpeech.Engine.CHECK_VOICE_DATA_PASS, returnVal);
        finish();