Merge "Add final to MediaRouter2" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ccd4db5e16
@@ -27051,7 +27051,7 @@ package android.media {
|
|||||||
method public abstract void onVolumeUpdateRequest(android.media.MediaRouter.RouteInfo, int);
|
method public abstract void onVolumeUpdateRequest(android.media.MediaRouter.RouteInfo, int);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MediaRouter2 {
|
public final class MediaRouter2 {
|
||||||
method @NonNull public java.util.List<android.media.MediaRouter2.RoutingController> getControllers();
|
method @NonNull public java.util.List<android.media.MediaRouter2.RoutingController> getControllers();
|
||||||
method @NonNull public static android.media.MediaRouter2 getInstance(@NonNull android.content.Context);
|
method @NonNull public static android.media.MediaRouter2 getInstance(@NonNull android.content.Context);
|
||||||
method @NonNull public java.util.List<android.media.MediaRoute2Info> getRoutes();
|
method @NonNull public java.util.List<android.media.MediaRoute2Info> getRoutes();
|
||||||
|
|||||||
@@ -466,10 +466,6 @@ public abstract class MediaRoute2ProviderService extends Service {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<RoutingSessionInfo> sessionInfos;
|
|
||||||
synchronized (mSessionLock) {
|
|
||||||
sessionInfos = new ArrayList<>(mSessionInfo.values());
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
mRemoteCallback.updateState(mProviderInfo);
|
mRemoteCallback.updateState(mProviderInfo);
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ import java.util.stream.Collectors;
|
|||||||
// TODO: Add method names at the beginning of log messages. (e.g. updateControllerOnHandler)
|
// TODO: Add method names at the beginning of log messages. (e.g. updateControllerOnHandler)
|
||||||
// Not only MediaRouter2, but also to service / manager / provider.
|
// Not only MediaRouter2, but also to service / manager / provider.
|
||||||
// TODO: ensure thread-safe and document it
|
// TODO: ensure thread-safe and document it
|
||||||
public class MediaRouter2 {
|
public final class MediaRouter2 {
|
||||||
private static final String TAG = "MR2";
|
private static final String TAG = "MR2";
|
||||||
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
||||||
private static final Object sRouterLock = new Object();
|
private static final Object sRouterLock = new Object();
|
||||||
@@ -93,9 +93,9 @@ public class MediaRouter2 {
|
|||||||
MediaRouter2Stub mStub;
|
MediaRouter2Stub mStub;
|
||||||
|
|
||||||
@GuardedBy("sRouterLock")
|
@GuardedBy("sRouterLock")
|
||||||
private Map<String, RoutingController> mRoutingControllers = new ArrayMap<>();
|
private final Map<String, RoutingController> mRoutingControllers = new ArrayMap<>();
|
||||||
|
|
||||||
private AtomicInteger mControllerCreationRequestCnt = new AtomicInteger(1);
|
private final AtomicInteger mControllerCreationRequestCnt = new AtomicInteger(1);
|
||||||
|
|
||||||
final Handler mHandler;
|
final Handler mHandler;
|
||||||
@GuardedBy("sRouterLock")
|
@GuardedBy("sRouterLock")
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ import java.util.stream.Collectors;
|
|||||||
* A class that monitors and controls media routing of other apps.
|
* A class that monitors and controls media routing of other apps.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public class MediaRouter2Manager {
|
public final class MediaRouter2Manager {
|
||||||
private static final String TAG = "MR2Manager";
|
private static final String TAG = "MR2Manager";
|
||||||
private static final Object sLock = new Object();
|
private static final Object sLock = new Object();
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ public class MediaRouter2Manager {
|
|||||||
|
|
||||||
final String mPackageName;
|
final String mPackageName;
|
||||||
|
|
||||||
private Context mContext;
|
private final Context mContext;
|
||||||
@GuardedBy("sLock")
|
@GuardedBy("sLock")
|
||||||
private Client mClient;
|
private Client mClient;
|
||||||
private final IMediaRouterService mMediaRouterService;
|
private final IMediaRouterService mMediaRouterService;
|
||||||
@@ -74,7 +74,7 @@ public class MediaRouter2Manager {
|
|||||||
@NonNull
|
@NonNull
|
||||||
final ConcurrentMap<String, List<String>> mPreferredFeaturesMap = new ConcurrentHashMap<>();
|
final ConcurrentMap<String, List<String>> mPreferredFeaturesMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
private AtomicInteger mNextRequestId = new AtomicInteger(1);
|
private final AtomicInteger mNextRequestId = new AtomicInteger(1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets an instance of media router manager that controls media route of other applications.
|
* Gets an instance of media router manager that controls media route of other applications.
|
||||||
|
|||||||
Reference in New Issue
Block a user