Loading media/java/android/media/MediaRouter.java +8 −8 Original line number Diff line number Diff line Loading @@ -387,7 +387,7 @@ public class MediaRouter { try { mMediaRouterService.registerClientGroupId(mClient, groupId); } catch (RemoteException ex) { Log.e(TAG, "Unable to register group ID of the client.", ex); ex.rethrowFromSystemServer(); } } } Loading Loading @@ -439,7 +439,7 @@ public class MediaRouter { try { mMediaRouterService.unregisterClient(mClient); } catch (RemoteException ex) { Log.e(TAG, "Unable to unregister media router client.", ex); ex.rethrowFromSystemServer(); } mClient = null; } Loading @@ -466,7 +466,7 @@ public class MediaRouter { mMediaRouterService.setDiscoveryRequest(mClient, mDiscoveryRequestRouteTypes, mDiscoverRequestActiveScan); } catch (RemoteException ex) { Log.e(TAG, "Unable to publish media router client discovery request.", ex); ex.rethrowFromSystemServer(); } } } Loading @@ -478,7 +478,7 @@ public class MediaRouter { mSelectedRoute != null ? mSelectedRoute.mGlobalRouteId : null, explicit); } catch (RemoteException ex) { Log.e(TAG, "Unable to publish media router client selected route.", ex); ex.rethrowFromSystemServer(); } } } Loading @@ -490,7 +490,7 @@ public class MediaRouter { try { mClientState = mMediaRouterService.getState(mClient); } catch (RemoteException ex) { Log.e(TAG, "Unable to retrieve media router client state.", ex); ex.rethrowFromSystemServer(); } } final ArrayList<MediaRouterClientState.RouteInfo> globalRoutes = Loading Loading @@ -535,7 +535,7 @@ public class MediaRouter { mMediaRouterService.requestSetVolume(mClient, route.mGlobalRouteId, volume); } catch (RemoteException ex) { Log.w(TAG, "Unable to request volume change.", ex); ex.rethrowFromSystemServer(); } } } Loading @@ -546,7 +546,7 @@ public class MediaRouter { mMediaRouterService.requestUpdateVolume(mClient, route.mGlobalRouteId, direction); } catch (RemoteException ex) { Log.w(TAG, "Unable to request volume change.", ex); ex.rethrowFromSystemServer(); } } } Loading Loading @@ -653,7 +653,7 @@ public class MediaRouter { try { return mMediaRouterService.isPlaybackActive(mClient); } catch (RemoteException ex) { Log.e(TAG, "Unable to retrieve playback active state.", ex); ex.rethrowFromSystemServer(); } } return false; Loading services/core/java/com/android/server/media/MediaRouterService.java +2 −39 Original line number Diff line number Diff line Loading @@ -189,10 +189,6 @@ public final class MediaRouterService extends IMediaRouterService.Stub // Binder call @Override public void registerClientAsUser(IMediaRouterClient client, String packageName, int userId) { if (client == null) { throw new IllegalArgumentException("client must not be null"); } final int uid = Binder.getCallingUid(); if (!validatePackageName(uid, packageName)) { throw new SecurityException("packageName must match the calling uid"); Loading @@ -217,9 +213,6 @@ public final class MediaRouterService extends IMediaRouterService.Stub // Binder call @Override public void registerClientGroupId(IMediaRouterClient client, String groupId) { if (client == null) { throw new NullPointerException("client must not be null"); } if (mContext.checkCallingOrSelfPermission( android.Manifest.permission.CONFIGURE_WIFI_DISPLAY) != PackageManager.PERMISSION_GRANTED) { Loading @@ -240,10 +233,6 @@ public final class MediaRouterService extends IMediaRouterService.Stub // Binder call @Override public void unregisterClient(IMediaRouterClient client) { if (client == null) { throw new IllegalArgumentException("client must not be null"); } final long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { Loading @@ -257,10 +246,6 @@ public final class MediaRouterService extends IMediaRouterService.Stub // Binder call @Override public MediaRouterClientState getState(IMediaRouterClient client) { if (client == null) { throw new IllegalArgumentException("client must not be null"); } final long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { Loading @@ -274,10 +259,6 @@ public final class MediaRouterService extends IMediaRouterService.Stub // Binder call @Override public boolean isPlaybackActive(IMediaRouterClient client) { if (client == null) { throw new IllegalArgumentException("client must not be null"); } final long token = Binder.clearCallingIdentity(); try { ClientRecord clientRecord; Loading Loading @@ -314,10 +295,6 @@ public final class MediaRouterService extends IMediaRouterService.Stub @Override public void setDiscoveryRequest(IMediaRouterClient client, int routeTypes, boolean activeScan) { if (client == null) { throw new IllegalArgumentException("client must not be null"); } final long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { Loading @@ -336,10 +313,6 @@ public final class MediaRouterService extends IMediaRouterService.Stub // selected route or a default selection. @Override public void setSelectedRoute(IMediaRouterClient client, String routeId, boolean explicit) { if (client == null) { throw new IllegalArgumentException("client must not be null"); } final long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { Loading @@ -353,12 +326,7 @@ public final class MediaRouterService extends IMediaRouterService.Stub // Binder call @Override public void requestSetVolume(IMediaRouterClient client, String routeId, int volume) { if (client == null) { throw new IllegalArgumentException("client must not be null"); } if (routeId == null) { throw new IllegalArgumentException("routeId must not be null"); } Objects.requireNonNull(routeId, "routeId must not be null"); final long token = Binder.clearCallingIdentity(); try { Loading @@ -373,12 +341,7 @@ public final class MediaRouterService extends IMediaRouterService.Stub // Binder call @Override public void requestUpdateVolume(IMediaRouterClient client, String routeId, int direction) { if (client == null) { throw new IllegalArgumentException("client must not be null"); } if (routeId == null) { throw new IllegalArgumentException("routeId must not be null"); } Objects.requireNonNull(routeId, "routeId must not be null"); final long token = Binder.clearCallingIdentity(); try { Loading Loading
media/java/android/media/MediaRouter.java +8 −8 Original line number Diff line number Diff line Loading @@ -387,7 +387,7 @@ public class MediaRouter { try { mMediaRouterService.registerClientGroupId(mClient, groupId); } catch (RemoteException ex) { Log.e(TAG, "Unable to register group ID of the client.", ex); ex.rethrowFromSystemServer(); } } } Loading Loading @@ -439,7 +439,7 @@ public class MediaRouter { try { mMediaRouterService.unregisterClient(mClient); } catch (RemoteException ex) { Log.e(TAG, "Unable to unregister media router client.", ex); ex.rethrowFromSystemServer(); } mClient = null; } Loading @@ -466,7 +466,7 @@ public class MediaRouter { mMediaRouterService.setDiscoveryRequest(mClient, mDiscoveryRequestRouteTypes, mDiscoverRequestActiveScan); } catch (RemoteException ex) { Log.e(TAG, "Unable to publish media router client discovery request.", ex); ex.rethrowFromSystemServer(); } } } Loading @@ -478,7 +478,7 @@ public class MediaRouter { mSelectedRoute != null ? mSelectedRoute.mGlobalRouteId : null, explicit); } catch (RemoteException ex) { Log.e(TAG, "Unable to publish media router client selected route.", ex); ex.rethrowFromSystemServer(); } } } Loading @@ -490,7 +490,7 @@ public class MediaRouter { try { mClientState = mMediaRouterService.getState(mClient); } catch (RemoteException ex) { Log.e(TAG, "Unable to retrieve media router client state.", ex); ex.rethrowFromSystemServer(); } } final ArrayList<MediaRouterClientState.RouteInfo> globalRoutes = Loading Loading @@ -535,7 +535,7 @@ public class MediaRouter { mMediaRouterService.requestSetVolume(mClient, route.mGlobalRouteId, volume); } catch (RemoteException ex) { Log.w(TAG, "Unable to request volume change.", ex); ex.rethrowFromSystemServer(); } } } Loading @@ -546,7 +546,7 @@ public class MediaRouter { mMediaRouterService.requestUpdateVolume(mClient, route.mGlobalRouteId, direction); } catch (RemoteException ex) { Log.w(TAG, "Unable to request volume change.", ex); ex.rethrowFromSystemServer(); } } } Loading Loading @@ -653,7 +653,7 @@ public class MediaRouter { try { return mMediaRouterService.isPlaybackActive(mClient); } catch (RemoteException ex) { Log.e(TAG, "Unable to retrieve playback active state.", ex); ex.rethrowFromSystemServer(); } } return false; Loading
services/core/java/com/android/server/media/MediaRouterService.java +2 −39 Original line number Diff line number Diff line Loading @@ -189,10 +189,6 @@ public final class MediaRouterService extends IMediaRouterService.Stub // Binder call @Override public void registerClientAsUser(IMediaRouterClient client, String packageName, int userId) { if (client == null) { throw new IllegalArgumentException("client must not be null"); } final int uid = Binder.getCallingUid(); if (!validatePackageName(uid, packageName)) { throw new SecurityException("packageName must match the calling uid"); Loading @@ -217,9 +213,6 @@ public final class MediaRouterService extends IMediaRouterService.Stub // Binder call @Override public void registerClientGroupId(IMediaRouterClient client, String groupId) { if (client == null) { throw new NullPointerException("client must not be null"); } if (mContext.checkCallingOrSelfPermission( android.Manifest.permission.CONFIGURE_WIFI_DISPLAY) != PackageManager.PERMISSION_GRANTED) { Loading @@ -240,10 +233,6 @@ public final class MediaRouterService extends IMediaRouterService.Stub // Binder call @Override public void unregisterClient(IMediaRouterClient client) { if (client == null) { throw new IllegalArgumentException("client must not be null"); } final long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { Loading @@ -257,10 +246,6 @@ public final class MediaRouterService extends IMediaRouterService.Stub // Binder call @Override public MediaRouterClientState getState(IMediaRouterClient client) { if (client == null) { throw new IllegalArgumentException("client must not be null"); } final long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { Loading @@ -274,10 +259,6 @@ public final class MediaRouterService extends IMediaRouterService.Stub // Binder call @Override public boolean isPlaybackActive(IMediaRouterClient client) { if (client == null) { throw new IllegalArgumentException("client must not be null"); } final long token = Binder.clearCallingIdentity(); try { ClientRecord clientRecord; Loading Loading @@ -314,10 +295,6 @@ public final class MediaRouterService extends IMediaRouterService.Stub @Override public void setDiscoveryRequest(IMediaRouterClient client, int routeTypes, boolean activeScan) { if (client == null) { throw new IllegalArgumentException("client must not be null"); } final long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { Loading @@ -336,10 +313,6 @@ public final class MediaRouterService extends IMediaRouterService.Stub // selected route or a default selection. @Override public void setSelectedRoute(IMediaRouterClient client, String routeId, boolean explicit) { if (client == null) { throw new IllegalArgumentException("client must not be null"); } final long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { Loading @@ -353,12 +326,7 @@ public final class MediaRouterService extends IMediaRouterService.Stub // Binder call @Override public void requestSetVolume(IMediaRouterClient client, String routeId, int volume) { if (client == null) { throw new IllegalArgumentException("client must not be null"); } if (routeId == null) { throw new IllegalArgumentException("routeId must not be null"); } Objects.requireNonNull(routeId, "routeId must not be null"); final long token = Binder.clearCallingIdentity(); try { Loading @@ -373,12 +341,7 @@ public final class MediaRouterService extends IMediaRouterService.Stub // Binder call @Override public void requestUpdateVolume(IMediaRouterClient client, String routeId, int direction) { if (client == null) { throw new IllegalArgumentException("client must not be null"); } if (routeId == null) { throw new IllegalArgumentException("routeId must not be null"); } Objects.requireNonNull(routeId, "routeId must not be null"); final long token = Binder.clearCallingIdentity(); try { Loading