summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioSystem.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-09-02 14:20:56 -0700
committerEric Laurent <elaurent@google.com>2011-09-02 15:59:50 -0700
commitdca56b9432e2cc851d1a58920071fed2e1e3d142 (patch)
treedec365b40e97c1e8331db5e0174548251aebdb92 /media/libmedia/AudioSystem.cpp
parent5afd2bd02ae44d5a38f9e560047723ddab176405 (diff)
downloadframeworks_base-dca56b9432e2cc851d1a58920071fed2e1e3d142.zip
frameworks_base-dca56b9432e2cc851d1a58920071fed2e1e3d142.tar.gz
frameworks_base-dca56b9432e2cc851d1a58920071fed2e1e3d142.tar.bz2
Fix issue 5252593: any app can restart the runtime
Replace null device address string by empty sting. Change-Id: I285c35f3345334e6d2190493b1a8a5aca1a361a4
Diffstat (limited to 'media/libmedia/AudioSystem.cpp')
-rw-r--r--media/libmedia/AudioSystem.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp
index 853a5f6..7b14c18 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<IAudioPolicyService>& 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,