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

Commit 9b7a4fc8 authored by Santiago Seifert's avatar Santiago Seifert
Browse files

Add SystemMediaRoute2Provider2

This is a no-op refactor in preparation for the upcoming logical
changes.

SystemMediaRoute2Provider2 is intended to manage all system routing
including:
- system-provided routes (for example, BT, wired headsets).
- app-provided routes (for example, Cast mirroring).

Bug: b/362507305
Test: atest CtsMediaBetterTogetherTestCases CtsMediaHostTestCasts
Flag: com.android.media.flags.enable_mirroring_in_media_router_2
Change-Id: I184cbe5d612736fec0d925cad6b12c76e6f4f686
parent a1b451e3
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -2544,7 +2544,10 @@ class MediaRouter2ServiceImpl {
            mServiceRef = new WeakReference<>(service);
            mUserRecord = userRecord;
            mSystemProvider =
                    new SystemMediaRoute2Provider(
                    Flags.enableMirroringInMediaRouter2()
                            ? new SystemMediaRoute2Provider2(
                                    service.mContext, UserHandle.of(userRecord.mUserId), looper)
                            : new SystemMediaRoute2Provider(
                                    service.mContext, UserHandle.of(userRecord.mUserId), looper);
            mRouteProviders.add(mSystemProvider);
            mWatcher = new MediaRoute2ProviderWatcher(service.mContext, this,
+34 −0
Original line number Diff line number Diff line
/*
 * Copyright 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.server.media;

import android.content.Context;
import android.media.MediaRoute2ProviderService;
import android.os.Looper;
import android.os.UserHandle;

/**
 * Extends {@link SystemMediaRoute2Provider} by adding system routes provided by {@link
 * MediaRoute2ProviderService provider services}.
 *
 * <p>System routes are those which can handle the system audio and/or video.
 */
/* package */ class SystemMediaRoute2Provider2 extends SystemMediaRoute2Provider {
    SystemMediaRoute2Provider2(Context context, UserHandle user, Looper looper) {
        super(context, user, looper);
    }
}