summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2013-03-26 00:27:06 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-03-26 00:27:06 +0000
commit19c11e1c854ae3c20bacf66fbb20d53dcdb8d100 (patch)
treee65ba7f78dc6df914a70f01afba53a023b4d2c7a /media
parent112c72a9655c0d2fa3a8058e2a6c3bef6adb6232 (diff)
parent6eb954f54e4a92b3c4bfbee177a3259d1320500d (diff)
downloadframeworks_av-19c11e1c854ae3c20bacf66fbb20d53dcdb8d100.zip
frameworks_av-19c11e1c854ae3c20bacf66fbb20d53dcdb8d100.tar.gz
frameworks_av-19c11e1c854ae3c20bacf66fbb20d53dcdb8d100.tar.bz2
Merge "ToneGenerator: optimize silent tone" into jb-mr2-dev
Diffstat (limited to 'media')
-rw-r--r--media/libmedia/ToneGenerator.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp
index 42584fe..1c0268f 100644
--- a/media/libmedia/ToneGenerator.cpp
+++ b/media/libmedia/ToneGenerator.cpp
@@ -885,6 +885,11 @@ bool ToneGenerator::startTone(tone_type toneType, int durationMs) {
if ((toneType < 0) || (toneType >= NUM_TONES))
return lResult;
+ toneType = getToneForRegion(toneType);
+ if (toneType == TONE_CDMA_SIGNAL_OFF) {
+ return true;
+ }
+
if (mState == TONE_IDLE) {
ALOGV("startTone: try to re-init AudioTrack");
if (!initAudioTrack()) {
@@ -897,7 +902,6 @@ bool ToneGenerator::startTone(tone_type toneType, int durationMs) {
mLock.lock();
// Get descriptor for requested tone
- toneType = getToneForRegion(toneType);
mpNewToneDesc = &sToneDescriptors[toneType];
mDurationMs = durationMs;