Revert "Revert "Use sdk variant of Soong modules when LOCAL_SDK_..."

Revert^2 "Add sdk mutator for native modules"

f8e80229fedb47302e9cfd32990859a6308020cf

Change-Id: Ib686b52339ae5031434a2fb6a0e7f5b0c0dc5641
diff --git a/core/binary.mk b/core/binary.mk
index e021b7d..0582920 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -1136,6 +1136,18 @@
     $(if $(filter $(l),$(VENDOR_PUBLIC_LIBRARIES)),$(l).vendorpublic,$(l)))
 endif
 
+###########################################################
+## When compiling against the NDK, use SDK variants of Soong libraries
+###########################################################
+
+ifneq ($(LOCAL_SDK_VERSION),)
+  my_whole_static_libraries := $(call use_soong_sdk_libraries,$(my_whole_static_libraries))
+  my_static_libraries := $(call use_soong_sdk_libraries,$(my_static_libraries))
+  my_shared_libraries := $(call use_soong_sdk_libraries,$(my_shared_libraries))
+  my_system_shared_libraries := $(call use_soong_sdk_libraries,$(my_system_shared_libraries))
+  my_header_libraries := $(call use_soong_sdk_libraries,$(my_header_libraries))
+endif
+
 ##########################################################
 ## Set up installed module dependency
 ## We cannot compute the full path of the LOCAL_SHARED_LIBRARIES for