Fix issues with new TTS API

Bug: 17389935
Change-Id: I59234b3222f59dc89be7e40f7d4706b1f8c610ce
This commit is contained in:
Przemyslaw Szczepaniak
2014-09-22 17:39:16 +01:00
parent fdb35f0526
commit f9ba548f21
4 changed files with 7 additions and 20 deletions

View File

@@ -1216,17 +1216,12 @@ public class TextToSpeech {
*
* @param durationInMs The duration of the silence.
* @param queueMode {@link #QUEUE_ADD} or {@link #QUEUE_FLUSH}.
* @param params Parameters for the request. Can be null.
* Engine specific parameters may be passed in but the parameter keys
* must be prefixed by the name of the engine they are intended for. For example
* the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the
* engine named "com.svox.pico" if it is being used.
* @param utteranceId An unique identifier for this request.
*
* @return {@link #ERROR} or {@link #SUCCESS} of <b>queuing</b> the playSilence operation.
*/
public int playSilence(final long durationInMs, final int queueMode,
final HashMap<String, String> params, final String utteranceId) {
final String utteranceId) {
return runAction(new Action<Integer>() {
@Override
public Integer run(ITextToSpeechService service) throws RemoteException {
@@ -1258,12 +1253,12 @@ public class TextToSpeech {
*
* @return {@link #ERROR} or {@link #SUCCESS} of <b>queuing</b> the playSilence operation.
* @deprecated As of API level 20, replaced by
* {@link #playSilence(long, int, HashMap, String)}.
* {@link #playSilence(long, int, String)}.
*/
@Deprecated
public int playSilence(final long durationInMs, final int queueMode,
final HashMap<String, String> params) {
return playSilence(durationInMs, queueMode, params,
return playSilence(durationInMs, queueMode,
params == null ? null : params.get(Engine.KEY_PARAM_UTTERANCE_ID));
}

View File

@@ -317,7 +317,7 @@ public abstract class TextToSpeechService extends Service {
* @return A name of the default voice for a given locale.
*/
protected String onGetDefaultVoiceNameFor(String lang, String country, String variant) {
public String onGetDefaultVoiceNameFor(String lang, String country, String variant) {
int localeStatus = onIsLanguageAvailable(lang, country, variant);
Locale iso3Locale = null;
switch (localeStatus) {

View File

@@ -91,9 +91,6 @@ public class Voice implements Parcelable {
Collections.addAll(this.mFeatures, in.readStringArray());
}
/**
* @hide
*/
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(mName);
@@ -104,17 +101,11 @@ public class Voice implements Parcelable {
dest.writeStringList(new ArrayList<String>(mFeatures));
}
/**
* @hide
*/
@Override
public int describeContents() {
return 0;
}
/**
* @hide
*/
public static final Parcelable.Creator<Voice> CREATOR = new Parcelable.Creator<Voice>() {
@Override
public Voice createFromParcel(Parcel in) {