summaryrefslogtreecommitdiff
path: root/media/lib
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2018-02-22 16:40:29 +0900
committerJiyong Park <jiyong@google.com>2018-02-28 09:43:49 +0900
commit62e3308879b7deff45f2a85156607453f5fa219e (patch)
treef750a5e52091ee293fb7cceea6a9bca307d49913 /media/lib
parent2016c0f4f6de20411257ed84d4fc1aa3d6226d41 (diff)
Fix link-type check warning on com.android.mediadrm.signer
The library has been built without SDK, and is used by an app GtsCastV2SignerApp that is built with SDK. Such this SDK -> non-SDK dependency has been causing link-type check warnings, which will turn into errors soon. This change fixes the warning by making a stub library com.android.mediadrm.signer.stubs from the runtime library and let the app to link against the stub library. Since the stubs library does not use any private APIs, it is built with SDK. Bug: 69899800 Test: m -j GtsCastV2SignerApp is successful and does not show any link-type check warning. Change-Id: I8a95cc3b14eb2fc4ca90b66aee002f77099187c4
Diffstat (limited to 'media/lib')
-rw-r--r--media/lib/signer/Android.mk21
-rw-r--r--media/lib/signer/README.txt13
2 files changed, 32 insertions, 2 deletions
diff --git a/media/lib/signer/Android.mk b/media/lib/signer/Android.mk
index 69ca4d2fc8c5..54aa9688be67 100644
--- a/media/lib/signer/Android.mk
+++ b/media/lib/signer/Android.mk
@@ -42,3 +42,24 @@ LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := com.android.mediadrm.signer.stubs-gen
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+LOCAL_SRC_FILES := $(call all-java-files-under,java)
+LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/com.android.mediadrm.signer.stubs_intermediates/src
+LOCAL_DROIDDOC_OPTIONS:= \
+ -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 \
+ -stubpackages com.android.mediadrm.signer \
+ -nodocs
+LOCAL_UNINSTALLABLE_MODULE := true
+include $(BUILD_DROIDDOC)
+com_android_mediadrm_signer_gen_stamp := $(full_target)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := com.android.mediadrm.signer.stubs
+LOCAL_SDK_VERSION := current
+LOCAL_SOURCE_FILES_ALL_GENERATED := true
+LOCAL_ADDITIONAL_DEPENDENCIES := $(com_android_mediadrm_signer_gen_stamp)
+com_android_mediadrm_signer_gen_stamp :=
+include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/media/lib/signer/README.txt b/media/lib/signer/README.txt
index 362ab8e668af..55df3fc82eea 100644
--- a/media/lib/signer/README.txt
+++ b/media/lib/signer/README.txt
@@ -1,10 +1,19 @@
-This library (com.android.mediadrm.signer.jar) is a shared java library
+There are two libraries defined in this directory:
+First, com.android.mediadrm.signer.jar is a shared java library
containing classes required by unbundled apps running on devices that use
the certficate provisioning and private key signing capabilities provided
by the MediaDrm API.
+Second, com.android.mediadrm.signer.stubs.jar is a stub for the shared library
+which provides build-time APIs to the unbundled clients.
+
+At runtime, the shared library is added to the classloader of the app via the
+<uses-library> tag. And since Java always tries to load a class from the
+parent classloader, regardless of whether the stub library is linked to the
+app statically or dynamically, the real classes are loaded from the shared
+library.
--- Rules of this library ---
-o This library is effectively a PUBLIC API for unbundled CAST receivers
+o The stub library is effectively a PUBLIC API for unbundled CAST receivers
that may be distributed outside the system image. So it MUST BE API STABLE.
You can add but not remove. The rules are the same as for the
public platform SDK API.