Implement use of Device.setConnectedState/_7_1 HAL method
Add 'Device.setConnectedState' to libaudiohal. It tries
to use Device.setConnectedState_7_1 when supported, or
fallbacks to Device.setConnectedState.
Remove direct use of setParameters from the framework
code. Add required plumbing between APM and AF.
Bug: 211601178
Test: on the device, check that HAL still receives the update
Change-Id: Ic9ac6fbea6ceea7db504d9c962392d90e21f57cb
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 8c546cc..59f22eb 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -290,6 +290,8 @@
virtual int32_t getAAudioHardwareBurstMinUsec();
+ virtual status_t setDeviceConnectedState(const struct audio_port_v7 *port, bool connected);
+
status_t onTransactWrapper(TransactionCode code, const Parcel& data, uint32_t flags,
const std::function<status_t()>& delegate) override;
@@ -912,6 +914,7 @@
AUDIO_HW_SET_MASTER_MUTE, // set_master_mute
AUDIO_HW_GET_MASTER_MUTE, // get_master_mute
AUDIO_HW_GET_MICROPHONES, // getMicrophones
+ AUDIO_HW_SET_CONNECTED_STATE, // setConnectedState
};
mutable hardware_call_state mHardwareStatus; // for dump only