Merge "Add final to MediaRouter2" into rvc-dev am: ccd4db5e16 am: c27bc21c71 am: 674b32f0c5
Change-Id: Ic7133989778ea46d02310233135a36ddd1119d58
This commit is contained in:
@@ -27051,7 +27051,7 @@ package android.media {
|
||||
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 static android.media.MediaRouter2 getInstance(@NonNull android.content.Context);
|
||||
method @NonNull public java.util.List<android.media.MediaRoute2Info> getRoutes();
|
||||
|
||||
@@ -466,10 +466,6 @@ public abstract class MediaRoute2ProviderService extends Service {
|
||||
return;
|
||||
}
|
||||
|
||||
List<RoutingSessionInfo> sessionInfos;
|
||||
synchronized (mSessionLock) {
|
||||
sessionInfos = new ArrayList<>(mSessionInfo.values());
|
||||
}
|
||||
try {
|
||||
mRemoteCallback.updateState(mProviderInfo);
|
||||
} 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)
|
||||
// Not only MediaRouter2, but also to service / manager / provider.
|
||||
// TODO: ensure thread-safe and document it
|
||||
public class MediaRouter2 {
|
||||
public final class MediaRouter2 {
|
||||
private static final String TAG = "MR2";
|
||||
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
||||
private static final Object sRouterLock = new Object();
|
||||
@@ -93,9 +93,9 @@ public class MediaRouter2 {
|
||||
MediaRouter2Stub mStub;
|
||||
|
||||
@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;
|
||||
@GuardedBy("sRouterLock")
|
||||
|
||||
@@ -50,7 +50,7 @@ import java.util.stream.Collectors;
|
||||
* A class that monitors and controls media routing of other apps.
|
||||
* @hide
|
||||
*/
|
||||
public class MediaRouter2Manager {
|
||||
public final class MediaRouter2Manager {
|
||||
private static final String TAG = "MR2Manager";
|
||||
private static final Object sLock = new Object();
|
||||
|
||||
@@ -61,7 +61,7 @@ public class MediaRouter2Manager {
|
||||
|
||||
final String mPackageName;
|
||||
|
||||
private Context mContext;
|
||||
private final Context mContext;
|
||||
@GuardedBy("sLock")
|
||||
private Client mClient;
|
||||
private final IMediaRouterService mMediaRouterService;
|
||||
@@ -74,7 +74,7 @@ public class MediaRouter2Manager {
|
||||
@NonNull
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user