Methods Summary |
---|
private void | dispose(boolean finalized)
if (mPtr != 0) {
if (mGuard != null) {
if (finalized) {
mGuard.warnIfOpen();
} else {
mGuard.close();
}
}
nativeDispose(mPtr);
mPtr = 0;
}
|
public void | dispose()Disconnects the remote display and stops listening for new connections.
dispose(false);
|
protected void | finalize()
try {
dispose(true);
} finally {
super.finalize();
}
|
public static android.media.RemoteDisplay | listen(java.lang.String iface, android.media.RemoteDisplay$Listener listener, android.os.Handler handler)Starts listening for displays to be connected on the specified interface.
if (iface == null) {
throw new IllegalArgumentException("iface must not be null");
}
if (listener == null) {
throw new IllegalArgumentException("listener must not be null");
}
if (handler == null) {
throw new IllegalArgumentException("handler must not be null");
}
RemoteDisplay display = new RemoteDisplay(listener, handler);
display.startListening(iface);
return display;
|
private native void | nativeDispose(long ptr)
|
private native long | nativeListen(java.lang.String iface)
|
private native void | nativePause(long ptr)
|
private native void | nativeResume(long ptr)
|
private void | notifyDisplayConnected(android.view.Surface surface, int width, int height, int flags, int session)
mHandler.post(new Runnable() {
@Override
public void run() {
mListener.onDisplayConnected(surface, width, height, flags, session);
}
});
|
private void | notifyDisplayDisconnected()
mHandler.post(new Runnable() {
@Override
public void run() {
mListener.onDisplayDisconnected();
}
});
|
private void | notifyDisplayError(int error)
mHandler.post(new Runnable() {
@Override
public void run() {
mListener.onDisplayError(error);
}
});
|
public void | pause()
nativePause(mPtr);
|
public void | resume()
nativeResume(mPtr);
|
private void | startListening(java.lang.String iface)
mPtr = nativeListen(iface);
if (mPtr == 0) {
throw new IllegalStateException("Could not start listening for "
+ "remote display connection on \"" + iface + "\"");
}
mGuard.open("dispose");
|