Methods Summary |
---|
private void | addCallback(android.media.projection.IMediaProjectionWatcherCallback callback)
IBinder.DeathRecipient deathRecipient = new IBinder.DeathRecipient() {
@Override
public void binderDied() {
synchronized (mLock) {
removeCallback(callback);
}
}
};
synchronized (mLock) {
mCallbackDelegate.add(callback);
linkDeathRecipientLocked(callback, deathRecipient);
}
|
private void | dispatchStart(com.android.server.media.projection.MediaProjectionManagerService$MediaProjection projection)
mCallbackDelegate.dispatchStart(projection);
|
private void | dispatchStop(com.android.server.media.projection.MediaProjectionManagerService$MediaProjection projection)
mCallbackDelegate.dispatchStop(projection);
|
private void | dump(java.io.PrintWriter pw)
pw.println("MEDIA PROJECTION MANAGER (dumpsys media_projection)");
synchronized (mLock) {
pw.println("Media Projection: ");
if (mProjectionGrant != null ) {
mProjectionGrant.dump(pw);
} else {
pw.println("null");
}
}
|
private android.media.projection.MediaProjectionInfo | getActiveProjectionInfo()
synchronized (mLock) {
if (mProjectionGrant == null) {
return null;
}
return mProjectionGrant.getProjectionInfo();
}
|
private boolean | isValidMediaProjection(android.os.IBinder token)
synchronized (mLock) {
if (mProjectionToken != null) {
return mProjectionToken.equals(token);
}
return false;
}
|
private void | linkDeathRecipientLocked(android.media.projection.IMediaProjectionWatcherCallback callback, android.os.IBinder.DeathRecipient deathRecipient)
try {
final IBinder token = callback.asBinder();
token.linkToDeath(deathRecipient, 0);
mDeathEaters.put(token, deathRecipient);
} catch (RemoteException e) {
Slog.e(TAG, "Unable to link to death for media projection monitoring callback", e);
}
|
public void | monitor()
synchronized (mLock) { /* check for deadlock */ }
|
public void | onStart()
publishBinderService(Context.MEDIA_PROJECTION_SERVICE, new BinderService(),
false /*allowIsolated*/);
mMediaRouter.addCallback(MediaRouter.ROUTE_TYPE_REMOTE_DISPLAY, mMediaRouterCallback,
MediaRouter.CALLBACK_FLAG_PASSIVE_DISCOVERY);
|
public void | onSwitchUser(int userId)
mMediaRouter.rebindAsUser(userId);
synchronized (mLock) {
if (mProjectionGrant != null) {
mProjectionGrant.stop();
}
}
|
private void | removeCallback(android.media.projection.IMediaProjectionWatcherCallback callback)
synchronized (mLock) {
unlinkDeathRecipientLocked(callback);
mCallbackDelegate.remove(callback);
}
|
private void | startProjectionLocked(com.android.server.media.projection.MediaProjectionManagerService$MediaProjection projection)
if (mProjectionGrant != null) {
mProjectionGrant.stop();
}
if (mMediaRouteInfo != null) {
mMediaRouter.getDefaultRoute().select();
}
mProjectionToken = projection.asBinder();
mProjectionGrant = projection;
dispatchStart(projection);
|
private void | stopProjectionLocked(com.android.server.media.projection.MediaProjectionManagerService$MediaProjection projection)
mProjectionToken = null;
mProjectionGrant = null;
dispatchStop(projection);
|
private static java.lang.String | typeToString(int type)
switch (type) {
case MediaProjectionManager.TYPE_SCREEN_CAPTURE:
return "TYPE_SCREEN_CAPTURE";
case MediaProjectionManager.TYPE_MIRRORING:
return "TYPE_MIRRORING";
case MediaProjectionManager.TYPE_PRESENTATION:
return "TYPE_PRESENTATION";
}
return Integer.toString(type);
|
private void | unlinkDeathRecipientLocked(android.media.projection.IMediaProjectionWatcherCallback callback)
final IBinder token = callback.asBinder();
IBinder.DeathRecipient deathRecipient = mDeathEaters.remove(token);
if (deathRecipient != null) {
token.unlinkToDeath(deathRecipient, 0);
}
|