Convert libdrmframework and drmserver to Android.bp

See build/soong/README.md for more information.

Also moves a few headers into the same library as their
implementation, and fixes a few includes to go through the
global frameworks/av/include path instead of manually adding
frameworks/av/include/drm.

Test: m -j checkbuild
Change-Id: I0c2d2f2262e7ed78d80a0d44795705c64b797ff0
diff --git a/drm/common/Android.bp b/drm/common/Android.bp
new file mode 100644
index 0000000..0098c89
--- /dev/null
+++ b/drm/common/Android.bp
@@ -0,0 +1,39 @@
+//
+// Copyright (C) 2010 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.
+//
+
+cc_library_static {
+    name: "libdrmframeworkcommon",
+
+    srcs: [
+        "DrmConstraints.cpp",
+        "DrmMetadata.cpp",
+        "DrmConvertedStatus.cpp",
+        "DrmEngineBase.cpp",
+        "DrmInfo.cpp",
+        "DrmInfoRequest.cpp",
+        "DrmInfoStatus.cpp",
+        "DrmRights.cpp",
+        "DrmSupportInfo.cpp",
+        "IDrmManagerService.cpp",
+        "IDrmServiceListener.cpp",
+        "DrmInfoEvent.cpp",
+        "ReadWriteUtils.cpp",
+    ],
+
+    static_libs: ["libbinder"],
+
+    export_include_dirs: ["include"],
+}
diff --git a/drm/common/Android.mk b/drm/common/Android.mk
deleted file mode 100644
index ca3d2cd..0000000
--- a/drm/common/Android.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# Copyright (C) 2010 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.
-#
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
-    DrmConstraints.cpp \
-    DrmMetadata.cpp \
-    DrmConvertedStatus.cpp \
-    DrmEngineBase.cpp \
-    DrmInfo.cpp \
-    DrmInfoRequest.cpp \
-    DrmInfoStatus.cpp \
-    DrmRights.cpp \
-    DrmSupportInfo.cpp \
-    IDrmManagerService.cpp \
-    IDrmServiceListener.cpp \
-    DrmInfoEvent.cpp \
-    ReadWriteUtils.cpp
-
-LOCAL_STATIC_LIBRARIES := libbinder
-
-LOCAL_C_INCLUDES := \
-    $(TOP)/frameworks/av/include \
-    $(TOP)/frameworks/av/drm/libdrmframework/include \
-    $(TOP)/frameworks/av/drm/libdrmframework/plugins/common/include
-
-LOCAL_MODULE:= libdrmframeworkcommon
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_STATIC_LIBRARY)
diff --git a/drm/libdrmframework/plugins/common/include/DrmEngineBase.h b/drm/common/include/DrmEngineBase.h
similarity index 100%
rename from drm/libdrmframework/plugins/common/include/DrmEngineBase.h
rename to drm/common/include/DrmEngineBase.h
diff --git a/drm/libdrmframework/plugins/common/include/IDrmEngine.h b/drm/common/include/IDrmEngine.h
similarity index 100%
rename from drm/libdrmframework/plugins/common/include/IDrmEngine.h
rename to drm/common/include/IDrmEngine.h
diff --git a/drm/libdrmframework/include/IDrmManagerService.h b/drm/common/include/IDrmManagerService.h
similarity index 100%
rename from drm/libdrmframework/include/IDrmManagerService.h
rename to drm/common/include/IDrmManagerService.h
diff --git a/drm/libdrmframework/include/IDrmServiceListener.h b/drm/common/include/IDrmServiceListener.h
similarity index 100%
rename from drm/libdrmframework/include/IDrmServiceListener.h
rename to drm/common/include/IDrmServiceListener.h
diff --git a/drm/libdrmframework/include/ReadWriteUtils.h b/drm/common/include/ReadWriteUtils.h
similarity index 100%
rename from drm/libdrmframework/include/ReadWriteUtils.h
rename to drm/common/include/ReadWriteUtils.h
diff --git a/drm/drmserver/Android.bp b/drm/drmserver/Android.bp
new file mode 100644
index 0000000..c25a0a1
--- /dev/null
+++ b/drm/drmserver/Android.bp
@@ -0,0 +1,46 @@
+//
+// Copyright (C) 2010 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.
+//
+
+cc_binary {
+    name: "drmserver",
+
+    srcs: [
+        "main_drmserver.cpp",
+        "DrmManager.cpp",
+        "DrmManagerService.cpp",
+    ],
+
+    shared_libs: [
+        "libmedia",
+        "libutils",
+        "liblog",
+        "libbinder",
+        "libdl",
+        "libselinux",
+    ],
+
+    static_libs: ["libdrmframeworkcommon"],
+
+    cflags: [
+        "-Wall",
+        "-Wextra",
+        "-Werror",
+    ],
+
+    compile_multilib: "32",
+
+    init_rc: ["drmserver.rc"],
+}
diff --git a/drm/drmserver/Android.mk b/drm/drmserver/Android.mk
deleted file mode 100644
index 3b8bb04..0000000
--- a/drm/drmserver/Android.mk
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Copyright (C) 2010 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.
-#
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
-    main_drmserver.cpp \
-    DrmManager.cpp \
-    DrmManagerService.cpp
-
-LOCAL_SHARED_LIBRARIES := \
-    libmedia \
-    libutils \
-    liblog \
-    libbinder \
-    libdl \
-    libselinux
-
-LOCAL_STATIC_LIBRARIES := libdrmframeworkcommon
-
-LOCAL_C_INCLUDES := \
-    $(TOP)/frameworks/av/include \
-    $(TOP)/frameworks/av/drm/libdrmframework/include \
-    $(TOP)/frameworks/av/drm/libdrmframework/plugins/common/include
-
-LOCAL_CFLAGS += -Wall -Wextra -Werror
-
-LOCAL_MODULE:= drmserver
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_32_BIT_ONLY := true
-
-LOCAL_INIT_RC := drmserver.rc
-
-include $(BUILD_EXECUTABLE)
diff --git a/drm/libdrmframework/include/DrmManager.h b/drm/drmserver/DrmManager.h
similarity index 100%
rename from drm/libdrmframework/include/DrmManager.h
rename to drm/drmserver/DrmManager.h
diff --git a/drm/libdrmframework/include/DrmManagerService.h b/drm/drmserver/DrmManagerService.h
similarity index 100%
rename from drm/libdrmframework/include/DrmManagerService.h
rename to drm/drmserver/DrmManagerService.h
diff --git a/drm/libdrmframework/include/PlugInManager.h b/drm/drmserver/PlugInManager.h
similarity index 100%
rename from drm/libdrmframework/include/PlugInManager.h
rename to drm/drmserver/PlugInManager.h
diff --git a/drm/libdrmframework/Android.bp b/drm/libdrmframework/Android.bp
new file mode 100644
index 0000000..43ba72b
--- /dev/null
+++ b/drm/libdrmframework/Android.bp
@@ -0,0 +1,42 @@
+//
+// Copyright (C) 2010 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.
+//
+
+cc_library_shared {
+    name: "libdrmframework",
+
+    srcs: [
+        "DrmManagerClientImpl.cpp",
+        "DrmManagerClient.cpp",
+        "NoOpDrmManagerClientImpl.cpp",
+    ],
+
+    shared_libs: [
+        "libutils",
+        "libcutils",
+        "liblog",
+        "libbinder",
+        "libdl",
+    ],
+
+    static_libs: ["libdrmframeworkcommon"],
+
+    export_include_dirs: ["include"],
+    export_static_lib_headers: ["libdrmframeworkcommon"],
+
+    cflags: ["-Werror"],
+}
+
+subdirs = ["plugins/*"]
diff --git a/drm/libdrmframework/Android.mk b/drm/libdrmframework/Android.mk
deleted file mode 100644
index cafcb94..0000000
--- a/drm/libdrmframework/Android.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2010 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.
-#
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
-    DrmManagerClientImpl.cpp \
-    DrmManagerClient.cpp \
-    NoOpDrmManagerClientImpl.cpp
-
-LOCAL_MODULE:= libdrmframework
-
-LOCAL_SHARED_LIBRARIES := \
-    libutils \
-    libcutils \
-    liblog \
-    libbinder \
-    libdl
-
-LOCAL_STATIC_LIBRARIES := \
-    libdrmframeworkcommon
-
-LOCAL_C_INCLUDES += \
-    $(TOP)/frameworks/av/drm/libdrmframework/include \
-    $(TOP)/frameworks/av/include
-
-LOCAL_CFLAGS += -Werror
-
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/drm/libdrmframework/plugins/Android.mk b/drm/libdrmframework/plugins/Android.mk
deleted file mode 100644
index 9ee7961..0000000
--- a/drm/libdrmframework/plugins/Android.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Copyright (C) 2010 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/drm/libdrmframework/plugins/common/Android.bp b/drm/libdrmframework/plugins/common/Android.bp
new file mode 100644
index 0000000..213e57f
--- /dev/null
+++ b/drm/libdrmframework/plugins/common/Android.bp
@@ -0,0 +1 @@
+subdirs = ["util"]
diff --git a/drm/libdrmframework/plugins/common/Android.mk b/drm/libdrmframework/plugins/common/Android.mk
deleted file mode 100644
index 9ee7961..0000000
--- a/drm/libdrmframework/plugins/common/Android.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Copyright (C) 2010 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/drm/libdrmframework/plugins/common/util/Android.bp b/drm/libdrmframework/plugins/common/util/Android.bp
new file mode 100644
index 0000000..0c0b6f2
--- /dev/null
+++ b/drm/libdrmframework/plugins/common/util/Android.bp
@@ -0,0 +1,23 @@
+//
+// Copyright (C) 2010 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.
+//
+
+cc_library_static {
+    name: "libdrmutility",
+
+    srcs: ["src/MimeTypeUtil.cpp"],
+
+    export_include_dirs: ["include"],
+}
diff --git a/drm/libdrmframework/plugins/common/util/Android.mk b/drm/libdrmframework/plugins/common/util/Android.mk
deleted file mode 100644
index 2a7b01f..0000000
--- a/drm/libdrmframework/plugins/common/util/Android.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# Copyright (C) 2010 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.
-#
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
-    src/MimeTypeUtil.cpp
-
-LOCAL_MODULE := libdrmutility
-
-base := frameworks/av
-
-LOCAL_C_INCLUDES += \
-    $(base)/include \
-    $(base)/include/drm \
-    $(base)/include/drm/plugins \
-    $(LOCAL_PATH)/include
-
-
-ifneq ($(TARGET_BUILD_VARIANT),user)
-LOCAL_C_INCLUDES += \
-    $(LOCAL_PATH)/tools
-
-endif
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_STATIC_LIBRARY)
diff --git a/drm/libdrmframework/plugins/forward-lock/Android.bp b/drm/libdrmframework/plugins/forward-lock/Android.bp
new file mode 100644
index 0000000..f884c14
--- /dev/null
+++ b/drm/libdrmframework/plugins/forward-lock/Android.bp
@@ -0,0 +1,4 @@
+subdirs = [
+    "FwdLockEngine",
+    "internal-format",
+]
diff --git a/drm/libdrmframework/plugins/forward-lock/Android.mk b/drm/libdrmframework/plugins/forward-lock/Android.mk
deleted file mode 100644
index 9ee7961..0000000
--- a/drm/libdrmframework/plugins/forward-lock/Android.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Copyright (C) 2010 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/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/Android.bp b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/Android.bp
new file mode 100644
index 0000000..3f0f5f7
--- /dev/null
+++ b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/Android.bp
@@ -0,0 +1,50 @@
+//
+// Copyright (C) 2010 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
+//2
+//      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.
+//
+
+cc_library_shared {
+    name: "libfwdlockengine",
+
+    cflags: [
+        "-DUSE_64BIT_DRM_API",
+        // The flag below turns on local debug printouts
+        //"-DDRM_OMA_FL_ENGINE_DEBUG",
+    ],
+
+    srcs: ["src/FwdLockEngine.cpp"],
+
+    shared_libs: [
+        "libicui18n",
+        "libicuuc",
+        "libutils",
+        "liblog",
+        "libdl",
+        "libcrypto",
+        "libssl",
+        "libdrmframework",
+    ],
+
+    static_libs: [
+        "libdrmutility",
+        "libdrmframeworkcommon",
+        "libfwdlock-common",
+        "libfwdlock-converter",
+        "libfwdlock-decoder",
+    ],
+
+    local_include_dirs: ["include"],
+
+    relative_install_path: "drm",
+}
diff --git a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/Android.mk b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/Android.mk
deleted file mode 100644
index 933464f..0000000
--- a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/Android.mk
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# Copyright (C) 2010 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.
-#
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-# The flag below turns on local debug printouts
-#LOCAL_CFLAGS += -DDRM_OMA_FL_ENGINE_DEBUG
-
-base := frameworks/av
-
-# Determine whether the DRM framework uses 64-bit data types for file offsets and do the same.
-ifneq ($(shell grep -c 'off64_t offset' $(base)/drm/libdrmframework/plugins/common/include/IDrmEngine.h), 0)
-LOCAL_CFLAGS += -DUSE_64BIT_DRM_API
-endif
-
-LOCAL_SRC_FILES:= \
-    src/FwdLockEngine.cpp
-
-LOCAL_MODULE := libfwdlockengine
-
-LOCAL_SHARED_LIBRARIES := \
-    libicui18n \
-    libicuuc \
-    libutils \
-    liblog \
-    libdl \
-    libcrypto \
-    libssl \
-    libdrmframework
-
-LOCAL_STATIC_LIBRARIES := \
-    libdrmutility \
-    libdrmframeworkcommon \
-    libfwdlock-common \
-    libfwdlock-converter \
-    libfwdlock-decoder
-
-
-
-LOCAL_C_INCLUDES += \
-    $(base)/include/drm \
-    $(base)/drm/libdrmframework/plugins/common/include \
-    $(base)/drm/libdrmframework/plugins/common/util/include \
-    $(base)/drm/libdrmframework/plugins/forward-lock/internal-format/common \
-    $(base)/drm/libdrmframework/plugins/forward-lock/internal-format/converter \
-    $(base)/drm/libdrmframework/plugins/forward-lock/internal-format/decoder \
-    $(LOCAL_PATH)/include
-
-LOCAL_MODULE_RELATIVE_PATH := drm
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/include/FwdLockEngine.h b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/include/FwdLockEngine.h
index d222703..a571b3a 100644
--- a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/include/FwdLockEngine.h
+++ b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/include/FwdLockEngine.h
@@ -18,14 +18,14 @@
 #define __FWDLOCKENGINE_H__
 
 #include <DrmEngineBase.h>
-#include <DrmConstraints.h>
-#include <DrmRights.h>
-#include <DrmInfo.h>
-#include <DrmInfoStatus.h>
-#include <DrmConvertedStatus.h>
-#include <DrmInfoRequest.h>
-#include <DrmSupportInfo.h>
-#include <DrmInfoEvent.h>
+#include <drm/DrmConstraints.h>
+#include <drm/DrmRights.h>
+#include <drm/DrmInfo.h>
+#include <drm/DrmInfoStatus.h>
+#include <drm/DrmConvertedStatus.h>
+#include <drm/DrmInfoRequest.h>
+#include <drm/DrmSupportInfo.h>
+#include <drm/DrmInfoEvent.h>
 
 #include "SessionMap.h"
 #include "FwdLockConv.h"
diff --git a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp
index a495616..830def9 100644
--- a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp
+++ b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp
@@ -20,17 +20,17 @@
 #include <errno.h>
 #include <stdio.h>
 #include <unistd.h>
-#include "drm_framework_common.h"
+#include <drm/drm_framework_common.h>
 #include <fcntl.h>
 #include <limits.h>
-#include <DrmRights.h>
-#include <DrmConstraints.h>
-#include <DrmMetadata.h>
-#include <DrmInfo.h>
-#include <DrmInfoStatus.h>
-#include <DrmInfoRequest.h>
-#include <DrmSupportInfo.h>
-#include <DrmConvertedStatus.h>
+#include <drm/DrmRights.h>
+#include <drm/DrmConstraints.h>
+#include <drm/DrmMetadata.h>
+#include <drm/DrmInfo.h>
+#include <drm/DrmInfoStatus.h>
+#include <drm/DrmInfoRequest.h>
+#include <drm/DrmSupportInfo.h>
+#include <drm/DrmConvertedStatus.h>
 #include <utils/String8.h>
 #include "FwdLockConv.h"
 #include "FwdLockFile.h"
diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/Android.bp b/drm/libdrmframework/plugins/forward-lock/internal-format/Android.bp
new file mode 100644
index 0000000..9f58e26
--- /dev/null
+++ b/drm/libdrmframework/plugins/forward-lock/internal-format/Android.bp
@@ -0,0 +1,5 @@
+subdirs = [
+    "common",
+    "converter",
+    "decoder",
+]
diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/Android.mk b/drm/libdrmframework/plugins/forward-lock/internal-format/Android.mk
deleted file mode 100644
index 9ee7961..0000000
--- a/drm/libdrmframework/plugins/forward-lock/internal-format/Android.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Copyright (C) 2010 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/drm/libdrmframework/plugins/forward-lock/internal-format/common/Android.bp b/drm/libdrmframework/plugins/forward-lock/internal-format/common/Android.bp
new file mode 100644
index 0000000..698f278
--- /dev/null
+++ b/drm/libdrmframework/plugins/forward-lock/internal-format/common/Android.bp
@@ -0,0 +1,25 @@
+//
+// Copyright (C) 2010 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.
+//
+
+cc_library_static {
+    name: "libfwdlock-common",
+
+    srcs: ["FwdLockGlue.c"],
+
+    shared_libs: ["libcrypto"],
+
+    export_include_dirs: ["."],
+}
diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/common/Android.mk b/drm/libdrmframework/plugins/forward-lock/internal-format/common/Android.mk
deleted file mode 100644
index 3b4c8b4..0000000
--- a/drm/libdrmframework/plugins/forward-lock/internal-format/common/Android.mk
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# Copyright (C) 2010 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.
-#
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
-    FwdLockGlue.c
-
-LOCAL_SHARED_LIBRARIES := libcrypto
-
-LOCAL_MODULE := libfwdlock-common
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_STATIC_LIBRARY)
diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/converter/Android.bp b/drm/libdrmframework/plugins/forward-lock/internal-format/converter/Android.bp
new file mode 100644
index 0000000..33f2fe0
--- /dev/null
+++ b/drm/libdrmframework/plugins/forward-lock/internal-format/converter/Android.bp
@@ -0,0 +1,26 @@
+//
+// Copyright (C) 2010 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.
+//
+
+cc_library_static {
+    name: "libfwdlock-converter",
+
+    srcs: ["FwdLockConv.c"],
+
+    shared_libs: ["libcrypto"],
+    static_libs: ["libfwdlock-common"],
+
+    export_include_dirs: ["."],
+}
diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/converter/Android.mk b/drm/libdrmframework/plugins/forward-lock/internal-format/converter/Android.mk
deleted file mode 100644
index 2f51f0c..0000000
--- a/drm/libdrmframework/plugins/forward-lock/internal-format/converter/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# Copyright (C) 2010 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.
-#
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
-    FwdLockConv.c
-
-LOCAL_C_INCLUDES := \
-    frameworks/av/drm/libdrmframework/plugins/forward-lock/internal-format/common
-
-LOCAL_SHARED_LIBRARIES := libcrypto
-
-LOCAL_MODULE := libfwdlock-converter
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_STATIC_LIBRARY)
diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/Android.bp b/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/Android.bp
new file mode 100644
index 0000000..b6d7a06
--- /dev/null
+++ b/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/Android.bp
@@ -0,0 +1,26 @@
+//
+// Copyright (C) 2010 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.
+//
+
+cc_library_static {
+    name: "libfwdlock-decoder",
+
+    srcs: ["FwdLockFile.c"],
+
+    shared_libs: ["libcrypto"],
+    static_libs: ["libfwdlock-common"],
+
+    export_include_dirs: ["."],
+}
diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/Android.mk b/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/Android.mk
deleted file mode 100644
index 3399ae5..0000000
--- a/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# Copyright (C) 2010 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.
-#
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
-    FwdLockFile.c
-
-LOCAL_C_INCLUDES := \
-    frameworks/av/drm/libdrmframework/plugins/forward-lock/internal-format/common
-
-LOCAL_SHARED_LIBRARIES := libcrypto
-
-LOCAL_MODULE := libfwdlock-decoder
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_STATIC_LIBRARY)
diff --git a/drm/libdrmframework/plugins/passthru/Android.bp b/drm/libdrmframework/plugins/passthru/Android.bp
new file mode 100644
index 0000000..1dcf89c
--- /dev/null
+++ b/drm/libdrmframework/plugins/passthru/Android.bp
@@ -0,0 +1,36 @@
+//
+// Copyright (C) 2010 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.
+//
+
+cc_library_shared {
+    name: "libdrmpassthruplugin",
+
+    srcs: ["src/DrmPassthruPlugIn.cpp"],
+
+    static_libs: ["libdrmframeworkcommon"],
+
+    shared_libs: [
+        "libutils",
+        "liblog",
+        "libdl",
+    ],
+
+    local_include_dirs: ["include"],
+
+    cflags: [
+        // Set the following flag to enable the decryption passthru flow
+        //"-DENABLE_PASSTHRU_DECRYPTION",
+    ],
+}
diff --git a/drm/libdrmframework/plugins/passthru/Android.mk b/drm/libdrmframework/plugins/passthru/Android.mk
deleted file mode 100644
index cb3a2e2..0000000
--- a/drm/libdrmframework/plugins/passthru/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# Copyright (C) 2010 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.
-#
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
-    src/DrmPassthruPlugIn.cpp
-
-LOCAL_MODULE := libdrmpassthruplugin
-
-LOCAL_STATIC_LIBRARIES := libdrmframeworkcommon
-
-LOCAL_SHARED_LIBRARIES := \
-    libutils \
-    liblog \
-    libdl
-
-
-LOCAL_C_INCLUDES += \
-    $(TOP)/frameworks/av/drm/libdrmframework/include \
-    $(TOP)/frameworks/av/drm/libdrmframework/plugins/passthru/include \
-    $(TOP)/frameworks/av/drm/libdrmframework/plugins/common/include \
-    $(TOP)/frameworks/av/include
-
-# Set the following flag to enable the decryption passthru flow
-#LOCAL_CFLAGS += -DENABLE_PASSTHRU_DECRYPTION
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp b/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp
index 7f5b0ec..d7f2d28 100644
--- a/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp
+++ b/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp
@@ -245,6 +245,8 @@
     decryptHandle->status = DRM_NO_ERROR;
     decryptHandle->decryptInfo = NULL;
     return DRM_NO_ERROR;
+#else
+    (void)(decryptHandle); // unused
 #endif
 
     return DRM_ERROR_CANNOT_HANDLE;
diff --git a/drm/mediadrm/Android.bp b/drm/mediadrm/Android.bp
new file mode 100644
index 0000000..b9f07f1
--- /dev/null
+++ b/drm/mediadrm/Android.bp
@@ -0,0 +1 @@
+subdirs = ["plugins/*"]
diff --git a/drm/mediadrm/plugins/clearkey/Android.bp b/drm/mediadrm/plugins/clearkey/Android.bp
new file mode 100644
index 0000000..6af7cd8
--- /dev/null
+++ b/drm/mediadrm/plugins/clearkey/Android.bp
@@ -0,0 +1,54 @@
+//
+// Copyright (C) 2014 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.
+//
+
+cc_library_shared {
+    name: "libdrmclearkeyplugin",
+
+    srcs: [
+        "AesCtrDecryptor.cpp",
+        "ClearKeyUUID.cpp",
+        "CreatePluginFactories.cpp",
+        "CryptoFactory.cpp",
+        "CryptoPlugin.cpp",
+        "DrmFactory.cpp",
+        "DrmPlugin.cpp",
+        "InitDataParser.cpp",
+        "JsonWebKey.cpp",
+        "Session.cpp",
+        "SessionLibrary.cpp",
+        "Utils.cpp",
+    ],
+
+    vendor: true,
+    relative_install_path: "mediadrm",
+
+    shared_libs: [
+        "libcrypto",
+        "liblog",
+        "libstagefright_foundation",
+        "libutils",
+    ],
+
+    static_libs: ["libjsmn"],
+
+    export_include_dirs: ["."],
+    export_static_lib_headers: ["libjsmn"],
+}
+
+//########################################################################
+// Build unit tests
+
+subdirs = ["tests"]
diff --git a/drm/mediadrm/plugins/clearkey/Android.mk b/drm/mediadrm/plugins/clearkey/Android.mk
deleted file mode 100644
index 2efdcf5..0000000
--- a/drm/mediadrm/plugins/clearkey/Android.mk
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# Copyright (C) 2014 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.
-#
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
-    AesCtrDecryptor.cpp \
-    ClearKeyUUID.cpp \
-    CreatePluginFactories.cpp \
-    CryptoFactory.cpp \
-    CryptoPlugin.cpp \
-    DrmFactory.cpp \
-    DrmPlugin.cpp \
-    InitDataParser.cpp \
-    JsonWebKey.cpp \
-    Session.cpp \
-    SessionLibrary.cpp \
-    Utils.cpp \
-
-LOCAL_C_INCLUDES := \
-    external/jsmn \
-    frameworks/av/drm/mediadrm/plugins/clearkey \
-    frameworks/av/include \
-    frameworks/native/include \
-
-LOCAL_MODULE := libdrmclearkeyplugin
-
-LOCAL_PROPRIETARY_MODULE := true
-LOCAL_MODULE_RELATIVE_PATH := mediadrm
-
-LOCAL_SHARED_LIBRARIES := \
-    libcrypto \
-    liblog \
-    libstagefright_foundation \
-    libutils \
-
-LOCAL_STATIC_LIBRARIES := \
-    libjsmn \
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
-
-#########################################################################
-# Build unit tests
-
-include $(LOCAL_PATH)/tests/Android.mk
diff --git a/drm/mediadrm/plugins/clearkey/tests/Android.bp b/drm/mediadrm/plugins/clearkey/tests/Android.bp
new file mode 100644
index 0000000..1b208ad
--- /dev/null
+++ b/drm/mediadrm/plugins/clearkey/tests/Android.bp
@@ -0,0 +1,36 @@
+//
+// Copyright (C) 2014 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.
+//
+// ----------------------------------------------------------------
+// Builds ClearKey Drm Tests
+//
+
+cc_test {
+    name: "ClearKeyDrmUnitTest",
+
+    srcs: [
+        "AesCtrDecryptorUnittest.cpp",
+        "InitDataParserUnittest.cpp",
+        "JsonWebKeyUnittest.cpp",
+    ],
+
+    shared_libs: [
+        "libcrypto",
+        "libdrmclearkeyplugin",
+        "liblog",
+        "libstagefright_foundation",
+        "libutils",
+    ],
+}
diff --git a/drm/mediadrm/plugins/clearkey/tests/Android.mk b/drm/mediadrm/plugins/clearkey/tests/Android.mk
deleted file mode 100644
index 392f218..0000000
--- a/drm/mediadrm/plugins/clearkey/tests/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# Copyright (C) 2014 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.
-#
-# ----------------------------------------------------------------
-# Builds ClearKey Drm Tests
-#
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := ClearKeyDrmUnitTest
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := \
-    AesCtrDecryptorUnittest.cpp \
-    InitDataParserUnittest.cpp \
-    JsonWebKeyUnittest.cpp \
-
-LOCAL_C_INCLUDES := \
-    external/jsmn \
-    frameworks/av/drm/mediadrm/plugins/clearkey \
-    frameworks/av/include \
-    frameworks/native/include \
-
-LOCAL_SHARED_LIBRARIES := \
-    libcrypto \
-    libdrmclearkeyplugin \
-    liblog \
-    libstagefright_foundation \
-    libutils \
-
-include $(BUILD_NATIVE_TEST)
diff --git a/drm/mediadrm/plugins/clearkey/tests/InitDataParserUnittest.cpp b/drm/mediadrm/plugins/clearkey/tests/InitDataParserUnittest.cpp
index e275108..84ed242 100644
--- a/drm/mediadrm/plugins/clearkey/tests/InitDataParserUnittest.cpp
+++ b/drm/mediadrm/plugins/clearkey/tests/InitDataParserUnittest.cpp
@@ -56,7 +56,7 @@
                               request.size());
         EXPECT_EQ(0, requestString.find(kRequestPrefix));
         EXPECT_EQ(requestString.size() - kRequestSuffix.size(),
-                  requestString.find(kRequestSuffix));
+                  (size_t)requestString.find(kRequestSuffix));
         for (size_t i = 0; i < expectedKeys.size(); ++i) {
             AString encodedIdAString;
             android::encodeBase64(expectedKeys[i], kKeyIdSize,
@@ -71,7 +71,7 @@
                                       const String8& mimeType) {
         Vector<uint8_t> request;
         ASSERT_NE(android::OK, attemptParse(initData, mimeType, &request));
-        EXPECT_EQ(0, request.size());
+        EXPECT_EQ(0u, request.size());
     }
 };
 
diff --git a/drm/mediadrm/plugins/mock/Android.bp b/drm/mediadrm/plugins/mock/Android.bp
new file mode 100644
index 0000000..7f44819
--- /dev/null
+++ b/drm/mediadrm/plugins/mock/Android.bp
@@ -0,0 +1,34 @@
+//
+// Copyright (C) 2013 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.
+//
+
+cc_library_shared {
+    name: "libmockdrmcryptoplugin",
+
+    srcs: ["MockDrmCryptoPlugin.cpp"],
+
+    vendor: true,
+    relative_install_path: "mediadrm",
+
+    shared_libs: [
+        "libutils",
+        "liblog",
+    ],
+
+    cflags: [
+        // Set the following flag to enable the decryption passthru flow
+        //"-DENABLE_PASSTHRU_DECRYPTION",
+    ],
+}
diff --git a/drm/mediadrm/plugins/mock/Android.mk b/drm/mediadrm/plugins/mock/Android.mk
deleted file mode 100644
index 26c245b..0000000
--- a/drm/mediadrm/plugins/mock/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# Copyright (C) 2013 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.
-#
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
-    MockDrmCryptoPlugin.cpp
-
-LOCAL_MODULE := libmockdrmcryptoplugin
-
-LOCAL_PROPRIETARY_MODULE := true
-LOCAL_MODULE_RELATIVE_PATH := mediadrm
-
-LOCAL_SHARED_LIBRARIES := \
-    libutils liblog
-
-LOCAL_C_INCLUDES += \
-    $(TOP)/frameworks/av/include \
-    $(TOP)/frameworks/native/include/media
-
-# Set the following flag to enable the decryption passthru flow
-#LOCAL_CFLAGS += -DENABLE_PASSTHRU_DECRYPTION
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp b/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp
index 9bdb194..04649ce 100644
--- a/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp
+++ b/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.cpp
@@ -19,7 +19,7 @@
 #include <utils/Log.h>
 
 
-#include "drm/DrmAPI.h"
+#include "media/drm/DrmAPI.h"
 #include "MockDrmCryptoPlugin.h"
 #include "media/stagefright/MediaErrors.h"
 
diff --git a/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.h b/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.h
index c84046d..9012d2d 100644
--- a/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.h
+++ b/drm/mediadrm/plugins/mock/MockDrmCryptoPlugin.h
@@ -16,8 +16,8 @@
 
 #include <utils/Mutex.h>
 
-#include "drm/DrmAPI.h"
-#include "hardware/CryptoAPI.h"
+#include "media/drm/DrmAPI.h"
+#include "media/hardware/CryptoAPI.h"
 
 extern "C" {
       android::DrmFactory *createDrmFactory();