audio: Audio tests should use static Brillo libraries.

The native audio tests now use static Brillo libraries.

BUG=31069324
TEST=passes with test_droid

Change-Id: Idce1415e9dd4a8dcb7291a749824884fd1ae3b62
diff --git a/pts/audio/Android.mk b/pts/audio/Android.mk
new file mode 100644
index 0000000..41a41d0
--- /dev/null
+++ b/pts/audio/Android.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include $(call all-subdir-makefiles)
diff --git a/pts/audio/brillo-audio-test/Android.mk b/pts/audio/brillo-audio-test/Android.mk
index 4c55512..37543a4 100644
--- a/pts/audio/brillo-audio-test/Android.mk
+++ b/pts/audio/brillo-audio-test/Android.mk
@@ -29,14 +29,23 @@
 LOCAL_SHARED_LIBRARIES := \
   libaudioutils \
   libbinder \
-  libbrillo \
-  libchrome \
+  liblog \
   libmedia \
-  libsinesource \
   libstagefright \
   libstagefright_foundation \
   libutils
-LOCAL_STATIC_LIBRARIES := libsndfile
+LOCAL_STATIC_LIBRARIES := \
+  libbrillo \
+  libchrome \
+  libsinesource \
+  libsndfile
+# Note: This is because of libchrome.
+LOCAL_LDFLAGS += \
+  -Wl,-wrap,calloc \
+  -Wl,-wrap,free \
+  -Wl,-wrap,malloc \
+  -Wl,-wrap,memalign \
+  -Wl,-wrap,realloc
 LOCAL_C_INCLUDES := \
   $(TOP)/device/generic/brillo/pts/audio/common \
   $(TOP)/frameworks/av/media/libstagefright \
diff --git a/pts/audio/common/Android.mk b/pts/audio/common/Android.mk
index f7602ac..e58db6c 100644
--- a/pts/audio/common/Android.mk
+++ b/pts/audio/common/Android.mk
@@ -20,11 +20,5 @@
 LOCAL_SRC_FILES := SineSource.cpp
 LOCAL_MODULE := libsinesource
 LOCAL_CFLAGS += -Wall -Werror
-LOCAL_SHARED_LIBRARIES := \
-  libbinder \
-  liblog \
-  libmedia \
-  libstagefright \
-  libstagefright_foundation \
-  libutils
-include $(BUILD_SHARED_LIBRARY)
+LOCAL_SHARED_LIBRARIES := libstagefright
+include $(BUILD_STATIC_LIBRARY)
diff --git a/pts/audio/hal-test/Android.mk b/pts/audio/hal-test/Android.mk
index c425b08..7b641c5 100644
--- a/pts/audio/hal-test/Android.mk
+++ b/pts/audio/hal-test/Android.mk
@@ -25,14 +25,16 @@
 LOCAL_SHARED_LIBRARIES := \
   libaudioutils \
   libbase \
+  libbinder \
   libhardware \
   liblog \
   libmedia \
-  libsinesource \
   libstagefright \
   libstagefright_foundation \
   libutils
-LOCAL_STATIC_LIBRARIES := libsndfile
+LOCAL_STATIC_LIBRARIES := \
+  libsinesource \
+  libsndfile
 LOCAL_C_INCLUDES := \
   $(TOP)/device/generic/brillo/pts/audio/common \
   $(TOP)/system/media/audio_utils/include
@@ -50,7 +52,9 @@
   libhardware \
   liblog \
   libutils
-LOCAL_STATIC_LIBRARIES := libsndfile
+LOCAL_STATIC_LIBRARIES := \
+  libsinesource \
+  libsndfile
 LOCAL_C_INCLUDES := \
   $(TOP)/system/media/audio_utils/include
 include $(BUILD_EXECUTABLE)