Support Hong Kong specific supervisory tone
Added the conditions that determine the region for HK,
then support Hong Kong specific ring tone and busy tone.
Bug: 63120797
Test: Build and test ringback tone for Hong Kong
Change-Id: Ifc836321ca1ac1f670d4640305727f4ea3800716
diff --git a/media/libaudioclient/ToneGenerator.cpp b/media/libaudioclient/ToneGenerator.cpp
index 435cfa2..988f195 100644
--- a/media/libaudioclient/ToneGenerator.cpp
+++ b/media/libaudioclient/ToneGenerator.cpp
@@ -799,6 +799,18 @@
{ .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 @@
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
}
};
@@ -913,6 +935,8 @@
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 d362c68..97bc825 100644
--- a/media/libaudioclient/include/media/ToneGenerator.h
+++ b/media/libaudioclient/include/media/ToneGenerator.h
@@ -177,7 +177,7 @@
// 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 @@
// 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 @@
GB,
AUSTRALIA,
SINGAPORE,
+ HONGKONG,
CEPT,
NUM_REGIONS
};