summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/speech/tts/SynthesisRequest.java15
-rw-r--r--core/java/android/speech/tts/TextToSpeechService.java4
2 files changed, 18 insertions, 1 deletions
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());
}