Merge "Merge "Merge "Add a reason arg to streamStateUpdated" am: 6ba3829074" into stage-aosp-master am: 4c3be35123" into oc-dev-plus-aosp

This commit is contained in:
Android Build Merger (Role)
2017-07-06 18:38:02 +00:00
committed by Android (Google) Code Review
5 changed files with 35 additions and 5 deletions

View File

@@ -142,7 +142,8 @@ public class MbmsStreamingManager {
* 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}

View File

@@ -21,7 +21,7 @@ package android.telephony.mbms;
*/
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);

View File

@@ -16,12 +16,16 @@
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
*/
@@ -30,11 +34,30 @@ public class StreamingService {
/**
* 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}

View File

@@ -31,6 +31,7 @@ public class StreamingServiceCallback extends IStreamingServiceCallback.Stub {
*/
public static final int SIGNAL_STRENGTH_UNAVAILABLE = -1;
@Override
public void error(int errorCode, String message) {
// default implementation empty
}
@@ -41,7 +42,9 @@ public class StreamingServiceCallback extends IStreamingServiceCallback.Stub {
* 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
}
@@ -55,6 +58,7 @@ public class StreamingServiceCallback extends IStreamingServiceCallback.Stub {
* 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
}
@@ -69,6 +73,7 @@ public class StreamingServiceCallback extends IStreamingServiceCallback.Stub {
* {@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
}
@@ -89,6 +94,7 @@ public class StreamingServiceCallback extends IStreamingServiceCallback.Stub {
* See {@link StreamingService#BROADCAST_METHOD} and
* {@link StreamingService#UNICAST_METHOD}
*/
@Override
public void streamMethodUpdated(int methodType) {
// default implementation empty
}

View File

@@ -72,7 +72,7 @@ public class MbmsStreamingServiceBase extends IMbmsStreamingService.Stub {
/**
* 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}
*
@@ -107,7 +107,7 @@ public class MbmsStreamingServiceBase extends IMbmsStreamingService.Stub {
/**
* 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}
*