Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / library / aosp-stubs / src / main / java / com / android / media / remotedisplay / RemoteDisplay.java
RemoteDisplay.java55 lines · 2.4 KiBRaw
| 1 | package com.android.media.remotedisplay; |
| 2 | |
| 3 | /** |
| 4 | * Compile-only stub of {@code com.android.media.remotedisplay.RemoteDisplay}, one |
| 5 | * route published by a {@link RemoteDisplayProvider}. Not packaged; the real class |
| 6 | * comes from the {@code com.android.media.remotedisplay} shared library, which the |
| 7 | * app pulls in with {@code <uses-library>}. |
| 8 | * |
| 9 | * <p>The status values mirror {@code android.media.RemoteDisplayState.RemoteDisplayInfo} |
| 10 | * and are what {@code MediaRouter} turns into a route's state, so |
| 11 | * {@code WifiDisplaySettings} draws its row from them. |
| 12 | * |
| 13 | * <p>Volume is not declared. Nothing in this app does volume control, and javac inlines a stub's |
| 14 | * {@code static final int} into the caller - so a constant declared here but never read against the |
| 15 | * real class is a wrong value that no build would catch. The real class does have |
| 16 | * {@code PLAYBACK_VOLUME_*} and the volume accessors; add them only alongside a caller. |
| 17 | * |
| 18 | * <p>Verified against frameworks/base/media/lib/remotedisplay/.../RemoteDisplay.java and the |
| 19 | * {@code STATUS_*} values in frameworks/base/media/java/android/media/RemoteDisplayState.java. |
| 20 | */ |
| 21 | public class RemoteDisplay { |
| 22 | public static final int STATUS_NOT_AVAILABLE = 0; |
| 23 | public static final int STATUS_IN_USE = 1; |
| 24 | public static final int STATUS_AVAILABLE = 2; |
| 25 | public static final int STATUS_CONNECTING = 3; |
| 26 | public static final int STATUS_CONNECTED = 4; |
| 27 | public RemoteDisplay(String id, String name) {} |
| 28 | public String getId() { |
| 29 | return null; |
| 30 | } |
| 31 | public String getName() { |
| 32 | return null; |
| 33 | } |
| 34 | public void setName(String name) {} |
| 35 | public String getDescription() { |
| 36 | return null; |
| 37 | } |
| 38 | public void setDescription(String description) {} |
| 39 | public int getStatus() { |
| 40 | return STATUS_NOT_AVAILABLE; |
| 41 | } |
| 42 | public void setStatus(int status) {} |
| 43 | /** |
| 44 | * The id of the {@code Display} this route presents on, or -1 for none. |
| 45 | * |
| 46 | * <p>This is how a remote display route acquires a display at all. {@code MediaRouterService} |
| 47 | * does not create one: {@code computePresentationDisplayId} only reads this value back and |
| 48 | * canonicalises negatives, and its comment requires the id to name a display that already |
| 49 | * exists. So the provider creates the display and publishes its id here. |
| 50 | */ |
| 51 | public int getPresentationDisplayId() { |
| 52 | return -1; |
| 53 | } |
| 54 | public void setPresentationDisplayId(int presentationDisplayId) {} |
| 55 | } |