Fix issue 2174002: After rejecting Call when device ringtone is mute and playing music, audio is not transfered to BT device.
Added a workarouond to request the A2DP output standby directly to audio hardware when the sink is suspended as it seems that the suspend request often fails.
Also take into account resume requests received while a suspend request is pending.
diff --git a/libs/audioflinger/A2dpAudioInterface.h b/libs/audioflinger/A2dpAudioInterface.h
index 35a6e11..530e432 100644
--- a/libs/audioflinger/A2dpAudioInterface.h
+++ b/libs/audioflinger/A2dpAudioInterface.h
@@ -101,6 +101,7 @@
status_t close_l();
status_t setAddress(const char* address);
status_t setBluetoothEnabled(bool enabled);
+ status_t setSuspended(bool onOff);
private:
int mFd;
@@ -113,6 +114,7 @@
bool mBluetoothEnabled;
uint32_t mDevice;
bool mClosing;
+ bool mSuspended;
};
friend class A2dpAudioStreamOut;
@@ -121,6 +123,7 @@
AudioHardwareInterface *mHardwareInterface;
char mA2dpAddress[20];
bool mBluetoothEnabled;
+ bool mSuspended;
};