diff options
author | Eric Laurent <elaurent@google.com> | 2014-10-30 14:59:13 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2014-10-30 15:04:19 -0700 |
commit | b1322c78b035c9f47ebe57a39799d7a0e13bf57f (patch) | |
tree | eb4177002d445d59b1d20afa5a31f72ac2838d24 /services/audiopolicy | |
parent | 8e05b5f5f45b8d6931ff830969125a42428c6830 (diff) | |
download | frameworks_av-b1322c78b035c9f47ebe57a39799d7a0e13bf57f.zip frameworks_av-b1322c78b035c9f47ebe57a39799d7a0e13bf57f.tar.gz frameworks_av-b1322c78b035c9f47ebe57a39799d7a0e13bf57f.tar.bz2 |
audio policy: fix commit dea1541f
Fix return types in early returns added by
commit dea1541f in AudioPolicy binder call methods.
Also fix former similar mistakes found nearby.
Bug: 18001784.
Bug: 18002005.
Change-Id: I088c6029ca04e2c2c2f78e560c9cb6b9576dd88f
Diffstat (limited to 'services/audiopolicy')
-rw-r--r-- | services/audiopolicy/AudioPolicyInterfaceImpl.cpp | 18 | ||||
-rw-r--r-- | services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp | 18 |
2 files changed, 18 insertions, 18 deletions
diff --git a/services/audiopolicy/AudioPolicyInterfaceImpl.cpp b/services/audiopolicy/AudioPolicyInterfaceImpl.cpp index be3c5ad..c06ca72 100644 --- a/services/audiopolicy/AudioPolicyInterfaceImpl.cpp +++ b/services/audiopolicy/AudioPolicyInterfaceImpl.cpp @@ -130,10 +130,10 @@ audio_io_handle_t AudioPolicyService::getOutput(audio_stream_type_t stream, const audio_offload_info_t *offloadInfo) { if (uint32_t(stream) >= AUDIO_STREAM_CNT) { - return BAD_VALUE; + return AUDIO_IO_HANDLE_NONE; } if (mAudioPolicyManager == NULL) { - return 0; + return AUDIO_IO_HANDLE_NONE; } ALOGV("getOutput()"); Mutex::Autolock _l(mLock); @@ -378,7 +378,7 @@ status_t AudioPolicyService::getStreamVolumeIndex(audio_stream_type_t stream, uint32_t AudioPolicyService::getStrategyForStream(audio_stream_type_t stream) { if (uint32_t(stream) >= AUDIO_STREAM_CNT) { - return BAD_VALUE; + return 0; } if (mAudioPolicyManager == NULL) { return 0; @@ -391,10 +391,10 @@ uint32_t AudioPolicyService::getStrategyForStream(audio_stream_type_t stream) audio_devices_t AudioPolicyService::getDevicesForStream(audio_stream_type_t stream) { if (uint32_t(stream) >= AUDIO_STREAM_CNT) { - return BAD_VALUE; + return AUDIO_DEVICE_NONE; } if (mAudioPolicyManager == NULL) { - return (audio_devices_t)0; + return AUDIO_DEVICE_NONE; } return mAudioPolicyManager->getDevicesForStream(stream); } @@ -440,10 +440,10 @@ status_t AudioPolicyService::setEffectEnabled(int id, bool enabled) bool AudioPolicyService::isStreamActive(audio_stream_type_t stream, uint32_t inPastMs) const { if (uint32_t(stream) >= AUDIO_STREAM_CNT) { - return BAD_VALUE; + return false; } if (mAudioPolicyManager == NULL) { - return 0; + return false; } Mutex::Autolock _l(mLock); return mAudioPolicyManager->isStreamActive(stream, inPastMs); @@ -452,10 +452,10 @@ bool AudioPolicyService::isStreamActive(audio_stream_type_t stream, uint32_t inP bool AudioPolicyService::isStreamActiveRemotely(audio_stream_type_t stream, uint32_t inPastMs) const { if (uint32_t(stream) >= AUDIO_STREAM_CNT) { - return BAD_VALUE; + return false; } if (mAudioPolicyManager == NULL) { - return 0; + return false; } Mutex::Autolock _l(mLock); return mAudioPolicyManager->isStreamActiveRemotely(stream, inPastMs); diff --git a/services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp b/services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp index 3700246..09476c1 100644 --- a/services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp +++ b/services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp @@ -135,10 +135,10 @@ audio_io_handle_t AudioPolicyService::getOutput(audio_stream_type_t stream, const audio_offload_info_t *offloadInfo) { if (uint32_t(stream) >= AUDIO_STREAM_CNT) { - return BAD_VALUE; + return AUDIO_IO_HANDLE_NONE; } if (mpAudioPolicy == NULL) { - return 0; + return AUDIO_IO_HANDLE_NONE; } ALOGV("getOutput()"); Mutex::Autolock _l(mLock); @@ -380,7 +380,7 @@ status_t AudioPolicyService::getStreamVolumeIndex(audio_stream_type_t stream, uint32_t AudioPolicyService::getStrategyForStream(audio_stream_type_t stream) { if (uint32_t(stream) >= AUDIO_STREAM_CNT) { - return BAD_VALUE; + return 0; } if (mpAudioPolicy == NULL) { return 0; @@ -393,10 +393,10 @@ uint32_t AudioPolicyService::getStrategyForStream(audio_stream_type_t stream) audio_devices_t AudioPolicyService::getDevicesForStream(audio_stream_type_t stream) { if (uint32_t(stream) >= AUDIO_STREAM_CNT) { - return BAD_VALUE; + return AUDIO_DEVICE_NONE; } if (mpAudioPolicy == NULL) { - return (audio_devices_t)0; + return AUDIO_DEVICE_NONE; } return mpAudioPolicy->get_devices_for_stream(mpAudioPolicy, stream); } @@ -442,10 +442,10 @@ status_t AudioPolicyService::setEffectEnabled(int id, bool enabled) bool AudioPolicyService::isStreamActive(audio_stream_type_t stream, uint32_t inPastMs) const { if (uint32_t(stream) >= AUDIO_STREAM_CNT) { - return BAD_VALUE; + return false; } if (mpAudioPolicy == NULL) { - return 0; + return false; } Mutex::Autolock _l(mLock); return mpAudioPolicy->is_stream_active(mpAudioPolicy, stream, inPastMs); @@ -454,10 +454,10 @@ bool AudioPolicyService::isStreamActive(audio_stream_type_t stream, uint32_t inP bool AudioPolicyService::isStreamActiveRemotely(audio_stream_type_t stream, uint32_t inPastMs) const { if (uint32_t(stream) >= AUDIO_STREAM_CNT) { - return BAD_VALUE; + return false; } if (mpAudioPolicy == NULL) { - return 0; + return false; } Mutex::Autolock _l(mLock); return mpAudioPolicy->is_stream_active_remotely(mpAudioPolicy, stream, inPastMs); |