Update audio services for 64 bit compilation
audioserver still runs in 32 bits
Bug: 27479136
Change-Id: I99ac607e4ce006a87abc2a3f838023e00ef78647
diff --git a/media/audioserver/Android.mk b/media/audioserver/Android.mk
index aa79bc1..b4a2e0f 100644
--- a/media/audioserver/Android.mk
+++ b/media/audioserver/Android.mk
@@ -31,8 +31,26 @@
$(call include-path-for, audio-utils) \
external/sonic \
+# If AUDIOSERVER_MULTILIB in device.mk is non-empty then it is used to control
+# the LOCAL_MULTILIB for all audioserver exclusive libraries.
+# This is relevant for 64 bit architectures where either or both
+# 32 and 64 bit libraries may be built.
+#
+# AUDIOSERVER_MULTILIB may be set as follows:
+# 32 to build 32 bit audioserver libraries and 32 bit audioserver.
+# 64 to build 64 bit audioserver libraries and 64 bit audioserver.
+# both to build both 32 bit and 64 bit libraries,
+# and use primary target architecture (32 or 64) for audioserver.
+# first to build libraries and audioserver for the primary target architecture only.
+# <empty> to build both 32 and 64 bit libraries and 32 bit audioserver.
+
+ifeq ($(strip $(AUDIOSERVER_MULTILIB)),)
+LOCAL_MULTILIB := 32
+else
+LOCAL_MULTILIB := $(AUDIOSERVER_MULTILIB)
+endif
+
LOCAL_MODULE := audioserver
-LOCAL_32_BIT_ONLY := true
LOCAL_INIT_RC := audioserver.rc