From 71b63e3ef687c379368be6b02e70bd2feb0b6b8d Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 2 Sep 2011 14:20:56 -0700 Subject: [PATCH] Fix issue 5252593: any app can restart the runtime Replace null device address string by empty sting. Change-Id: I285c35f3345334e6d2190493b1a8a5aca1a361a4 --- media/libmedia/AudioSystem.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp index 853a5f6b4b..7b14c183b6 100644 --- a/media/libmedia/AudioSystem.cpp +++ b/media/libmedia/AudioSystem.cpp @@ -511,9 +511,15 @@ status_t AudioSystem::setDeviceConnectionState(audio_devices_t device, const char *device_address) { const sp& aps = AudioSystem::get_audio_policy_service(); + const char *address = ""; + if (aps == 0) return PERMISSION_DENIED; - return aps->setDeviceConnectionState(device, state, device_address); + if (device_address != NULL) { + address = device_address; + } + + return aps->setDeviceConnectionState(device, state, address); } audio_policy_dev_state_t AudioSystem::getDeviceConnectionState(audio_devices_t device, -- 2.11.0