hal: add audio device arbitration extension

The audio device arbitration extension enables audio HAL to manage
shared resources by notifying clients when devices are required
by audio HAL and when they can be used by the clients.

This change is implemented as an audio extension. It dynamically
loads a library which implements the arbitration and IPC
mechanism

Change-Id: I13ade59caecfd69639f5bf8892dba917502ae357
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 87ea0d3..3a3d709 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -379,6 +379,7 @@
                                         LISTEN_EVENT_SND_DEVICE_FREE);
             return -EINVAL;
         }
+        audio_extn_dev_arbi_acquire(snd_device);
         audio_route_apply_and_update_path(adev->audio_route, device_name);
     }
     return 0;
@@ -422,9 +423,10 @@
             snd_device == SND_DEVICE_OUT_VOICE_SPEAKER) &&
             audio_extn_spkr_prot_is_enabled()) {
             audio_extn_spkr_prot_stop_processing();
-        } else
+        } else {
             audio_route_reset_and_update_path(adev->audio_route, device_name);
-
+            audio_extn_dev_arbi_release(snd_device);
+        }
         audio_extn_listen_update_device_status(snd_device,
                                         LISTEN_EVENT_SND_DEVICE_FREE);
     }