Profiling use aprof, enable by LOCAL_ENABLE_APROF or LOCAL_ENABLE_APROF_JNI

Change-Id: Ia95dc7318e17c0804867b22e239edccc5cbec0af
diff --git a/core/static_library.mk b/core/static_library.mk
index 4ff5a34..315c497 100644
--- a/core/static_library.mk
+++ b/core/static_library.mk
@@ -15,6 +15,13 @@
 endif
 LOCAL_UNINSTALLABLE_MODULE := true
 
+####################################################
+## Add profiling libraries if aprof is turned
+####################################################
+ifeq ($(strip $(LOCAL_ENABLE_APROF)),true)
+  LOCAL_WHOLE_STATIC_LIBRARIES += libaprof
+endif
+
 include $(BUILD_SYSTEM)/binary.mk
 
 ifeq ($(LOCAL_RAW_STATIC_LIBRARY),true)