Create an Android.mk file to build the shared library. Ensure
the Makefile contains the following line:

LOCAL_MODULE := audio.primary.<device>

Your library must be named audio.primary.<device>.so
so Android can correctly load the library. The primary portion of
this filename indicates that this shared library is for the primary audio
hardware located on the device. The module names
audio.a2dp.<device> and
audio.usb.<device> are also available for Bluetooth and
USB audio interfaces. Here is an example of an Android.mk from the
Galaxy Nexus audio hardware:

Declare the shared modules of your audio HAL that are required by your
product in the product's
device/<company>/<device>/device.mk Makefile.
For example, the Galaxy Nexus requires the primary and Bluetooth audio HAL
modules: