diff --git a/media/libaudioclient/ToneGenerator.cpp b/media/libaudioclient/ToneGenerator.cpp index 311a86357c..fa1d253499 100644 --- a/media/libaudioclient/ToneGenerator.cpp +++ b/media/libaudioclient/ToneGenerator.cpp @@ -799,6 +799,18 @@ const ToneGenerator::ToneDescriptor ToneGenerator::sToneDescriptors[] = { { .duration = 0 , .waveFreq = { 0 }, 0, 0}}, .repeatCnt = ToneGenerator::TONEGEN_INF, .repeatSegment = 0 }, // TONE_SG_RINGTONE + { .segments = { { .duration = 500, .waveFreq = { 480, 620, 0 }, 0, 0 }, + { .duration = 500, .waveFreq = { 0 }, 0, 0 }, + { .duration = 0 , .waveFreq = { 0 }, 0, 0}}, + .repeatCnt = ToneGenerator::TONEGEN_INF, + .repeatSegment = 0 }, // TONE_HK_BUSY + { .segments = { { .duration = 400, .waveFreq = { 440, 480, 0 }, 0, 0 }, + { .duration = 200, .waveFreq = { 0 }, 0, 0 }, + { .duration = 400, .waveFreq = { 440, 480, 0 }, 0, 0 }, + { .duration = 3000, .waveFreq = { 0 }, 0, 0 }, + { .duration = 0 , .waveFreq = { 0 }, 0, 0}}, + .repeatCnt = ToneGenerator::TONEGEN_INF, + .repeatSegment = 0 }, // TONE_HK_RINGTONE }; // Used by ToneGenerator::getToneForRegion() to convert user specified supervisory tone type @@ -853,6 +865,16 @@ const unsigned char /*tone_type*/ ToneGenerator::sToneMappingTable[NUM_REGIONS-1 TONE_SUP_ERROR, // TONE_SUP_ERROR TONE_SUP_CALL_WAITING, // TONE_SUP_CALL_WAITING TONE_SG_RINGTONE // TONE_SUP_RINGTONE + }, + { // HONGKONG + TONE_SUP_DIAL, // TONE_SUP_DIAL + TONE_HK_BUSY, // TONE_SUP_BUSY + TONE_SUP_CONGESTION, // TONE_SUP_CONGESTION + TONE_SUP_RADIO_ACK, // TONE_SUP_RADIO_ACK + TONE_SUP_RADIO_NOTAVAIL, // TONE_SUP_RADIO_NOTAVAIL + TONE_SUP_ERROR, // TONE_SUP_ERROR + TONE_SUP_CALL_WAITING, // TONE_SUP_CALL_WAITING + TONE_HK_RINGTONE // TONE_SUP_RINGTONE } }; @@ -920,6 +942,8 @@ ToneGenerator::ToneGenerator(audio_stream_type_t streamType, float volume, bool mRegion = AUSTRALIA; } else if (strstr(value, "sg") != NULL) { mRegion = SINGAPORE; + } else if (strstr(value, "hk") != NULL) { + mRegion = HONGKONG; } else { mRegion = CEPT; } diff --git a/media/libaudioclient/include/media/ToneGenerator.h b/media/libaudioclient/include/media/ToneGenerator.h index d362c6862c..97bc825fa6 100644 --- a/media/libaudioclient/include/media/ToneGenerator.h +++ b/media/libaudioclient/include/media/ToneGenerator.h @@ -177,7 +177,7 @@ private: // Region specific tones. - // These supervisory tones are different depending on the region (USA/CANADA, JAPAN, Singapore, rest of the world). + // These supervisory tones are different depending on the region (USA/CANADA, JAPAN, Singapore, Hong Kong, rest of the world). // When a tone in the range [FIRST_SUP_TONE, LAST_SUP_TONE] is requested, the region is determined // from system property gsm.operator.iso-country and the proper tone descriptor is selected with the // help of sToneMappingTable[] @@ -206,6 +206,9 @@ private: // SINGAPORE Supervisory tones TONE_SG_BUSY, // Busy tone: 425 Hz, 750ms ON, 750ms OFF... TONE_SG_RINGTONE, // Ring Tone: 425 Hz tone modulated with 24 Hz, 400ms ON, 200ms OFF, 400ms ON, 2s OFF... + // HONG KONG Supervisory tones + TONE_HK_BUSY, // Busy tone: 480 Hz + 620 Hz, 500ms ON, 500ms OFF... + TONE_HK_RINGTONE, // Ring Tone: 440 Hz + 480 Hz repeated with pattern 0,4s on, 0,2s off, 0,4s on and 3s off. NUM_ALTERNATE_TONES }; @@ -215,6 +218,7 @@ private: GB, AUSTRALIA, SINGAPORE, + HONGKONG, CEPT, NUM_REGIONS };