Simplify if/else branch in MR2ServiceImpl

Non-functional change to deduplicate code.

Test: Should be trivially correct.
Bug: 205124386
Change-Id: I07f8182d4b4b3dfea2dc5cb63edd77858becd87a
This commit is contained in:
Santiago Seifert
2023-01-04 16:39:00 +00:00
parent 5d7d1378df
commit b7a1333b89

View File

@@ -1938,12 +1938,12 @@ class MediaRouter2ServiceImpl {
@NonNull RoutingSessionInfo oldSession, @NonNull MediaRoute2Info route) {
try {
if (route.isSystemRoute() && !routerRecord.mHasModifyAudioRoutingPermission) {
routerRecord.mRouter.requestCreateSessionByManager(uniqueRequestId,
oldSession, mSystemProvider.getDefaultRoute());
} else {
routerRecord.mRouter.requestCreateSessionByManager(uniqueRequestId,
oldSession, route);
// The router lacks permission to modify system routing, so we hide system
// route info from them.
route = mSystemProvider.getDefaultRoute();
}
routerRecord.mRouter.requestCreateSessionByManager(
uniqueRequestId, oldSession, route);
} catch (RemoteException ex) {
Slog.w(TAG, "getSessionHintsForCreatingSessionOnHandler: "
+ "Failed to request. Router probably died.", ex);