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;
}