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

Commit 3d989119 authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

Add updateMethod callback

Allows middleware to let us know if we're getting streaming
content via bcast or unicast.

Test: test-app
Change-Id: Iab63d62a2132fdd71acc81de4ca68fc347ecb4af
parent 142a392b
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -16,14 +16,13 @@

package android.telephony.mbms;

import android.net.Uri;

/**
 * @hide
 */
oneway interface IStreamingServiceCallback {
    void error(int errorCode, String message);
    void streamStateChanged(int state);
    void uriUpdated(in Uri uri);
    void streamStateUpdated(int state);
    void mediaDescriptionUpdated();
    void broadcastSignalStrengthUpdated(int signalStrength);
    void streamMethodUpdated(int methodType);
}
+11 −0
Original line number Diff line number Diff line
@@ -27,10 +27,21 @@ import android.util.Log;
 */
public class StreamingService {
    private static final String LOG_TAG = "MbmsStreamingService";

    /**
     * The state of a stream, reported via {@link StreamingServiceCallback#streamStateUpdated}
     */
    public final static int STATE_STOPPED = 1;
    public final static int STATE_STARTED = 2;
    public final static int STATE_STALLED = 3;

    /**
     * The method of transmission currently used for a stream,
     * reported via {@link StreamingServiceCallback#streamMethodUpdated}
     */
    public final static int BROADCAST_METHOD = 1;
    public final static int UNICAST_METHOD   = 2;

    private final String mAppName;
    private final int mSubscriptionId;
    private final StreamingServiceInfo mServiceInfo;
+28 −6
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package android.telephony.mbms;

import android.net.Uri;

/**
 * A Callback class for use when the application is actively streaming content.
 * @hide
@@ -43,17 +41,21 @@ public class StreamingServiceCallback extends IStreamingServiceCallback.Stub {
     * See {@link StreamingService#STATE_STOPPED}, {@link StreamingService#STATE_STARTED}
     * and {@link StreamingService#STATE_STALLED}.
     */
    public void streamStateChanged(int state) {
    public void streamStateUpdated(int state) {
        // default implementation empty
    }

    /**
     * Called to indicate published Download Services have changed.
     * Called to indicate the mpd of a the stream has changed.
     *
     * Depending on the Dash Client it may need to be either reset
     * (less drastic, but original spec didn't allow mpd to change so not
     * always supported) or restarted.
     *
     * This may be called when a looping stream hits the end or
     * when the a new URI should be used to correct for time drift.
     * when parameters have changed to account for time drift.
     */
    public void uriUpdated(Uri uri) {
    public void mediaDescriptionUpdated() {
        // default implementation empty
    }

@@ -70,4 +72,24 @@ public class StreamingServiceCallback extends IStreamingServiceCallback.Stub {
    public void broadcastSignalStrengthUpdated(int signalStrength) {
        // default implementation empty
    }

    /**
     * Notify of bcast/unicast method being used.
     *
     * This is intended to be informational.  Indicates
     * whether we're able to use cell broadcast or have
     * had to fallback to unicast for this stream.
     *
     * This must be called once at the beginning of the stream
     * around the same time as we change to STATE_STARTED, but
     * strict ordering is not specified.  It must be called
     * again if we change modes, but if that doesn't happen
     * the callback won't be used again.
     *
     * See {@link StreamingService#BROADCAST_METHOD} and
     * {@link StreamingService#UNICAST_METHOD}
     */
    public void streamMethodUpdated(int methodType) {
        // default implementation empty
    }
}