* Starts streaming a requested service, reporting status to the indicated listener.
* Returns an object used to control that stream. The stream may not be ready for consumption
* immediately upon return from this method -- wait until the streaming state has been
- * reported via {@link android.telephony.mbms.StreamingServiceCallback#streamStateUpdated(int)}
+ * reported via
+ * {@link android.telephony.mbms.StreamingServiceCallback#streamStateUpdated(int, int)}
*
* May throw an {@link MbmsException} containing any of the following error codes:
* {@link MbmsException#ERROR_MIDDLEWARE_NOT_BOUND}
*/
oneway interface IStreamingServiceCallback {
void error(int errorCode, String message);
- void streamStateUpdated(int state);
+ void streamStateUpdated(int state, int reason);
void mediaDescriptionUpdated();
void broadcastSignalStrengthUpdated(int signalStrength);
void streamMethodUpdated(int methodType);
package android.telephony.mbms;
+import android.annotation.IntDef;
import android.net.Uri;
import android.os.DeadObjectException;
import android.os.RemoteException;
import android.telephony.mbms.vendor.IMbmsStreamingService;
import android.util.Log;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
/**
* @hide
*/
/**
* The state of a stream, reported via {@link StreamingServiceCallback#streamStateUpdated}
+ * @hide
*/
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef({STATE_STOPPED, STATE_STARTED, STATE_STALLED})
+ public @interface StreamingState {}
public final static int STATE_STOPPED = 1;
public final static int STATE_STARTED = 2;
public final static int STATE_STALLED = 3;
/**
+ * The reason for a stream state change, reported via
+ * {@link StreamingServiceCallback#streamStateUpdated}
+ * @hide
+ */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef({REASON_BY_USER_REQUEST, REASON_END_OF_SESSION, REASON_FREQUENCY_CONFLICT,
+ REASON_OUT_OF_MEMORY, REASON_NOT_CONNECTED_TO_HOMECARRIER_LTE})
+ public @interface StreamingStateChangeReason {}
+ public static final int REASON_BY_USER_REQUEST = 1;
+ public static final int REASON_END_OF_SESSION = 2;
+ public static final int REASON_FREQUENCY_CONFLICT = 3;
+ public static final int REASON_OUT_OF_MEMORY = 4;
+ public static final int REASON_NOT_CONNECTED_TO_HOMECARRIER_LTE = 5;
+
+ /**
* The method of transmission currently used for a stream,
* reported via {@link StreamingServiceCallback#streamMethodUpdated}
*/
*/
public static final int SIGNAL_STRENGTH_UNAVAILABLE = -1;
+ @Override
public void error(int errorCode, String message) {
// default implementation empty
}
* See {@link StreamingService#STATE_STOPPED}, {@link StreamingService#STATE_STARTED}
* and {@link StreamingService#STATE_STALLED}.
*/
- public void streamStateUpdated(int state) {
+ @Override
+ public void streamStateUpdated(@StreamingService.StreamingState int state,
+ @StreamingService.StreamingStateChangeReason int reason) {
// default implementation empty
}
* This may be called when a looping stream hits the end or
* when parameters have changed to account for time drift.
*/
+ @Override
public void mediaDescriptionUpdated() {
// default implementation empty
}
* {@link #SIGNAL_STRENGTH_UNAVAILABLE} if broadcast is not available
* for this service due to timing, geography or popularity.
*/
+ @Override
public void broadcastSignalStrengthUpdated(int signalStrength) {
// default implementation empty
}
* See {@link StreamingService#BROADCAST_METHOD} and
* {@link StreamingService#UNICAST_METHOD}
*/
+ @Override
public void streamMethodUpdated(int methodType) {
// default implementation empty
}
/**
* Starts streaming on a particular service. This method may perform asynchronous work. When
* the middleware is ready to send bits to the frontend, it should inform the app via
- * {@link IStreamingServiceCallback#streamStateUpdated(int)}.
+ * {@link IStreamingServiceCallback#streamStateUpdated(int, int)}.
*
* May throw an {@link IllegalArgumentException} or an {@link IllegalStateException}
*
/**
* Stop streaming the stream identified by {@code serviceId}. Notification of the resulting
* stream state change should be reported to the app via
- * {@link IStreamingServiceCallback#streamStateUpdated(int)}.
+ * {@link IStreamingServiceCallback#streamStateUpdated(int, int)}.
*
* May throw an {@link IllegalArgumentException} or an {@link IllegalStateException}
*