Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 599ca055 authored by Tomoharu Kasahara's avatar Tomoharu Kasahara Committed by Tomoharu Kasahara
Browse files

Support Ireland specific supervisory tone

Ringtone and call waiting tone for Ireland are not
following ITU-T specification.
This patch implements them as per ITU-T specification.

Bug: 68294204
Test: Build and test ringback tone for Ireland
Change-Id: I2cf3f425aec47b9dbc6ecf2ffb3aef44ca4f783c
parent 55c45b33
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -811,6 +811,20 @@ const ToneGenerator::ToneDescriptor ToneGenerator::sToneDescriptors[] = {
                        { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
          .repeatCnt = ToneGenerator::TONEGEN_INF,
          .repeatSegment = 0 },                              // TONE_HK_RINGTONE
        { .segments = { { .duration = 400, .waveFreq = { 400, 450, 0 }, 0, 0 },
                        { .duration = 200, .waveFreq = { 0 }, 0, 0 },
                        { .duration = 400, .waveFreq = { 400, 450, 0 }, 0, 0 },
                        { .duration = 2000, .waveFreq = { 0 }, 0, 0},
                        { .duration = 0, .waveFreq = { 0 }, 0, 0}},
          .repeatCnt = ToneGenerator::TONEGEN_INF,
          .repeatSegment = 0 },                              // TONE_IE_RINGTONE
        { .segments = { { .duration = 180, .waveFreq = { 425, 0 }, 0, 0 },
                        { .duration = 200, .waveFreq = { 0 }, 0, 0 },
                        { .duration = 200, .waveFreq = { 425, 0 }, 0, 0 },
                        { .duration = 4500, .waveFreq = { 0 }, 0, 0 },
                        { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
          .repeatCnt = ToneGenerator::TONEGEN_INF,
          .repeatSegment = 0 },                              // TONE_IE_CALL_WAITING
};

// Used by ToneGenerator::getToneForRegion() to convert user specified supervisory tone type
@@ -875,6 +889,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_HK_RINGTONE             // TONE_SUP_RINGTONE
        },
        {   // IRELAND
            TONE_SUP_DIAL,               // TONE_SUP_DIAL
            TONE_SUP_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_IE_CALL_WAITING,        // TONE_SUP_CALL_WAITING
            TONE_IE_RINGTONE             // TONE_SUP_RINGTONE
        }
};

@@ -944,6 +968,8 @@ ToneGenerator::ToneGenerator(audio_stream_type_t streamType, float volume, bool
        mRegion = SINGAPORE;
    } else if (strstr(value, "hk") != NULL) {
        mRegion = HONGKONG;
    } else if (strstr(value, "ie") != NULL) {
        mRegion = IRELAND;
    } else {
        mRegion = CEPT;
    }
+4 −0
Original line number Diff line number Diff line
@@ -209,6 +209,9 @@ private:
        // 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.
        // IRELAND Supervisory tones
        TONE_IE_RINGTONE,           // Ring Tone: A 400Hz + 450Hz tone repeated in a 0.4s on, 0.2s off, 0.4s on, 2.0s off pattern.
        TONE_IE_CALL_WAITING,       // Call waiting tone: 425Hz tone repeated in a 0.18s on, 0.2s off, 0.2s on, 4.5s off pattern.
        NUM_ALTERNATE_TONES
    };

@@ -219,6 +222,7 @@ private:
        AUSTRALIA,
        SINGAPORE,
        HONGKONG,
        IRELAND,
        CEPT,
        NUM_REGIONS
    };