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

Commit 0f5a5e35 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Merge notifySessionCreationFailed into notifyRequestFailed" into...

Merge "Merge notifySessionCreationFailed into notifyRequestFailed" into rvc-dev am: 531bb231 am: 54278a47

Change-Id: I991e3de3a025e0203658bc077be0774a3b60c427
parents 1b0bda0c 54278a47
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -26909,7 +26909,6 @@ package android.media {
    method public final void notifyRequestFailed(long, int);
    method public final void notifyRoutes(@NonNull java.util.Collection<android.media.MediaRoute2Info>);
    method public final void notifySessionCreated(@NonNull android.media.RoutingSessionInfo, long);
    method public final void notifySessionCreationFailed(long);
    method public final void notifySessionReleased(@NonNull String);
    method public final void notifySessionUpdated(@NonNull android.media.RoutingSessionInfo);
    method @CallSuper @Nullable public android.os.IBinder onBind(@NonNull android.content.Intent);
+0 −1
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ oneway interface IMediaRoute2ProviderServiceCallback {
    // TODO: Change it to updateRoutes?
    void updateState(in MediaRoute2ProviderInfo providerInfo);
    void notifySessionCreated(in RoutingSessionInfo sessionInfo, long requestId);
    void notifySessionCreationFailed(long requestId);
    void notifySessionUpdated(in RoutingSessionInfo sessionInfo);
    void notifySessionReleased(in RoutingSessionInfo sessionInfo);
    void notifyRequestFailed(long requestId, int reason);
+2 −19
Original line number Diff line number Diff line
@@ -233,6 +233,7 @@ public abstract class MediaRoute2ProviderService extends Service {
        String sessionId = sessionInfo.getId();
        synchronized (mSessionLock) {
            if (mSessionInfo.containsKey(sessionId)) {
                // TODO: Notify failure to the requester, and throw exception if needed.
                Log.w(TAG, "Ignoring duplicate session id.");
                return;
            }
@@ -252,24 +253,6 @@ public abstract class MediaRoute2ProviderService extends Service {
        }
    }

    /**
     * Notifies clients of that the session could not be created.
     *
     * @param requestId id of the previous request to create the session provided in
     *                  {@link #onCreateSession(long, String, String, Bundle)}.
     * @see #onCreateSession(long, String, String, Bundle)
     */
    public final void notifySessionCreationFailed(long requestId) {
        if (mRemoteCallback == null) {
            return;
        }
        try {
            mRemoteCallback.notifySessionCreationFailed(requestId);
        } catch (RemoteException ex) {
            Log.w(TAG, "Failed to notify session creation failed.");
        }
    }

    /**
     * Notifies the existing session is updated. For example, when
     * {@link RoutingSessionInfo#getSelectedRoutes() selected routes} are changed.
@@ -364,7 +347,7 @@ public abstract class MediaRoute2ProviderService extends Service {
     * {@link Bundle} which contains how to control the session.
     * <p>
     * If you can't create the session or want to reject the request, call
     * {@link #notifySessionCreationFailed(long)} with the given {@code requestId}.
     * {@link #notifyRequestFailed(long, int)} with the given {@code requestId}.
     *
     * @param requestId the id of this request
     * @param packageName the package name of the application that selected the route
+1 −2
Original line number Diff line number Diff line
@@ -216,8 +216,7 @@ public class SampleMediaRoute2ProviderService extends MediaRoute2ProviderService
            @Nullable Bundle sessionHints) {
        MediaRoute2Info route = mRoutes.get(routeId);
        if (route == null || TextUtils.equals(ROUTE_ID3_SESSION_CREATION_FAILED, routeId)) {
            // Tell the router that session cannot be created by passing null as sessionInfo.
            notifySessionCreationFailed(requestId);
            notifyRequestFailed(requestId, REASON_UNKNOWN_ERROR);
            return;
        }
        maybeDeselectRoute(routeId);
+0 −1
Original line number Diff line number Diff line
@@ -111,7 +111,6 @@ abstract class MediaRoute2Provider {
        void onProviderStateChanged(@Nullable MediaRoute2Provider provider);
        void onSessionCreated(@NonNull MediaRoute2Provider provider,
                @Nullable RoutingSessionInfo sessionInfo, long requestId);
        void onSessionCreationFailed(@NonNull MediaRoute2Provider provider, long requestId);
        void onSessionUpdated(@NonNull MediaRoute2Provider provider,
                @NonNull RoutingSessionInfo sessionInfo);
        void onSessionReleased(@NonNull MediaRoute2Provider provider,
Loading