diff options
author | Eric Laurent <elaurent@google.com> | 2014-08-01 17:00:54 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2014-08-01 19:00:08 -0700 |
commit | 222260168c144cca5a4e8f1c79df8c8baa22b591 (patch) | |
tree | 329aee444eb92704a2e5154254dc8b3e415a2f8d | |
parent | 25644c502ed8ec13bcf496613e65ec8edb1af4a7 (diff) | |
download | frameworks_av-222260168c144cca5a4e8f1c79df8c8baa22b591.zip frameworks_av-222260168c144cca5a4e8f1c79df8c8baa22b591.tar.gz frameworks_av-222260168c144cca5a4e8f1c79df8c8baa22b591.tar.bz2 |
audio policy: fix service fuzz test crash
Bug: 13744391.
Change-Id: I2430e09ad00476b9ac28dc55466942c61fb0531d
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.cpp | 8 |
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; |