blob: 1a52c4dcae58ea300253a90526d502c04440126e [file] [log] [blame]
Jiyong Parkbc697b62018-02-22 16:21:14 +09001There are two libraries defined in this directory:
2First, com.android.media.remotedisplay.jar is a shared java library
Jeff Brownf3c99e82013-11-05 16:29:21 -08003containing classes required by unbundled remote display providers.
Jiyong Parkbc697b62018-02-22 16:21:14 +09004Second, com.android.media.remotedisplay.stubs.jar is a stub for the shared
5library which provides build-time APIs to the unbundled clients.
6
7At runtime, the shared library is added to the classloader of the app via the
8<uses-library> tag. And since Java always tries to load a class from the
9parent classloader, regardless of whether the stub library is linked to the
10app statically or dynamically, the real classes are loaded from the shared
11library.
Jeff Brownf3c99e82013-11-05 16:29:21 -080012
13--- Rules of this library ---
Jiyong Parkbc697b62018-02-22 16:21:14 +090014o The stub library is effectively a PUBLIC API for unbundled remote display providers
Jeff Brownf3c99e82013-11-05 16:29:21 -080015 that may be distributed outside the system image. So it MUST BE API STABLE.
16 You can add but not remove. The rules are the same as for the
17 public platform SDK API.
18o This library can see and instantiate internal platform classes, but it must not
19 expose them in any public method (or by extending them via inheritance). This would
20 break clients of the library because they cannot see the internal platform classes.
21
22This library is distributed in the system image, and loaded as
23a shared library. So you can change the implementation, but not
24the interface. In this way it is like framework.jar.
25
26--- Why does this library exists? ---
27
28Unbundled remote display providers (such as Cast) cannot use internal
29platform classes.
30
31This library will eventually be replaced when the media route provider
32infrastructure that is currently defined in the support library is reintegrated
33with the framework in a new API. That API isn't ready yet so this
34library is a compromise to make new capabilities available to the system
35without exposing the full surface area of the support library media
36route provider protocol.