Merge changes I86076b07,I7409732e,I248b1b27
* changes:
Support Singapore specific supervisory tone
Support Australia specific supervisory tone
Support GB specific supervisory tone
diff --git a/media/libaudioclient/ToneGenerator.cpp b/media/libaudioclient/ToneGenerator.cpp
index 78e392e..311a863 100644
--- a/media/libaudioclient/ToneGenerator.cpp
+++ b/media/libaudioclient/ToneGenerator.cpp
@@ -740,6 +740,18 @@
{ .duration = 0 , .waveFreq = { 0 }, 0, 0}},
.repeatCnt = ToneGenerator::TONEGEN_INF,
.repeatSegment = 0 }, // TONE_JAPAN_RADIO_ACK
+ { .segments = { { .duration = 375, .waveFreq = { 400, 0 }, 0, 0 },
+ { .duration = 375, .waveFreq = { 0 }, 0, 0 },
+ { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
+ .repeatCnt = ToneGenerator::TONEGEN_INF,
+ .repeatSegment = 0 }, // TONE_GB_BUSY
+ { .segments = { { .duration = 400, .waveFreq = { 400, 0 }, 0, 0 },
+ { .duration = 350, .waveFreq = { 0 }, 0, 0 },
+ { .duration = 225, .waveFreq = { 400, 0 }, 0, 0 },
+ { .duration = 525, .waveFreq = { 0 }, 0, 0 },
+ { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
+ .repeatCnt = ToneGenerator::TONEGEN_INF,
+ .repeatSegment = 0 }, // TONE_GB_CONGESTION
{ .segments = { { .duration = 400, .waveFreq = { 400, 450, 0 }, 0, 0 },
{ .duration = 200, .waveFreq = { 0 }, 0, 0 },
{ .duration = 400, .waveFreq = { 400, 450, 0 }, 0, 0 },
@@ -747,6 +759,10 @@
{ .duration = 0, .waveFreq = { 0 }, 0, 0}},
.repeatCnt = ToneGenerator::TONEGEN_INF,
.repeatSegment = 0 }, // TONE_GB_RINGTONE
+ { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 400, 425, 450, 0 }, 0, 0 },
+ { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
+ .repeatCnt = ToneGenerator::TONEGEN_INF,
+ .repeatSegment = 0 }, // TONE_AUSTRALIA_DIAL
{ .segments = { { .duration = 400, .waveFreq = { 400, 450, 0 }, 0, 0 },
{ .duration = 200, .waveFreq = { 0 }, 0, 0 },
{ .duration = 400, .waveFreq = { 400, 450, 0 }, 0, 0 },
@@ -771,6 +787,18 @@
{ .duration = 0 , .waveFreq = { 0 }, 0, 0}},
.repeatCnt = ToneGenerator::TONEGEN_INF,
.repeatSegment = 0 }, // TONE_AUSTRALIA_CONGESTION
+ { .segments = { { .duration = 750, .waveFreq = { 425, 0 }, 0, 0 },
+ { .duration = 750, .waveFreq = { 0 }, 0, 0 },
+ { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
+ .repeatCnt = ToneGenerator::TONEGEN_INF,
+ .repeatSegment = 0 }, // TONE_SG_BUSY
+ { .segments = { { .duration = 400, .waveFreq = { 401, 425, 449, 0 }, 0, 0 },
+ { .duration = 200, .waveFreq = { 0 }, 0, 0 },
+ { .duration = 400, .waveFreq = { 401, 425, 449, 0 }, 0, 0 },
+ { .duration = 2000, .waveFreq = { 0 }, 0, 0 },
+ { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
+ .repeatCnt = ToneGenerator::TONEGEN_INF,
+ .repeatSegment = 0 }, // TONE_SG_RINGTONE
};
// Used by ToneGenerator::getToneForRegion() to convert user specified supervisory tone type
@@ -797,9 +825,9 @@
TONE_SUP_RINGTONE // TONE_SUP_RINGTONE
},
{ // GB
- TONE_SUP_DIAL, // TONE_SUP_DIAL
- TONE_SUP_BUSY, // TONE_SUP_BUSY
- TONE_SUP_CONGESTION, // TONE_SUP_CONGESTION
+ TONE_ANSI_DIAL, // TONE_SUP_DIAL
+ TONE_GB_BUSY, // TONE_SUP_BUSY
+ TONE_GB_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
@@ -807,7 +835,7 @@
TONE_GB_RINGTONE // TONE_SUP_RINGTONE
},
{ // AUSTRALIA
- TONE_ANSI_DIAL, // TONE_SUP_DIAL
+ TONE_AUSTRALIA_DIAL, // TONE_SUP_DIAL
TONE_AUSTRALIA_BUSY, // TONE_SUP_BUSY
TONE_AUSTRALIA_CONGESTION, // TONE_SUP_CONGESTION
TONE_SUP_RADIO_ACK, // TONE_SUP_RADIO_ACK
@@ -815,6 +843,16 @@
TONE_SUP_ERROR, // TONE_SUP_ERROR
TONE_AUSTRALIA_CALL_WAITING,// TONE_SUP_CALL_WAITING
TONE_AUSTRALIA_RINGTONE // TONE_SUP_RINGTONE
+ },
+ { // SINGAPORE
+ TONE_SUP_DIAL, // TONE_SUP_DIAL
+ TONE_SG_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_SG_RINGTONE // TONE_SUP_RINGTONE
}
};
@@ -880,6 +918,8 @@
mRegion = GB;
} else if (strstr(value, "au") != NULL) {
mRegion = AUSTRALIA;
+ } else if (strstr(value, "sg") != NULL) {
+ mRegion = SINGAPORE;
} else {
mRegion = CEPT;
}
diff --git a/media/libaudioclient/include/media/ToneGenerator.h b/media/libaudioclient/include/media/ToneGenerator.h
index fc3d3ee..d362c68 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, rest of the world).
+ // These supervisory tones are different depending on the region (USA/CANADA, JAPAN, Singapore, 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[]
@@ -194,12 +194,18 @@
TONE_JAPAN_BUSY, // Busy tone: 400Hz, 500ms ON, 500ms OFF...
TONE_JAPAN_RADIO_ACK, // Radio path acknowlegment: 400Hz, 1s ON, 2s OFF...
// GB Supervisory tones
+ TONE_GB_BUSY, // Busy tone: 400 Hz, 375ms ON, 375ms OFF...
+ TONE_GB_CONGESTION, // Congestion Tone: 400 Hz, 400ms ON, 350ms OFF, 225ms ON, 525ms OFF...
TONE_GB_RINGTONE, // Ring Tone: A 400Hz + 450Hz tone repeated in a 0.4s on, 0.2s off, 0.4s on, 2.0s off pattern.
// AUSTRALIA Supervisory tones
+ TONE_AUSTRALIA_DIAL, // Dial tone: 425 Hz tone modulated with 25 Hz, continuous
TONE_AUSTRALIA_RINGTONE, // Ring tone: A 400Hz + 450Hz tone repeated in a 0.4s on, 0.2s off, 0.4s on, 2.0s off pattern.
TONE_AUSTRALIA_BUSY, // Busy tone: 425 Hz repeated in a 0.375s on, 0.375s off pattern.
TONE_AUSTRALIA_CALL_WAITING,// Call waiting tone: 425Hz tone repeated in a 0.2s on, 0.2s off, 0.2s on, 4.4s off pattern.
TONE_AUSTRALIA_CONGESTION, // Congestion tone: 425Hz tone repeated in a 0.375s on, 0.375s off pattern
+ // 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...
NUM_ALTERNATE_TONES
};
@@ -208,6 +214,7 @@
JAPAN,
GB,
AUSTRALIA,
+ SINGAPORE,
CEPT,
NUM_REGIONS
};