1 There are two libraries defined in this directory: 2 First, com.android.media.remotedisplay.jar is a shared java library 3 containing classes required by unbundled remote display providers. 4 Second, com.android.media.remotedisplay.stubs.jar is a stub for the shared 5 library which provides build-time APIs to the unbundled clients. 6 7 At 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 9 parent classloader, regardless of whether the stub library is linked to the 10 app statically or dynamically, the real classes are loaded from the shared 11 library. 12 13 --- Rules of this library --- 14 o The stub library is effectively a PUBLIC API for unbundled remote display providers 15 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. 18 o 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 22 This library is distributed in the system image, and loaded as 23 a shared library. So you can change the implementation, but not 24 the interface. In this way it is like framework.jar. 25 26 --- Why does this library exists? --- 27 28 Unbundled remote display providers (such as Cast) cannot use internal 29 platform classes. 30 31 This library will eventually be replaced when the media route provider 32 infrastructure that is currently defined in the support library is reintegrated 33 with the framework in a new API. That API isn't ready yet so this 34 library is a compromise to make new capabilities available to the system 35 without exposing the full surface area of the support library media 36 route provider protocol. 37