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

Commit bf7ec9bc authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "ToneGenerator: add special ringback tone for Taiwan."

parents ddd2c167 986c3409
Loading
Loading
Loading
Loading
+17 −0
Original line number Original line Diff line number Diff line
@@ -853,6 +853,11 @@ const ToneGenerator::ToneDescriptor ToneGenerator::sToneDescriptors[] = {
                      { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
                      { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
          .repeatCnt = ToneGenerator::TONEGEN_INF,
          .repeatCnt = ToneGenerator::TONEGEN_INF,
          .repeatSegment = 0 },                               // TONE_INDIA_RINGTONE
          .repeatSegment = 0 },                               // TONE_INDIA_RINGTONE
        { .segments = { { .duration = 1000, .waveFreq = { 440, 480, 0 }, 0, 0 },
                        { .duration = 2000, .waveFreq = { 0 }, 0, 0 },
                        { .duration = 0 , .waveFreq = { 0 }, 0, 0}},
          .repeatCnt = ToneGenerator::TONEGEN_INF,
          .repeatSegment = 0 },                               // TONE_TW_RINGTONE
};
};


// Used by ToneGenerator::getToneForRegion() to convert user specified supervisory tone type
// Used by ToneGenerator::getToneForRegion() to convert user specified supervisory tone type
@@ -937,6 +942,16 @@ const unsigned char /*tone_type*/ ToneGenerator::sToneMappingTable[NUM_REGIONS-1
            TONE_SUP_ERROR,              // TONE_SUP_ERROR
            TONE_SUP_ERROR,              // TONE_SUP_ERROR
            TONE_INDIA_CALL_WAITING,     // TONE_SUP_CALL_WAITING
            TONE_INDIA_CALL_WAITING,     // TONE_SUP_CALL_WAITING
            TONE_INDIA_RINGTONE          // TONE_SUP_RINGTONE
            TONE_INDIA_RINGTONE          // TONE_SUP_RINGTONE
        },
        {   // TAIWAN
            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_TW_RINGTONE             // TONE_SUP_RINGTONE
        }
        }
};
};


@@ -1010,6 +1025,8 @@ ToneGenerator::ToneGenerator(audio_stream_type_t streamType, float volume, bool
        mRegion = IRELAND;
        mRegion = IRELAND;
    } else if (strstr(value, "in") != NULL) {
    } else if (strstr(value, "in") != NULL) {
        mRegion = INDIA;
        mRegion = INDIA;
    } else if (strstr(value, "tw") != NULL) {
        mRegion = TAIWAN;
    } else {
    } else {
        mRegion = CEPT;
        mRegion = CEPT;
    }
    }
+2 −0
Original line number Original line Diff line number Diff line
@@ -218,6 +218,7 @@ private:
        TONE_INDIA_CONGESTION,      // Congestion tone: 400 Hz, 250ms ON, 250ms OFF...
        TONE_INDIA_CONGESTION,      // Congestion tone: 400 Hz, 250ms ON, 250ms OFF...
        TONE_INDIA_CALL_WAITING,    // Call waiting tone: 400 Hz, tone repeated in a 0.2s on, 0.1s off, 0.2s on, 7.5s off pattern.
        TONE_INDIA_CALL_WAITING,    // Call waiting tone: 400 Hz, tone repeated in a 0.2s on, 0.1s off, 0.2s on, 7.5s off pattern.
        TONE_INDIA_RINGTONE,        // Ring tone: 400 Hz tone modulated with 25Hz, 0.4 on 0.2 off 0.4 on 2..0 off
        TONE_INDIA_RINGTONE,        // Ring tone: 400 Hz tone modulated with 25Hz, 0.4 on 0.2 off 0.4 on 2..0 off
        TONE_TW_RINGTONE,           // Ring Tone: 440 Hz + 480 Hz repeated with pattern 1s on, 3s off.
        NUM_ALTERNATE_TONES
        NUM_ALTERNATE_TONES
    };
    };


@@ -230,6 +231,7 @@ private:
        HONGKONG,
        HONGKONG,
        IRELAND,
        IRELAND,
        INDIA,
        INDIA,
        TAIWAN,
        CEPT,
        CEPT,
        NUM_REGIONS
        NUM_REGIONS
    };
    };