summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-08-03 19:45:07 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-01 01:46:21 +0000
commit678792e362c4cd70640934049491d9f21560c63b (patch)
treefa682cd9d9d25921bddb3be3c8bbac49cd91d29c /services
parentfacd8cf2651f7fcf7225e735cae5f5d4ef3a334e (diff)
parent222260168c144cca5a4e8f1c79df8c8baa22b591 (diff)
downloadframeworks_av-678792e362c4cd70640934049491d9f21560c63b.zip
frameworks_av-678792e362c4cd70640934049491d9f21560c63b.tar.gz
frameworks_av-678792e362c4cd70640934049491d9f21560c63b.tar.bz2
Merge "audio policy: fix service fuzz test crash" into lmp-dev
Diffstat (limited to 'services')
-rw-r--r--services/audiopolicy/AudioPolicyManager.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp
index 65d52d0..09595ff 100644
--- a/services/audiopolicy/AudioPolicyManager.cpp
+++ b/services/audiopolicy/AudioPolicyManager.cpp
@@ -206,9 +206,10 @@ status_t AudioPolicyManager::setDeviceConnectionState(audio_devices_t device,
audio_policy_dev_state_t state,
const char *device_address)
{
- String8 address = String8(device_address);
+ String8 address = (device_address == NULL) ? String8("") : String8(device_address);
- ALOGV("setDeviceConnectionState() device: %x, state %d, address %s", device, state, device_address);
+ ALOGV("setDeviceConnectionState() device: %x, state %d, address %s",
+ device, state, address.string());
// connect/disconnect only 1 device at a time
if (!audio_is_output_device(device) && !audio_is_input_device(device)) return BAD_VALUE;
@@ -376,9 +377,8 @@ audio_policy_dev_state_t AudioPolicyManager::getDeviceConnectionState(audio_devi
const char *device_address)
{
audio_policy_dev_state_t state = AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE;
- String8 address = String8(device_address);
sp<DeviceDescriptor> devDesc = new DeviceDescriptor(String8(""), device);
- devDesc->mAddress = String8(device_address);
+ devDesc->mAddress = (device_address == NULL) ? String8("") : String8(device_address);
ssize_t index;
DeviceVector *deviceVector;