1*d57664e9SAndroid Build Coastguard WorkerThere are two libraries defined in this directory: 2*d57664e9SAndroid Build Coastguard WorkerFirst, com.android.mediadrm.signer.jar is a shared java library 3*d57664e9SAndroid Build Coastguard Workercontaining classes required by unbundled apps running on devices that use 4*d57664e9SAndroid Build Coastguard Workerthe certficate provisioning and private key signing capabilities provided 5*d57664e9SAndroid Build Coastguard Workerby the MediaDrm API. 6*d57664e9SAndroid Build Coastguard WorkerSecond, com.android.mediadrm.signer.stubs.jar is a stub for the shared library 7*d57664e9SAndroid Build Coastguard Workerwhich provides build-time APIs to the unbundled clients. 8*d57664e9SAndroid Build Coastguard Worker 9*d57664e9SAndroid Build Coastguard WorkerAt runtime, the shared library is added to the classloader of the app via the 10*d57664e9SAndroid Build Coastguard Worker<uses-library> tag. And since Java always tries to load a class from the 11*d57664e9SAndroid Build Coastguard Workerparent classloader, regardless of whether the stub library is linked to the 12*d57664e9SAndroid Build Coastguard Workerapp statically or dynamically, the real classes are loaded from the shared 13*d57664e9SAndroid Build Coastguard Workerlibrary. 14*d57664e9SAndroid Build Coastguard Worker 15*d57664e9SAndroid Build Coastguard Worker--- Rules of this library --- 16*d57664e9SAndroid Build Coastguard Workero The stub library is effectively a PUBLIC API for unbundled CAST receivers 17*d57664e9SAndroid Build Coastguard Worker that may be distributed outside the system image. So it MUST BE API STABLE. 18*d57664e9SAndroid Build Coastguard Worker You can add but not remove. The rules are the same as for the 19*d57664e9SAndroid Build Coastguard Worker public platform SDK API. 20*d57664e9SAndroid Build Coastguard Workero This library can see and instantiate internal platform classes, but it must not 21*d57664e9SAndroid Build Coastguard Worker expose them in any public method (or by extending them via inheritance). This would 22*d57664e9SAndroid Build Coastguard Worker break clients of the library because they cannot see the internal platform classes. 23*d57664e9SAndroid Build Coastguard Worker 24*d57664e9SAndroid Build Coastguard WorkerThis library is distributed in the system image, and loaded as 25*d57664e9SAndroid Build Coastguard Workera shared library. So you can change the implementation, but not 26*d57664e9SAndroid Build Coastguard Workerthe interface. In this way it is like framework.jar. 27*d57664e9SAndroid Build Coastguard Worker 28*d57664e9SAndroid Build Coastguard Worker--- Why does this library exist? --- 29*d57664e9SAndroid Build Coastguard Worker 30*d57664e9SAndroid Build Coastguard WorkerUnbundled apps cannot use internal platform classes. 31*d57664e9SAndroid Build Coastguard Worker 32*d57664e9SAndroid Build Coastguard WorkerThis library will eventually be replaced when the provisioned certificate- 33*d57664e9SAndroid Build Coastguard Workerbased signing infrastructure that is currently defined in the support library 34*d57664e9SAndroid Build Coastguard Workeris reintegrated with the framework in a new API. That API isn't ready yet so 35*d57664e9SAndroid Build Coastguard Workerthis library is a compromise to make new capabilities available to the system 36*d57664e9SAndroid Build Coastguard Workerwithout exposing the full surface area of the support library. 37*d57664e9SAndroid Build Coastguard Worker 38