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

Commit 65069671 authored by Hall Liu's avatar Hall Liu Committed by android-build-merger
Browse files

Merge "Add UK ringback tone" into nyc-dev

am: cc95bcf0

* commit 'cc95bcf0':
  Add UK ringback tone

Change-Id: Id53cfc06e491e3d0cb4ccb3b577d5be7b42bc1bc
parents d8df0e69 cc95bcf0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -193,12 +193,15 @@ private:
        TONE_JAPAN_DIAL,            // Dial tone: 400Hz, continuous
        TONE_JAPAN_BUSY,            // Busy tone: 400Hz, 500ms ON, 500ms OFF...
        TONE_JAPAN_RADIO_ACK,       // Radio path acknowlegment: 400Hz, 1s ON, 2s OFF...
        // UK Supervisory tones
        TONE_UK_RINGTONE,           // Ring Tone: A 400Hz + 450Hz tone repeated in a 0.4s on, 0.2s off, 0.4s on, 2.0s off pattern.
        NUM_ALTERNATE_TONES
    };

    enum region {
        ANSI,
        JAPAN,
        UK,
        CEPT,
        NUM_REGIONS
    };
+21 −0
Original line number Diff line number Diff line
@@ -740,6 +740,13 @@ const ToneGenerator::ToneDescriptor ToneGenerator::sToneDescriptors[] = {
                        { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
          .repeatCnt = ToneGenerator::TONEGEN_INF,
          .repeatSegment = 0 },                              // TONE_JAPAN_RADIO_ACK
        { .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_UK_RINGTONE



@@ -767,7 +774,18 @@ 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_SUP_RINGTONE            // TONE_SUP_RINGTONE
        },
        {   // UK
            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_SUP_CALL_WAITING,       // TONE_SUP_CALL_WAITING
            TONE_UK_RINGTONE             // TONE_SUP_RINGTONE
        }

};


@@ -819,6 +837,9 @@ ToneGenerator::ToneGenerator(audio_stream_type_t streamType, float volume, bool
        mRegion = ANSI;
    } else if (strcmp(value,"jp") == 0) {
        mRegion = JAPAN;
    } else if (strcmp(value,"uk") == 0 ||
               strcmp(value,"uk,uk") == 0) {
        mRegion = UK;
    } else {
        mRegion = CEPT;
    }