Merge "Send features first and then routes when registering MR2Manager" into sc-dev am: 9c168a565a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15165351 Change-Id: Ie9284e5e4f3f00f182764b98f63906ec6acff4e5
This commit is contained in:
@@ -903,9 +903,9 @@ class MediaRouter2ServiceImpl {
|
||||
userRecord.mManagerRecords.add(managerRecord);
|
||||
mAllManagerRecords.put(binder, managerRecord);
|
||||
|
||||
userRecord.mHandler.sendMessage(obtainMessage(UserHandler::notifyRoutesToManager,
|
||||
userRecord.mHandler, manager));
|
||||
|
||||
// Note: Features should be sent first before the routes. If not, the
|
||||
// RouteCallback#onRoutesAdded() for system MR2 will never be called with initial routes
|
||||
// due to the lack of features.
|
||||
for (RouterRecord routerRecord : userRecord.mRouterRecords) {
|
||||
// TODO: UserRecord <-> routerRecord, why do they reference each other?
|
||||
// How about removing mUserRecord from routerRecord?
|
||||
@@ -913,6 +913,9 @@ class MediaRouter2ServiceImpl {
|
||||
obtainMessage(UserHandler::notifyPreferredFeaturesChangedToManager,
|
||||
routerRecord.mUserRecord.mHandler, routerRecord, manager));
|
||||
}
|
||||
|
||||
userRecord.mHandler.sendMessage(obtainMessage(UserHandler::notifyRoutesToManager,
|
||||
userRecord.mHandler, manager));
|
||||
}
|
||||
|
||||
private void unregisterManagerLocked(@NonNull IMediaRouter2Manager manager, boolean died) {
|
||||
|
||||
Reference in New Issue
Block a user