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: I54a2880f5b9dbc39746b20485f0aea9d9c3a39d7
CRs-Fixed: 514467
Crs-Fixed: 626722
diff --git a/policy_hal/AudioPolicyManager.h b/policy_hal/AudioPolicyManager.h
index 5defa24..8ef1cab 100644
--- a/policy_hal/AudioPolicyManager.h
+++ b/policy_hal/AudioPolicyManager.h
@@ -49,6 +49,13 @@
                                             uint32_t channels,
                                             AudioSystem::audio_in_acoustics acoustics);
         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
@@ -77,8 +84,12 @@
         // 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);
 
+private:
+        void handleNotificationRoutingForStream(AudioSystem::stream_type stream);
+
 };
 };