audio policy: broadcast device connect event before refreshing profiles
This patch broadcasts the connect device event before checking and reloading
capabilities of profiles.
It allows the HAL implementor to use connect / disconnect event to respectively
load / reset capabilities of devices that has dynamic capabilities (e.g. HDMI).
Change-Id: Ie0533da25fed89cb9e5bbfc5b1fc886b3176837d
Signed-off-by: François Gaffie <francois.gaffie@intel.com>
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.h b/services/audiopolicy/managerdefault/AudioPolicyManager.h
index bbdf396..ebf9315 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.h
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.h
@@ -572,6 +572,15 @@
// Audio Policy Engine Interface.
AudioPolicyManagerInterface *mEngine;
private:
+ // Notify the policy client of any change of device state with AUDIO_IO_HANDLE_NONE,
+ // so that the client interprets it as global to audio hardware interfaces.
+ // It can give a chance to HAL implementer to retrieve dynamic capabilities associated
+ // to this device for example.
+ // TODO avoid opening stream to retrieve capabilities of a profile.
+ void broadcastDeviceConnectionState(audio_devices_t device,
+ audio_policy_dev_state_t state,
+ const String8 &device_address);
+
// updates device caching and output for streams that can influence the
// routing of notifications
void handleNotificationRoutingForStream(audio_stream_type_t stream);