diff options
author | Eric Laurent <elaurent@google.com> | 2015-02-04 17:25:40 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-02-04 17:25:40 +0000 |
commit | 7bc903581f879c86f3881a2f7563bd28c1ac29b7 (patch) | |
tree | b63e33c63c7fc7c8febf5b6912cf6dc010e66a9c /services/audiopolicy | |
parent | 07840f7544de883fe5c00cbd18bc6458a20e2691 (diff) | |
parent | 5d46bd54a279f24d0476b83947ce29e786b5c72c (diff) | |
download | frameworks_av-7bc903581f879c86f3881a2f7563bd28c1ac29b7.zip frameworks_av-7bc903581f879c86f3881a2f7563bd28c1ac29b7.tar.gz frameworks_av-7bc903581f879c86f3881a2f7563bd28c1ac29b7.tar.bz2 |
am 5d46bd54: am 3ae5f313: audiopolicy: send device connect notification to HALs
* commit '5d46bd54a279f24d0476b83947ce29e786b5c72c':
audiopolicy: send device connect notification to HALs
Diffstat (limited to 'services/audiopolicy')
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp index a58d60c..7f27659 100644 --- a/services/audiopolicy/AudioPolicyManager.cpp +++ b/services/audiopolicy/AudioPolicyManager.cpp @@ -242,7 +242,7 @@ status_t AudioPolicyManager::setDeviceConnectionStateInt(audio_devices_t device, switch (state) { // handle output device connection - case AUDIO_POLICY_DEVICE_STATE_AVAILABLE: + case AUDIO_POLICY_DEVICE_STATE_AVAILABLE: { if (index >= 0) { ALOGW("setDeviceConnectionState() device already connected: %x", device); return INVALID_OPERATION; @@ -274,7 +274,14 @@ status_t AudioPolicyManager::setDeviceConnectionStateInt(audio_devices_t device, "checkOutputsForDevice() returned no outputs but status OK"); ALOGV("setDeviceConnectionState() checkOutputsForDevice() returned %zu outputs", outputs.size()); - break; + + + // Set connect to HALs + AudioParameter param = AudioParameter(devDesc->mAddress); + param.addInt(String8(AUDIO_PARAMETER_DEVICE_CONNECT), device); + mpClientInterface->setParameters(AUDIO_IO_HANDLE_NONE, param.toString()); + + } break; // handle output device disconnection case AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE: { if (index < 0) { @@ -375,6 +382,12 @@ status_t AudioPolicyManager::setDeviceConnectionStateInt(audio_devices_t device, } else { return NO_MEMORY; } + + // Set connect to HALs + AudioParameter param = AudioParameter(devDesc->mAddress); + param.addInt(String8(AUDIO_PARAMETER_DEVICE_CONNECT), device); + mpClientInterface->setParameters(AUDIO_IO_HANDLE_NONE, param.toString()); + } break; // handle input device disconnection |