diff options
author | Eric Laurent <elaurent@google.com> | 2013-03-26 00:27:06 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-03-26 00:27:06 +0000 |
commit | bbef2b3f42de20c7d2a920de62d3d1eca40e054f (patch) | |
tree | b94c370746e62ef79eaffeba51c32bf7746359c9 /media/libmedia | |
parent | 4d6f89052289bd7170238c8797b2ee19115b7626 (diff) | |
parent | 3beec60725cf0e5cf8e365d6c85928160c2cb75e (diff) | |
download | frameworks_av-bbef2b3f42de20c7d2a920de62d3d1eca40e054f.zip frameworks_av-bbef2b3f42de20c7d2a920de62d3d1eca40e054f.tar.gz frameworks_av-bbef2b3f42de20c7d2a920de62d3d1eca40e054f.tar.bz2 |
Merge "ToneGenerator: optimize silent tone" into jb-mr2-dev
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/ToneGenerator.cpp | 6 |
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; |