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

Commit 111c8c7b authored by Santiago Seifert's avatar Santiago Seifert
Browse files

Fix spammy logging for session creation notifications

This change is a (mostly) non-functional change to improve logging
when the binder transaction to notify a manager of a session
creation fails.

Bug: 360129098
Test: Manual simple casting flow using routing demo app
Flag: EXEMPT refactor
Change-Id: If9ee7c7e69254c27630a388737b44925de735d49
parent 26bc2eb3
Loading
Loading
Loading
Loading
+20 −8
Original line number Diff line number Diff line
@@ -2959,6 +2959,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.
         *
@@ -4020,14 +4035,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);
            }
        }