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

Commit 1be387b3 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "MediaRouter: Notify DiscoveryPreference after binding" into rvc-dev am:...

Merge "MediaRouter: Notify DiscoveryPreference after binding" into rvc-dev am: 6b457ad6 am: a429382e

Change-Id: Ibf9d2f8a21eb697e6664a4bc6e4969645f310605
parents 1144fd41 a429382e
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -60,6 +60,8 @@ final class MediaRoute2ProviderServiceProxy extends MediaRoute2Provider
    private Connection mActiveConnection;
    private Connection mActiveConnection;
    private boolean mConnectionReady;
    private boolean mConnectionReady;


    private RouteDiscoveryPreference mPendingDiscoveryPreference = null;

    MediaRoute2ProviderServiceProxy(@NonNull Context context, @NonNull ComponentName componentName,
    MediaRoute2ProviderServiceProxy(@NonNull Context context, @NonNull ComponentName componentName,
            int userId) {
            int userId) {
        super(componentName);
        super(componentName);
@@ -99,6 +101,8 @@ final class MediaRoute2ProviderServiceProxy extends MediaRoute2Provider
        if (mConnectionReady) {
        if (mConnectionReady) {
            mActiveConnection.updateDiscoveryPreference(discoveryPreference);
            mActiveConnection.updateDiscoveryPreference(discoveryPreference);
            updateBinding();
            updateBinding();
        } else {
            mPendingDiscoveryPreference = discoveryPreference;
        }
        }
    }
    }


@@ -271,6 +275,10 @@ final class MediaRoute2ProviderServiceProxy extends MediaRoute2Provider
    private void onConnectionReady(Connection connection) {
    private void onConnectionReady(Connection connection) {
        if (mActiveConnection == connection) {
        if (mActiveConnection == connection) {
            mConnectionReady = true;
            mConnectionReady = true;
            if (mPendingDiscoveryPreference != null) {
                updateDiscoveryPreference(mPendingDiscoveryPreference);
                mPendingDiscoveryPreference = null;
            }
        }
        }
    }
    }