audio: primary desc check for sonification
- Audio glitches on alarm expiry if alarm starts
on screen lock/standby mode
- On alarm expiry alarm tone will start play on combo device
&screen unlock tone try to play on headset which results
multiple device switch, as a result audio glitches are audible
- Fix is to treat all non-music streams as sonification
if sonfication strategy is used by primary desc which
will avoid device switch
Change-Id: Ie280400d5f754a8d4bd8885b6836be5e120f8783
CRs-Fixed: 514467
Crs-Fixed: 626722
diff --git a/policy_hal/AudioPolicyManager.h b/policy_hal/AudioPolicyManager.h
index 188488a..ca7031d 100644
--- a/policy_hal/AudioPolicyManager.h
+++ b/policy_hal/AudioPolicyManager.h
@@ -61,6 +61,12 @@
virtual bool isOffloadSupported(const audio_offload_info_t& offloadInfo);
virtual void setPhoneState(int state);
+ virtual status_t startOutput(audio_io_handle_t output,
+ AudioSystem::stream_type stream,
+ int session = 0);
+ virtual status_t stopOutput(audio_io_handle_t output,
+ AudioSystem::stream_type stream,
+ int session = 0);
protected:
// return the strategy corresponding to a given stream type
static routing_strategy getStrategy(AudioSystem::stream_type stream);
@@ -88,6 +94,7 @@
// check that volume change is permitted, compute and send new volume to audio hardware
status_t checkAndSetVolume(int stream, int index, audio_io_handle_t output, audio_devices_t device, int delayMs = 0, bool force = false);
+ audio_devices_t getNewDevice(audio_io_handle_t output, bool fromCache);
// returns the category the device belongs to with regard to volume curve management
static device_category getDeviceCategory(audio_devices_t device);
@@ -99,5 +106,8 @@
//parameter indicates if HDMI plug in/out detected
bool mHdmiAudioEvent;
+private:
+ void handleNotificationRoutingForStream(AudioSystem::stream_type stream);
+
};
};