DO NOT MERGE - 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
diff --git a/services/audiopolicy/AudioPolicyInterfaceImpl.cpp b/services/audiopolicy/AudioPolicyInterfaceImpl.cpp
index 424605d..9639c6d 100644
--- a/services/audiopolicy/AudioPolicyInterfaceImpl.cpp
+++ b/services/audiopolicy/AudioPolicyInterfaceImpl.cpp
@@ -130,10 +130,10 @@
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);
@@ -376,7 +376,7 @@
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;
@@ -389,10 +389,10 @@
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);
}
@@ -438,10 +438,10 @@
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);
@@ -450,10 +450,10 @@
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);