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

Commit 7a713270 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Gerrit Code Review
Browse files

Merge "audioflinger: Add support for the LGE star's FM radio" into gingerbread

parents 45c96327 f2a9c771
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -477,6 +477,13 @@ status_t AudioFlinger::setMode(int mode)
        return BAD_VALUE;
    }

#ifdef HAS_LGE_STAR_FM_RADIO
    if (mode == AudioSystem::MODE_FM) {
        mFmOn = true;
    } else if (mFmOn) {
        mFmOn = false;
    }
#endif
    { // scope for the lock
        AutoMutex lock(mHardwareLock);
        mHardwareStatus = AUDIO_HW_SET_MODE;
@@ -680,7 +687,7 @@ status_t AudioFlinger::setParameters(int ioHandle, const String8& keyValuePairs)
        }
    }
#endif
#ifdef HAVE_FM_RADIO
#if defined(HAVE_FM_RADIO) && !defined(HAS_LGE_STAR_FM_RADIO)
    AudioParameter param = AudioParameter(keyValuePairs);
    String8 key = String8(AudioParameter::keyRouting);
    int device;
+17 −0
Original line number Diff line number Diff line
@@ -124,6 +124,16 @@ status_t AudioPolicyService::setDeviceConnectionState(AudioSystem::audio_devices
        return BAD_VALUE;
    }

#ifdef HAS_LGE_STAR_FM_RADIO
    if (device & AudioSystem::DEVICE_OUT_FM) {
        if (state == AudioSystem::DEVICE_STATE_AVAILABLE) {
            setPhoneState(AudioSystem::MODE_FM);
        } else {
            setPhoneState(AudioSystem::MODE_NORMAL);
        }
    }
#endif

    LOGV("setDeviceConnectionState() tid %d", gettid());
    Mutex::Autolock _l(mLock);
    return mpPolicyManager->setDeviceConnectionState(device, state, device_address);
@@ -325,6 +335,13 @@ status_t AudioPolicyService::setStreamVolumeIndex(AudioSystem::stream_type strea
    if (!checkPermission()) {
        return PERMISSION_DENIED;
    }
#ifdef HAS_LGE_STAR_FM_RADIO
    /* The star's audio HAL has STREAM_FM as 8. The java layer
     * sends CM's "standard" STREAM_FM as 10, convert it here */
    if (stream == AudioSystem::FM) {
        stream=(AudioSystem::stream_type)8;
    }
#endif
    if (stream < 0 || stream >= AudioSystem::NUM_STREAM_TYPES) {
        return BAD_VALUE;
    }