ToneGenerator: add tones for New Zealand
Add definitions for region specific supervisory tones for New Zealand:
- Dial Tone : 400 Hz, continuous
- Busy Tone : 400 Hz, [500ms on, 500ms off] ...
- Call Waiting Tone : 400 Hz, [200ms on, 3 sec off] x 4
- Ringing / RBT : 400 Hz + 450 Hz, [400ms on, 200ms off, 400ms on, 2000ms off] ...
Bug: 227412820
Test: atest ToneGeneratorTest
Change-Id: I0d776f3fbdbba925cf1ac272270fb36f286dff91
Merged-In: I0d776f3fbdbba925cf1ac272270fb36f286dff91
(cherry picked from commit fb1969695bb930386b2ed21cd7a6d66911a2f762)
diff --git a/media/libaudioclient/ToneGenerator.cpp b/media/libaudioclient/ToneGenerator.cpp
index 4662247..f968a4b 100644
--- a/media/libaudioclient/ToneGenerator.cpp
+++ b/media/libaudioclient/ToneGenerator.cpp
@@ -867,6 +867,11 @@
{ .duration = 0 , .waveFreq = { 0 }, 0, 0}},
.repeatCnt = ToneGenerator::TONEGEN_INF,
.repeatSegment = 0 }, // TONE_TW_RINGTONE
+ { .segments = { { .duration = 200, .waveFreq = { 400, 0 }, 0, 0 },
+ { .duration = 3000, .waveFreq = { 0 }, 0, 0 },
+ { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
+ .repeatCnt = 3,
+ .repeatSegment = 0 }, // TONE_NZ_CALL_WAITING
};
// Used by ToneGenerator::getToneForRegion() to convert user specified supervisory tone type
@@ -961,6 +966,16 @@
TONE_SUP_ERROR, // TONE_SUP_ERROR
TONE_SUP_CALL_WAITING, // TONE_SUP_CALL_WAITING
TONE_TW_RINGTONE // TONE_SUP_RINGTONE
+ },
+ { // NEW ZEALAND
+ TONE_JAPAN_DIAL, // TONE_SUP_DIAL
+ TONE_JAPAN_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_NZ_CALL_WAITING, // TONE_SUP_CALL_WAITING
+ TONE_GB_RINGTONE // TONE_SUP_RINGTONE
}
};
@@ -1038,6 +1053,8 @@
mRegion = INDIA;
} else if (strstr(value, "tw") != NULL) {
mRegion = TAIWAN;
+ } else if (strstr(value, "nz") != NULL) {
+ mRegion = NZ;
} else {
mRegion = CEPT;
}