Merge "Add updateMethod callback"

This commit is contained in:
Robert Greenwalt
2017-06-13 20:38:49 +00:00
committed by Gerrit Code Review
3 changed files with 42 additions and 10 deletions

View File

@@ -16,14 +16,13 @@
package android.telephony.mbms; package android.telephony.mbms;
import android.net.Uri;
/** /**
* @hide * @hide
*/ */
oneway interface IStreamingServiceCallback { oneway interface IStreamingServiceCallback {
void error(int errorCode, String message); void error(int errorCode, String message);
void streamStateChanged(int state); void streamStateUpdated(int state);
void uriUpdated(in Uri uri); void mediaDescriptionUpdated();
void broadcastSignalStrengthUpdated(int signalStrength); void broadcastSignalStrengthUpdated(int signalStrength);
void streamMethodUpdated(int methodType);
} }

View File

@@ -27,10 +27,21 @@ import android.util.Log;
*/ */
public class StreamingService { public class StreamingService {
private static final String LOG_TAG = "MbmsStreamingService"; 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_STOPPED = 1;
public final static int STATE_STARTED = 2; public final static int STATE_STARTED = 2;
public final static int STATE_STALLED = 3; 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 String mAppName;
private final int mSubscriptionId; private final int mSubscriptionId;
private final StreamingServiceInfo mServiceInfo; private final StreamingServiceInfo mServiceInfo;

View File

@@ -16,8 +16,6 @@
package android.telephony.mbms; package android.telephony.mbms;
import android.net.Uri;
/** /**
* A Callback class for use when the application is actively streaming content. * A Callback class for use when the application is actively streaming content.
* @hide * @hide
@@ -43,17 +41,21 @@ public class StreamingServiceCallback extends IStreamingServiceCallback.Stub {
* See {@link StreamingService#STATE_STOPPED}, {@link StreamingService#STATE_STARTED} * See {@link StreamingService#STATE_STOPPED}, {@link StreamingService#STATE_STARTED}
* and {@link StreamingService#STATE_STALLED}. * and {@link StreamingService#STATE_STALLED}.
*/ */
public void streamStateChanged(int state) { public void streamStateUpdated(int state) {
// default implementation empty // 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 * 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 // default implementation empty
} }
@@ -70,4 +72,24 @@ public class StreamingServiceCallback extends IStreamingServiceCallback.Stub {
public void broadcastSignalStrengthUpdated(int signalStrength) { public void broadcastSignalStrengthUpdated(int signalStrength) {
// default implementation empty // 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
}
} }