Jiyong Park | bc697b6 | 2018-02-22 16:21:14 +0900 | [diff] [blame] | 1 | There are two libraries defined in this directory: |
| 2 | First, com.android.media.remotedisplay.jar is a shared java library |
Jeff Brown | f3c99e8 | 2013-11-05 16:29:21 -0800 | [diff] [blame] | 3 | containing classes required by unbundled remote display providers. |
Jiyong Park | bc697b6 | 2018-02-22 16:21:14 +0900 | [diff] [blame] | 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. |
Jeff Brown | f3c99e8 | 2013-11-05 16:29:21 -0800 | [diff] [blame] | 12 | |
| 13 | --- Rules of this library --- |
Jiyong Park | bc697b6 | 2018-02-22 16:21:14 +0900 | [diff] [blame] | 14 | o The stub library is effectively a PUBLIC API for unbundled remote display providers |
Jeff Brown | f3c99e8 | 2013-11-05 16:29:21 -0800 | [diff] [blame] | 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. |