am e5326d96: Merge "DO NOT MERGE - audio policy: fix commit dea1541f" into lmp-dev
* commit 'e5326d965afc8941f85c866ae8dcdc8884c9709c':
DO NOT MERGE - audio policy: fix commit dea1541f
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 @@
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 @@
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 @@
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 @@
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::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 @@
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 @@
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 @@
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 @@
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::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);