Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 271bab7b authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix spammy logging for session creation notifications" into main

parents a9abe035 111c8c7b
Loading
Loading
Loading
Loading
+20 −8
Original line number Diff line number Diff line
@@ -2955,6 +2955,21 @@ class MediaRouter2ServiceImpl {
            }
        }

        /**
         * Notifies the corresponding manager of the creation of the given {@link
         * RoutingSessionInfo}.
         *
         * @param requestId The id of the request that originated the creation of the session.
         * @param session The session that was created.
         */
        public void notifySessionCreated(int requestId, @NonNull RoutingSessionInfo session) {
            try {
                mManager.notifySessionCreated(requestId, session);
            } catch (RemoteException ex) {
                logRemoteException("notifySessionCreated", ex);
            }
        }

        /**
         * Notifies the corresponding manager of the availability of the given routes.
         *
@@ -4042,14 +4057,11 @@ class MediaRouter2ServiceImpl {
            int originalRequestId = toOriginalRequestId(managerRequestId);

            for (ManagerRecord manager : getManagerRecords()) {
                try {
                    manager.mManager.notifySessionCreated(
                            ((manager.mManagerId == requesterId) ? originalRequestId :
                                    MediaRouter2Manager.REQUEST_ID_NONE), session);
                } catch (RemoteException ex) {
                    Slog.w(TAG, "notifySessionCreatedToManagers: "
                            + "Failed to notify. Manager probably died.", ex);
                }
                int requestId =
                        manager.mManagerId == requesterId
                                ? originalRequestId
                                : MediaRouter2Manager.REQUEST_ID_NONE;
                manager.notifySessionCreated(requestId, session);
            }
        }