diff options
author | Eric Laurent <elaurent@google.com> | 2015-02-03 17:12:08 -0800 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2015-02-04 08:56:31 -0800 |
commit | 3ae5f31393609b7fa92f24132c66e9a8c9244a45 (patch) | |
tree | 059dbae05f8fdaaa3cf3dd68b246deb2cebeea76 /services/audiopolicy | |
parent | efbb61950db36a5eb789be83f077246172507c67 (diff) | |
download | frameworks_av-3ae5f31393609b7fa92f24132c66e9a8c9244a45.zip frameworks_av-3ae5f31393609b7fa92f24132c66e9a8c9244a45.tar.gz frameworks_av-3ae5f31393609b7fa92f24132c66e9a8c9244a45.tar.bz2 |
audiopolicy: send device connect notification to HALs
Device disconnect notifications are sent from audiopolicy to
the HALs. Send connect notifications as well.
Bug: 19249796.
Bug: 17785277.
Change-Id: Ia823ed154d6a0c7ceb84b0a94f0c3b78392faaf6
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 |