Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a28457a authored by Sharad Sangle's avatar Sharad Sangle Committed by Fred Oh
Browse files

policy-hal: upgrade custom audio policy for concurrency

 this change contains all the change and fixes
  for concurrency feature went in audio policy made
  by QTI as below

 Audio: voice concurrency support for Bear family
 Change-Id: I6879081dd30969a7d1f162ea73b912442db2bef6

 audio_policy: Null check for output profile types
 Change-Id: I6abc2e28c93a6de9922a8ac7b2a81a477b3ea566

 audio: add support for VoIP & playback record concurrency
 Change-Id: Ia93a51f0d0d2cfdd447d73ce65bfc07965190ab4

 audio: Fix ringtone mute issue
 Change-Id: I2bcdcb2591942f48eac4635a3b36ee575787ee92

 audio: Fix for ringtone playback issue on USB AOA
 Change-Id: I323e80470e64b58a53d68ca57a29605768324e14

 audio: Fix for camcorder shutter playback issue on BT
 Change-Id: Ib6f46bacd70da5de5958f65d921c7c219a5b0dc1

 audiopolicy: fix crash in camcorder during voice call
 Change-Id: Id83111957dab04a3db396401547989db8e8ed573

Change-Id: I37d811a2c947b6ba333b5937ffd5c94fa50714b8
parent d71829cb
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -27,6 +27,14 @@ LOCAL_SHARED_LIBRARIES := \
LOCAL_STATIC_LIBRARIES := \
LOCAL_STATIC_LIBRARIES := \
    libmedia_helper \
    libmedia_helper \


ifeq ($(strip $(AUDIO_FEATURE_ENABLED_VOICE_CONCURRENCY)),true)
LOCAL_CFLAGS += -DVOICE_CONCURRENCY
endif

ifeq ($(strip $(AUDIO_FEATURE_ENABLED_RECORD_PLAY_CONCURRENCY)),true)
LOCAL_CFLAGS += -DRECORD_PLAY_CONCURRENCY
endif

LOCAL_MODULE := libaudiopolicymanager
LOCAL_MODULE := libaudiopolicymanager


include $(BUILD_SHARED_LIBRARY)
include $(BUILD_SHARED_LIBRARY)
+624 −4

File changed.

Preview size limit exceeded, changes collapsed.

+26 −5
Original line number Original line Diff line number Diff line
@@ -50,10 +50,7 @@ class AudioPolicyManagerCustom: public AudioPolicyManager
{
{


public:
public:
                AudioPolicyManagerCustom(AudioPolicyClientInterface *clientInterface)
        AudioPolicyManagerCustom(AudioPolicyClientInterface *clientInterface);
                : AudioPolicyManager(clientInterface) {
                    mHdmiAudioDisabled = false;
                    mHdmiAudioEvent = false;}


        virtual ~AudioPolicyManagerCustom() {}
        virtual ~AudioPolicyManagerCustom() {}


@@ -66,7 +63,22 @@ public:


        virtual bool isOffloadSupported(const audio_offload_info_t& offloadInfo);
        virtual bool isOffloadSupported(const audio_offload_info_t& offloadInfo);


        // true if given state represents a device in a telephony or VoIP call
        virtual status_t getInputForAttr(const audio_attributes_t *attr,
                                         audio_io_handle_t *input,
                                         audio_session_t session,
                                         uid_t uid,
                                         uint32_t samplingRate,
                                         audio_format_t format,
                                         audio_channel_mask_t channelMask,
                                         audio_input_flags_t flags,
                                         audio_port_handle_t selectedDeviceId,
                                         input_type_t *inputType);
        // indicates to the audio policy manager that the input starts being used.
        virtual status_t startInput(audio_io_handle_t input,
                                    audio_session_t session);
        // indicates to the audio policy manager that the input stops being used.
        virtual status_t stopInput(audio_io_handle_t input,
                                   audio_session_t session);
protected:
protected:


         status_t checkAndSetVolume(audio_stream_type_t stream,
         status_t checkAndSetVolume(audio_stream_type_t stream,
@@ -98,6 +110,10 @@ protected:
        //   the mute/unmute happened 315
        //   the mute/unmute happened 315
        uint32_t handleEventForBeacon(int){return 0;}
        uint32_t handleEventForBeacon(int){return 0;}
        uint32_t setBeaconMute(bool){return 0;}
        uint32_t setBeaconMute(bool){return 0;}
#ifdef VOICE_CONCURRENCY
        static audio_output_flags_t getFallBackPath();
        int mFallBackflag;
#endif /*VOICE_CONCURRENCY*/


        // handle special cases for sonification strategy while in call: mute streams or replace by
        // handle special cases for sonification strategy while in call: mute streams or replace by
        // a special tone in the device used for communication
        // a special tone in the device used for communication
@@ -128,6 +144,11 @@ private:
        // Used for voip + voice concurrency usecase
        // Used for voip + voice concurrency usecase
        int mPrevPhoneState;
        int mPrevPhoneState;
        int mvoice_call_state;
        int mvoice_call_state;
#ifdef RECORD_PLAY_CONCURRENCY
        // Used for record + playback concurrency
        bool mIsInputRequestOnProgress;
#endif



};
};