Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

frameworks-av: Commit

frameworks/av


Commit MetaInfo

Revision2dd98038ac81eb65283f85cb9fdab836377a9df0 (tree)
Time2018-11-30 12:28:09
AuthorNobuaki Tanaka <nobuaki.xb.tanaka@sony...>
Commiterandroid-build-team Robot

Log Message

Support to play the various tones as per the Indian standard

To play the following tones as per Indian standards.

- Dial tone
- Busy tone
- Congestion tone
- Call waiting tone
- Ringing tone

Bug: 117161543
Bug: 118655632
Test: Play each tone in indian locale

(cherry picked from commit f4a4005adb8340b2883d0b6771bcebac5c9c75b5)

Change-Id: I6358b18bf23fa21b6fd0a6e3ff4d296b2df6e69d
(cherry picked from commit b7afce9ef7d9c4cd5181501447663921617f560e)

Change Summary

Incremental Difference

--- a/media/libaudioclient/ToneGenerator.cpp
+++ b/media/libaudioclient/ToneGenerator.cpp
@@ -826,6 +826,34 @@ const ToneGenerator::ToneDescriptor ToneGenerator::sToneDescriptors[] = {
826826 { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
827827 .repeatCnt = ToneGenerator::TONEGEN_INF,
828828 .repeatSegment = 0 }, // TONE_IE_CALL_WAITING
829+ { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 375, 400, 425, 0 }, 0, 0 },
830+ { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
831+ .repeatCnt = ToneGenerator::TONEGEN_INF,
832+ .repeatSegment = 0 }, // TONE_INDIA_DIAL
833+ { .segments = { { .duration = 750, .waveFreq = { 400, 0 }, 0, 0 },
834+ { .duration = 750, .waveFreq = { 0 }, 0, 0 },
835+ { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
836+ .repeatCnt = ToneGenerator::TONEGEN_INF,
837+ .repeatSegment = 0 }, // TONE_INDIA_BUSY
838+ { .segments = { { .duration = 250, .waveFreq = { 400, 0 }, 0, 0 },
839+ { .duration = 250, .waveFreq = { 0 }, 0, 0 },
840+ { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
841+ .repeatCnt = ToneGenerator::TONEGEN_INF,
842+ .repeatSegment = 0 }, // TONE_INDIA_CONGESTION
843+ { .segments = { { .duration = 200, .waveFreq = { 400, 0 }, 0, 0 },
844+ { .duration = 100, .waveFreq = { 0 }, 0, 0 },
845+ { .duration = 200, .waveFreq = { 400, 0 }, 0, 0 },
846+ { .duration = 7500, .waveFreq = { 0 }, 0, 0 },
847+ { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
848+ .repeatCnt = ToneGenerator::TONEGEN_INF,
849+ .repeatSegment = 0 }, // TONE_INDIA_CALL_WAITING
850+ { .segments = { { .duration = 400, .waveFreq = { 375, 400, 425, 0 }, 0, 0 },
851+ { .duration = 200, .waveFreq = { 0 }, 0, 0 },
852+ { .duration = 400, .waveFreq = { 375, 400, 425, 0 }, 0, 0 },
853+ { .duration = 2000, .waveFreq = { 0 }, 0, 0 },
854+ { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
855+ .repeatCnt = ToneGenerator::TONEGEN_INF,
856+ .repeatSegment = 0 }, // TONE_INDIA_RINGTONE
829857 };
830858
831859 // Used by ToneGenerator::getToneForRegion() to convert user specified supervisory tone type
@@ -900,6 +928,16 @@ const unsigned char /*tone_type*/ ToneGenerator::sToneMappingTable[NUM_REGIONS-1
900928 TONE_SUP_ERROR, // TONE_SUP_ERROR
901929 TONE_IE_CALL_WAITING, // TONE_SUP_CALL_WAITING
902930 TONE_IE_RINGTONE // TONE_SUP_RINGTONE
931+ },
932+ { // INDIA
933+ TONE_INDIA_DIAL, // TONE_SUP_DIAL
934+ TONE_INDIA_BUSY, // TONE_SUP_BUSY
935+ TONE_INDIA_CONGESTION, // TONE_SUP_CONGESTION
936+ TONE_SUP_RADIO_ACK, // TONE_SUP_RADIO_ACK
937+ TONE_SUP_RADIO_NOTAVAIL, // TONE_SUP_RADIO_NOTAVAIL
938+ TONE_SUP_ERROR, // TONE_SUP_ERROR
939+ TONE_INDIA_CALL_WAITING, // TONE_SUP_CALL_WAITING
940+ TONE_INDIA_RINGTONE // TONE_SUP_RINGTONE
903941 }
904942 };
905943
@@ -971,6 +1009,8 @@ ToneGenerator::ToneGenerator(audio_stream_type_t streamType, float volume, bool
9711009 mRegion = HONGKONG;
9721010 } else if (strstr(value, "ie") != NULL) {
9731011 mRegion = IRELAND;
1012+ } else if (strstr(value, "in") != NULL) {
1013+ mRegion = INDIA;
9741014 } else {
9751015 mRegion = CEPT;
9761016 }
--- a/media/libaudioclient/include/media/ToneGenerator.h
+++ b/media/libaudioclient/include/media/ToneGenerator.h
@@ -212,6 +212,12 @@ private:
212212 // IRELAND Supervisory tones
213213 TONE_IE_RINGTONE, // Ring Tone: A 400Hz + 450Hz tone repeated in a 0.4s on, 0.2s off, 0.4s on, 2.0s off pattern.
214214 TONE_IE_CALL_WAITING, // Call waiting tone: 425Hz tone repeated in a 0.18s on, 0.2s off, 0.2s on, 4.5s off pattern.
215+ // INDIA supervisory tones
216+ TONE_INDIA_DIAL, // Dial tone: 400 Hz tone modulated with 25Hz, continuous
217+ TONE_INDIA_BUSY, // Busy tone: 400 Hz, 750ms ON, 750ms OFF...
218+ TONE_INDIA_CONGESTION, // Congestion tone: 400 Hz, 250ms ON, 250ms OFF...
219+ TONE_INDIA_CALL_WAITING, // Call waiting tone: 400 Hz, tone repeated in a 0.2s on, 0.1s off, 0.2s on, 7.5s off pattern.
220+ TONE_INDIA_RINGTONE, // Ring tone: 400 Hz tone modulated with 25Hz, 0.4 on 0.2 off 0.4 on 2..0 off
215221 NUM_ALTERNATE_TONES
216222 };
217223
@@ -223,6 +229,7 @@ private:
223229 SINGAPORE,
224230 HONGKONG,
225231 IRELAND,
232+ INDIA,
226233 CEPT,
227234 NUM_REGIONS
228235 };
Show on old repository browser