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

Commit 1e36cfab authored by Ravi Kumar Alamanda's avatar Ravi Kumar Alamanda Committed by Steve Kondik
Browse files

framworks/base: Changes to use MVS path for VoIP feature

- These changes are merged from GB commit
  3926cd8fea11e65f47272c2099a5a540ab46b580

Change-Id: I9bc09e3f82741db394bf5e9585e9e35a454112e5
parent 524c0d41
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -54,6 +54,18 @@ status_t AudioTrack::getMinFrameCount(
        int streamType,
        uint32_t sampleRate)
{
#ifdef QCOM_HARDWARE
    if(streamType == AUDIO_STREAM_VOICE_CALL) {
        LOGV("AudioTrack :: getMinFramecount voice call \n");
        if(sampleRate == 8000) {
            *frameCount = 160;
        } else if (sampleRate == 16000) {
            *frameCount = 320;
        }
        return NO_ERROR;
    }
#endif

    int afSampleRate;
    if (AudioSystem::getOutputSamplingRate(&afSampleRate, streamType) != NO_ERROR) {
        return NO_INIT;
+8 −1
Original line number Diff line number Diff line
@@ -870,8 +870,11 @@ bool AudioGroup::DeviceThread::threadLoop()
        int16_t input[sampleCount];
        int toWrite = sampleCount;
        int toRead = (mode == MUTED) ? 0 : sampleCount;
#ifdef QCOM_HARDWARE
        int chances = 10000;
#else
        int chances = 100;

#endif
        while (--chances > 0 && (toWrite > 0 || toRead > 0)) {
            if (toWrite > 0) {
                AudioTrack::Buffer buffer;
@@ -985,7 +988,11 @@ void add(JNIEnv *env, jobject thiz, jint mode,
    if (!group) {
        int mode = env->GetIntField(thiz, gMode);
        group = new AudioGroup;
#ifdef QCOM_HARDWARE
        if (!group->set(sampleRate, sampleCount) || !group->setMode(mode)) {
#else
        if (!group->set(8000, 256) || !group->setMode(mode)) {
#endif
            jniThrowException(env, "java/lang/IllegalStateException",
                "cannot initialize audio group");
            goto error;