Loading include/media/AudioSystem.h +6 −2 Original line number Diff line number Diff line Loading @@ -170,8 +170,12 @@ public: static status_t initStreamVolume(audio_stream_type_t stream, int indexMin, int indexMax); static status_t setStreamVolumeIndex(audio_stream_type_t stream, int index); static status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index); static status_t setStreamVolumeIndex(audio_stream_type_t stream, int index, audio_devices_t device); static status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index, audio_devices_t device); static uint32_t getStrategyForStream(audio_stream_type_t stream); static uint32_t getDevicesForStream(audio_stream_type_t stream); Loading include/media/IAudioPolicyService.h +6 −2 Original line number Diff line number Diff line Loading @@ -73,8 +73,12 @@ public: virtual status_t initStreamVolume(audio_stream_type_t stream, int indexMin, int indexMax) = 0; virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, int index) = 0; virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index) = 0; virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, int index, audio_devices_t device) = 0; virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index, audio_devices_t device) = 0; virtual uint32_t getStrategyForStream(audio_stream_type_t stream) = 0; virtual uint32_t getDevicesForStream(audio_stream_type_t stream) = 0; virtual audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc) = 0; Loading media/libmedia/AudioSystem.cpp +8 −4 Original line number Diff line number Diff line Loading @@ -668,18 +668,22 @@ status_t AudioSystem::initStreamVolume(audio_stream_type_t stream, return aps->initStreamVolume(stream, indexMin, indexMax); } status_t AudioSystem::setStreamVolumeIndex(audio_stream_type_t stream, int index) status_t AudioSystem::setStreamVolumeIndex(audio_stream_type_t stream, int index, audio_devices_t device) { const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service(); if (aps == 0) return PERMISSION_DENIED; return aps->setStreamVolumeIndex(stream, index); return aps->setStreamVolumeIndex(stream, index, device); } status_t AudioSystem::getStreamVolumeIndex(audio_stream_type_t stream, int *index) status_t AudioSystem::getStreamVolumeIndex(audio_stream_type_t stream, int *index, audio_devices_t device) { const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service(); if (aps == 0) return PERMISSION_DENIED; return aps->getStreamVolumeIndex(stream, index); return aps->getStreamVolumeIndex(stream, index, device); } uint32_t AudioSystem::getStrategyForStream(audio_stream_type_t stream) Loading media/libmedia/IAudioPolicyService.cpp +15 −4 Original line number Diff line number Diff line Loading @@ -240,21 +240,28 @@ public: return static_cast <status_t> (reply.readInt32()); } virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, int index) virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, int index, audio_devices_t device) { Parcel data, reply; data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor()); data.writeInt32(static_cast <uint32_t>(stream)); data.writeInt32(index); data.writeInt32(static_cast <uint32_t>(device)); remote()->transact(SET_STREAM_VOLUME, data, &reply); return static_cast <status_t> (reply.readInt32()); } virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index) virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index, audio_devices_t device) { Parcel data, reply; data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor()); data.writeInt32(static_cast <uint32_t>(stream)); data.writeInt32(static_cast <uint32_t>(device)); remote()->transact(GET_STREAM_VOLUME, data, &reply); int lIndex = reply.readInt32(); if (index) *index = lIndex; Loading Loading @@ -525,7 +532,10 @@ status_t BnAudioPolicyService::onTransact( audio_stream_type_t stream = static_cast <audio_stream_type_t>(data.readInt32()); int index = data.readInt32(); reply->writeInt32(static_cast <uint32_t>(setStreamVolumeIndex(stream, index))); audio_devices_t device = static_cast <audio_devices_t>(data.readInt32()); reply->writeInt32(static_cast <uint32_t>(setStreamVolumeIndex(stream, index, device))); return NO_ERROR; } break; Loading @@ -533,8 +543,9 @@ status_t BnAudioPolicyService::onTransact( CHECK_INTERFACE(IAudioPolicyService, data, reply); audio_stream_type_t stream = static_cast <audio_stream_type_t>(data.readInt32()); audio_devices_t device = static_cast <audio_devices_t>(data.readInt32()); int index; status_t status = getStreamVolumeIndex(stream, &index); status_t status = getStreamVolumeIndex(stream, &index, device); reply->writeInt32(index); reply->writeInt32(static_cast <uint32_t>(status)); return NO_ERROR; Loading services/audioflinger/AudioPolicyService.cpp +22 −4 Original line number Diff line number Diff line Loading @@ -407,7 +407,9 @@ status_t AudioPolicyService::initStreamVolume(audio_stream_type_t stream, return NO_ERROR; } status_t AudioPolicyService::setStreamVolumeIndex(audio_stream_type_t stream, int index) status_t AudioPolicyService::setStreamVolumeIndex(audio_stream_type_t stream, int index, audio_devices_t device) { if (mpAudioPolicy == NULL) { return NO_INIT; Loading @@ -419,10 +421,19 @@ status_t AudioPolicyService::setStreamVolumeIndex(audio_stream_type_t stream, in return BAD_VALUE; } if (mpAudioPolicy->set_stream_volume_index_for_device) { return mpAudioPolicy->set_stream_volume_index_for_device(mpAudioPolicy, stream, index, device); } else { return mpAudioPolicy->set_stream_volume_index(mpAudioPolicy, stream, index); } } status_t AudioPolicyService::getStreamVolumeIndex(audio_stream_type_t stream, int *index) status_t AudioPolicyService::getStreamVolumeIndex(audio_stream_type_t stream, int *index, audio_devices_t device) { if (mpAudioPolicy == NULL) { return NO_INIT; Loading @@ -430,8 +441,15 @@ status_t AudioPolicyService::getStreamVolumeIndex(audio_stream_type_t stream, in if (uint32_t(stream) >= AUDIO_STREAM_CNT) { return BAD_VALUE; } if (mpAudioPolicy->get_stream_volume_index_for_device) { return mpAudioPolicy->get_stream_volume_index_for_device(mpAudioPolicy, stream, index, device); } else { return mpAudioPolicy->get_stream_volume_index(mpAudioPolicy, stream, index); } } uint32_t AudioPolicyService::getStrategyForStream(audio_stream_type_t stream) { Loading Loading
include/media/AudioSystem.h +6 −2 Original line number Diff line number Diff line Loading @@ -170,8 +170,12 @@ public: static status_t initStreamVolume(audio_stream_type_t stream, int indexMin, int indexMax); static status_t setStreamVolumeIndex(audio_stream_type_t stream, int index); static status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index); static status_t setStreamVolumeIndex(audio_stream_type_t stream, int index, audio_devices_t device); static status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index, audio_devices_t device); static uint32_t getStrategyForStream(audio_stream_type_t stream); static uint32_t getDevicesForStream(audio_stream_type_t stream); Loading
include/media/IAudioPolicyService.h +6 −2 Original line number Diff line number Diff line Loading @@ -73,8 +73,12 @@ public: virtual status_t initStreamVolume(audio_stream_type_t stream, int indexMin, int indexMax) = 0; virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, int index) = 0; virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index) = 0; virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, int index, audio_devices_t device) = 0; virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index, audio_devices_t device) = 0; virtual uint32_t getStrategyForStream(audio_stream_type_t stream) = 0; virtual uint32_t getDevicesForStream(audio_stream_type_t stream) = 0; virtual audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc) = 0; Loading
media/libmedia/AudioSystem.cpp +8 −4 Original line number Diff line number Diff line Loading @@ -668,18 +668,22 @@ status_t AudioSystem::initStreamVolume(audio_stream_type_t stream, return aps->initStreamVolume(stream, indexMin, indexMax); } status_t AudioSystem::setStreamVolumeIndex(audio_stream_type_t stream, int index) status_t AudioSystem::setStreamVolumeIndex(audio_stream_type_t stream, int index, audio_devices_t device) { const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service(); if (aps == 0) return PERMISSION_DENIED; return aps->setStreamVolumeIndex(stream, index); return aps->setStreamVolumeIndex(stream, index, device); } status_t AudioSystem::getStreamVolumeIndex(audio_stream_type_t stream, int *index) status_t AudioSystem::getStreamVolumeIndex(audio_stream_type_t stream, int *index, audio_devices_t device) { const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service(); if (aps == 0) return PERMISSION_DENIED; return aps->getStreamVolumeIndex(stream, index); return aps->getStreamVolumeIndex(stream, index, device); } uint32_t AudioSystem::getStrategyForStream(audio_stream_type_t stream) Loading
media/libmedia/IAudioPolicyService.cpp +15 −4 Original line number Diff line number Diff line Loading @@ -240,21 +240,28 @@ public: return static_cast <status_t> (reply.readInt32()); } virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, int index) virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, int index, audio_devices_t device) { Parcel data, reply; data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor()); data.writeInt32(static_cast <uint32_t>(stream)); data.writeInt32(index); data.writeInt32(static_cast <uint32_t>(device)); remote()->transact(SET_STREAM_VOLUME, data, &reply); return static_cast <status_t> (reply.readInt32()); } virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index) virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index, audio_devices_t device) { Parcel data, reply; data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor()); data.writeInt32(static_cast <uint32_t>(stream)); data.writeInt32(static_cast <uint32_t>(device)); remote()->transact(GET_STREAM_VOLUME, data, &reply); int lIndex = reply.readInt32(); if (index) *index = lIndex; Loading Loading @@ -525,7 +532,10 @@ status_t BnAudioPolicyService::onTransact( audio_stream_type_t stream = static_cast <audio_stream_type_t>(data.readInt32()); int index = data.readInt32(); reply->writeInt32(static_cast <uint32_t>(setStreamVolumeIndex(stream, index))); audio_devices_t device = static_cast <audio_devices_t>(data.readInt32()); reply->writeInt32(static_cast <uint32_t>(setStreamVolumeIndex(stream, index, device))); return NO_ERROR; } break; Loading @@ -533,8 +543,9 @@ status_t BnAudioPolicyService::onTransact( CHECK_INTERFACE(IAudioPolicyService, data, reply); audio_stream_type_t stream = static_cast <audio_stream_type_t>(data.readInt32()); audio_devices_t device = static_cast <audio_devices_t>(data.readInt32()); int index; status_t status = getStreamVolumeIndex(stream, &index); status_t status = getStreamVolumeIndex(stream, &index, device); reply->writeInt32(index); reply->writeInt32(static_cast <uint32_t>(status)); return NO_ERROR; Loading
services/audioflinger/AudioPolicyService.cpp +22 −4 Original line number Diff line number Diff line Loading @@ -407,7 +407,9 @@ status_t AudioPolicyService::initStreamVolume(audio_stream_type_t stream, return NO_ERROR; } status_t AudioPolicyService::setStreamVolumeIndex(audio_stream_type_t stream, int index) status_t AudioPolicyService::setStreamVolumeIndex(audio_stream_type_t stream, int index, audio_devices_t device) { if (mpAudioPolicy == NULL) { return NO_INIT; Loading @@ -419,10 +421,19 @@ status_t AudioPolicyService::setStreamVolumeIndex(audio_stream_type_t stream, in return BAD_VALUE; } if (mpAudioPolicy->set_stream_volume_index_for_device) { return mpAudioPolicy->set_stream_volume_index_for_device(mpAudioPolicy, stream, index, device); } else { return mpAudioPolicy->set_stream_volume_index(mpAudioPolicy, stream, index); } } status_t AudioPolicyService::getStreamVolumeIndex(audio_stream_type_t stream, int *index) status_t AudioPolicyService::getStreamVolumeIndex(audio_stream_type_t stream, int *index, audio_devices_t device) { if (mpAudioPolicy == NULL) { return NO_INIT; Loading @@ -430,8 +441,15 @@ status_t AudioPolicyService::getStreamVolumeIndex(audio_stream_type_t stream, in if (uint32_t(stream) >= AUDIO_STREAM_CNT) { return BAD_VALUE; } if (mpAudioPolicy->get_stream_volume_index_for_device) { return mpAudioPolicy->get_stream_volume_index_for_device(mpAudioPolicy, stream, index, device); } else { return mpAudioPolicy->get_stream_volume_index(mpAudioPolicy, stream, index); } } uint32_t AudioPolicyService::getStrategyForStream(audio_stream_type_t stream) { Loading