Merge "Add updateMethod callback" am: a0974dbc0f am: 7791ac2e28

am: 01712b1aa6

Change-Id: I4b5b26081030f71e90022495e7a5cbb7811e5974
This commit is contained in:
Robert Greenwalt
2017-06-13 21:11:43 +00:00
committed by android-build-merger
3 changed files with 42 additions and 10 deletions

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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
}
}