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

Commit d60b9de7 authored by tomoki hanzawa's avatar tomoki hanzawa Committed by android-build-merger
Browse files

Merge "Support Hong Kong specific supervisory tone" am: 78041ba2 am: cbb79ebd

am: 593f9251

Change-Id: I7176f17472b32753ef0342eec954d6e18a58025f
parents d3bce141 593f9251
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -799,6 +799,18 @@ const ToneGenerator::ToneDescriptor ToneGenerator::sToneDescriptors[] = {
                        { .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 @@ 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_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
        }
};

@@ -920,6 +942,8 @@ ToneGenerator::ToneGenerator(audio_stream_type_t streamType, float volume, bool
        mRegion = AUSTRALIA;
    } else if (strstr(value, "sg") != NULL) {
        mRegion = SINGAPORE;
    } else if (strstr(value, "hk") != NULL) {
        mRegion = HONGKONG;
    } else {
        mRegion = CEPT;
    }
+5 −1
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ private:


    // 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 @@ private:
        // 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 @@ private:
        GB,
        AUSTRALIA,
        SINGAPORE,
        HONGKONG,
        CEPT,
        NUM_REGIONS
    };