diff options
author | Eric Laurent <elaurent@google.com> | 2015-02-04 17:18:59 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-02-04 17:18:59 +0000 |
commit | 5d46bd54a279f24d0476b83947ce29e786b5c72c (patch) | |
tree | 059dbae05f8fdaaa3cf3dd68b246deb2cebeea76 /services/audiopolicy | |
parent | 3a7ed550579b5ecd99439c44ce13a48b3f0639ae (diff) | |
parent | 3ae5f31393609b7fa92f24132c66e9a8c9244a45 (diff) | |
download | frameworks_av-5d46bd54a279f24d0476b83947ce29e786b5c72c.zip frameworks_av-5d46bd54a279f24d0476b83947ce29e786b5c72c.tar.gz frameworks_av-5d46bd54a279f24d0476b83947ce29e786b5c72c.tar.bz2 |
am 3ae5f313: audiopolicy: send device connect notification to HALs
* commit '3ae5f31393609b7fa92f24132c66e9a8c9244a45':
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 |