summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2009-09-07 08:38:38 -0700
committerEric Laurent <elaurent@google.com>2009-09-08 22:56:07 -0700
commit96c08a69ea0b95d1d8a8edb67f73bd9548e09f16 (patch)
treeb3062ccac2f1bd12f33be481a957cd5b88579e16 /core/jni
parent948ef29ebacde30bc2f1283b5e6d86f2413698c4 (diff)
downloadframeworks_base-96c08a69ea0b95d1d8a8edb67f73bd9548e09f16.zip
frameworks_base-96c08a69ea0b95d1d8a8edb67f73bd9548e09f16.tar.gz
frameworks_base-96c08a69ea0b95d1d8a8edb67f73bd9548e09f16.tar.bz2
Fix issue 1992233: DTMF tones on Sholes is really long.
Add a parameter to ToneGenerator.startTone() allowing the caller to specify the tone duration. This is used by the phone application to have a precise control on the DTMF tone duration which was not possible with the use of delayed messaged. Also modified AudioFlinger output threads so that 0s are written to the audio output stream when no more tracks are ready to mix instead of just sleeping. This avoids an issue where the end of a previous DTMF tone could stay in audio hardware buffers and be played just before the beginning of the next DTMF tone.
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android_media_ToneGenerator.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/jni/android_media_ToneGenerator.cpp b/core/jni/android_media_ToneGenerator.cpp
index a4388de..07bb1ab 100644
--- a/core/jni/android_media_ToneGenerator.cpp
+++ b/core/jni/android_media_ToneGenerator.cpp
@@ -38,7 +38,7 @@ struct fields_t {
};
static fields_t fields;
-static jboolean android_media_ToneGenerator_startTone(JNIEnv *env, jobject thiz, jint toneType) {
+static jboolean android_media_ToneGenerator_startTone(JNIEnv *env, jobject thiz, jint toneType, jint durationMs) {
LOGV("android_media_ToneGenerator_startTone: %x\n", (int)thiz);
ToneGenerator *lpToneGen = (ToneGenerator *)env->GetIntField(thiz,
@@ -48,7 +48,7 @@ static jboolean android_media_ToneGenerator_startTone(JNIEnv *env, jobject thiz,
return false;
}
- return lpToneGen->startTone(toneType);
+ return lpToneGen->startTone(toneType, durationMs);
}
static void android_media_ToneGenerator_stopTone(JNIEnv *env, jobject thiz) {
@@ -120,7 +120,7 @@ static void android_media_ToneGenerator_native_finalize(JNIEnv *env,
// ----------------------------------------------------------------------------
static JNINativeMethod gMethods[] = {
- { "startTone", "(I)Z", (void *)android_media_ToneGenerator_startTone },
+ { "startTone", "(II)Z", (void *)android_media_ToneGenerator_startTone },
{ "stopTone", "()V", (void *)android_media_ToneGenerator_stopTone },
{ "release", "()V", (void *)android_media_ToneGenerator_release },
{ "native_setup", "(II)V", (void *)android_media_ToneGenerator_native_setup },