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

Commit a58673f6 authored by Santiago Seifert's avatar Santiago Seifert Committed by Android (Google) Code Review
Browse files

Merge "Fix lack of client package name after system session updates" into main

parents fa76f7af ecac7bb1
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -1411,6 +1411,11 @@ public final class MediaRouter2 {
        RoutingController controller =
                getMatchingController(sessionInfo, /* logPrefix */ "updateControllerOnHandler");
        if (controller != null) {
            if (Flags.enableMirroringInMediaRouter2()) {
                sessionInfo =
                        ensureClientPackageNameForSystemSession(
                                sessionInfo, mImpl.getClientPackageName());
            }
            controller.setRoutingSessionInfo(sessionInfo);
            notifyControllerUpdated(controller);
        }
@@ -3737,13 +3742,12 @@ public final class MediaRouter2 {
            }
        }

        /**
         * Returns {@code null}. The client package name is only associated to proxy {@link
         * MediaRouter2} instances.
         */
        @Override
        public String getClientPackageName() {
            return null;
            // TODO: b/362507305 - Merge getPackageName and getClientPackageName so that they both
            // return the package name of the client app, once enableMirroringInMediaRouter2 reaches
            // nextfood.
            return Flags.enableMirroringInMediaRouter2() ? mPackageName : null;
        }

        @Override
+1 −0
Original line number Diff line number Diff line
@@ -223,6 +223,7 @@ import java.util.stream.Stream;
            if (overridingSession != null) {
                var builder =
                        new RoutingSessionInfo.Builder(overridingSession.mTranslatedSessionInfo)
                                .setClientPackageName(packageName)
                                .setProviderId(mUniqueId)
                                .setSystemSession(true);
                for (var systemRoute : mLastSystemProviderInfo.getRoutes()) {