CTS test for libmedia OOB write anywhere

Set up a DRM session, spoof the non-secure device as
secure and pass an invalid pointer as the decrypt
destination buffer address which causes a segfault in
mediaserver on devices without the patch.

This test only runs on non-secure (L3) devices, it is
skipped on secure devices since the vulnerability doesn't
exist there.

b/23223325

Change-Id: Ie88a09ffa9ff722d2fb4642c6655c95cc2478eed
diff --git a/tests/tests/security/jni/Android.mk b/tests/tests/security/jni/Android.mk
index 2d55fb6..63c698c 100644
--- a/tests/tests/security/jni/Android.mk
+++ b/tests/tests/security/jni/Android.mk
@@ -31,11 +31,26 @@
 		android_security_cts_SELinuxTest.cpp \
 		android_security_cts_MMapExecutableTest.cpp \
 		android_security_cts_AudioPolicyBinderTest.cpp \
-		android_security_cts_EncryptionTest.cpp
+		android_security_cts_EncryptionTest.cpp \
+		android_security_cts_MediaCryptoTest.cpp
 
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
+LOCAL_C_INCLUDES := \
+	$(JNI_H_INCLUDE) \
+	system/core/include \
+	frameworks/base/media/jni
 
-LOCAL_SHARED_LIBRARIES := libnativehelper liblog libbinder libutils libmedia libselinux libdl libcutils libcrypto
+LOCAL_SHARED_LIBRARIES := \
+	libnativehelper \
+	liblog \
+	libbinder \
+	libutils \
+	libmedia \
+	libselinux \
+	libdl \
+	libcutils \
+	libcrypto \
+	libstagefright_foundation \
+	libmedia_jni
 
 LOCAL_C_INCLUDES += ndk/sources/cpufeatures
 LOCAL_STATIC_LIBRARIES := cpufeatures