Added ifndef ICS_AUDIO_BLOB around non-existent functions (3/3)
For older audio blobs where is_source_active and is_stream_active_remotely
doesn't exist, receiving a notification and dumpsys crashes the audio service.
Change-Id: I554f00ba7f171d2ea91627cae2281623383b3ca7
diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp
index dc503c4..ff03ede 100644
--- a/services/audioflinger/AudioPolicyService.cpp
+++ b/services/audioflinger/AudioPolicyService.cpp
@@ -521,15 +521,19 @@
bool AudioPolicyService::isStreamActiveRemotely(audio_stream_type_t stream, uint32_t inPastMs) const
{
+#ifndef ICS_AUDIO_BLOB
if (mpAudioPolicy == NULL) {
return 0;
}
Mutex::Autolock _l(mLock);
return mpAudioPolicy->is_stream_active_remotely(mpAudioPolicy, stream, inPastMs);
+#endif
+ return 0;
}
bool AudioPolicyService::isSourceActive(audio_source_t source) const
{
+#ifndef ICS_AUDIO_BLOB
if (mpAudioPolicy == NULL) {
return false;
}
@@ -538,6 +542,9 @@
}
Mutex::Autolock _l(mLock);
return mpAudioPolicy->is_source_active(mpAudioPolicy, source);
+#else
+ return false;
+#endif
}
status_t AudioPolicyService::queryDefaultPreProcessing(int audioSession,