summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/current.txt1
-rw-r--r--core/java/android/speech/tts/SynthesisRequest.java15
-rw-r--r--core/java/android/speech/tts/TextToSpeechService.java4
3 files changed, 19 insertions, 1 deletions
diff --git a/api/current.txt b/api/current.txt
index f13c80a..1bdb0e6 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -21551,6 +21551,7 @@ package android.speech.tts {
public final class SynthesisRequest {
ctor public SynthesisRequest(java.lang.String, android.os.Bundle);
+ method public int getCallerUid();
method public java.lang.String getCountry();
method public java.lang.String getLanguage();
method public android.os.Bundle getParams();
diff --git a/core/java/android/speech/tts/SynthesisRequest.java b/core/java/android/speech/tts/SynthesisRequest.java
index 6398d3d..917a109 100644
--- a/core/java/android/speech/tts/SynthesisRequest.java
+++ b/core/java/android/speech/tts/SynthesisRequest.java
@@ -41,6 +41,7 @@ public final class SynthesisRequest {
private String mVariant;
private int mSpeechRate;
private int mPitch;
+ private int mCallerUid;
public SynthesisRequest(String text, Bundle params) {
mText = text;
@@ -98,6 +99,13 @@ public final class SynthesisRequest {
}
/**
+ * Gets the request caller Uid.
+ */
+ public int getCallerUid() {
+ return mCallerUid;
+ }
+
+ /**
* Sets the locale for the request.
*/
void setLanguage(String language, String country, String variant) {
@@ -119,4 +127,11 @@ public final class SynthesisRequest {
void setPitch(int pitch) {
mPitch = pitch;
}
+
+ /**
+ * Sets Caller Uid
+ */
+ void setCallerUid(int uid) {
+ mCallerUid = uid;
+ }
}
diff --git a/core/java/android/speech/tts/TextToSpeechService.java b/core/java/android/speech/tts/TextToSpeechService.java
index 703dcff..575855c 100644
--- a/core/java/android/speech/tts/TextToSpeechService.java
+++ b/core/java/android/speech/tts/TextToSpeechService.java
@@ -557,11 +557,13 @@ public abstract class TextToSpeechService extends Service {
// guarded by 'this'.
private AbstractSynthesisCallback mSynthesisCallback;
private final EventLogger mEventLogger;
+ private final int mCallerUid;
public SynthesisSpeechItem(Object callerIdentity, int callerUid, int callerPid,
Bundle params, String text) {
super(callerIdentity, callerUid, callerPid, params);
mText = text;
+ mCallerUid = callerUid;
mSynthesisRequest = new SynthesisRequest(mText, mParams);
mDefaultLocale = getSettingsLocale();
setRequestParams(mSynthesisRequest);
@@ -611,7 +613,7 @@ public abstract class TextToSpeechService extends Service {
private void setRequestParams(SynthesisRequest request) {
request.setLanguage(getLanguage(), getCountry(), getVariant());
request.setSpeechRate(getSpeechRate());
-
+ request.setCallerUid(mCallerUid);
request.setPitch(getPitch());
}