Merge "Revert "Fix lint errors in the streaming API""
This commit is contained in:
@@ -37851,12 +37851,11 @@ package android.telephony {
|
||||
}
|
||||
|
||||
public class MbmsStreamingManager {
|
||||
method public static android.telephony.MbmsStreamingManager create(android.content.Context, android.telephony.mbms.MbmsStreamingManagerCallback, int, android.os.Handler) throws android.telephony.mbms.MbmsException;
|
||||
method public static android.telephony.MbmsStreamingManager create(android.content.Context, android.telephony.mbms.MbmsStreamingManagerCallback, android.os.Handler) throws android.telephony.mbms.MbmsException;
|
||||
method public static android.telephony.MbmsStreamingManager create(android.content.Context, android.telephony.mbms.MbmsStreamingManagerCallback, int) throws android.telephony.mbms.MbmsException;
|
||||
method public static android.telephony.MbmsStreamingManager create(android.content.Context, android.telephony.mbms.MbmsStreamingManagerCallback) throws android.telephony.mbms.MbmsException;
|
||||
method public void dispose();
|
||||
method public void getStreamingServices(java.util.List<java.lang.String>) throws android.telephony.mbms.MbmsException;
|
||||
method public android.telephony.mbms.StreamingService startStreaming(android.telephony.mbms.StreamingServiceInfo, android.telephony.mbms.StreamingServiceCallback, android.os.Handler) throws android.telephony.mbms.MbmsException;
|
||||
method public android.telephony.mbms.StreamingService startStreaming(android.telephony.mbms.StreamingServiceInfo, android.telephony.mbms.StreamingServiceCallback) throws android.telephony.mbms.MbmsException;
|
||||
}
|
||||
|
||||
public class NeighboringCellInfo implements android.os.Parcelable {
|
||||
@@ -38482,6 +38481,7 @@ package android.telephony.mbms {
|
||||
}
|
||||
|
||||
public static class MbmsException.GeneralErrors {
|
||||
ctor public MbmsException.GeneralErrors();
|
||||
field public static final int ERROR_CARRIER_CHANGE_NOT_ALLOWED = 207; // 0xcf
|
||||
field public static final int ERROR_IN_E911 = 204; // 0xcc
|
||||
field public static final int ERROR_MIDDLEWARE_NOT_YET_READY = 201; // 0xc9
|
||||
@@ -38492,31 +38492,36 @@ package android.telephony.mbms {
|
||||
}
|
||||
|
||||
public static class MbmsException.InitializationErrors {
|
||||
ctor public MbmsException.InitializationErrors();
|
||||
field public static final int ERROR_APP_PERMISSIONS_NOT_GRANTED = 102; // 0x66
|
||||
field public static final int ERROR_DUPLICATE_INITIALIZE = 101; // 0x65
|
||||
field public static final int ERROR_UNABLE_TO_INITIALIZE = 103; // 0x67
|
||||
}
|
||||
|
||||
public static class MbmsException.StreamingErrors {
|
||||
ctor public MbmsException.StreamingErrors();
|
||||
field public static final int ERROR_CONCURRENT_SERVICE_LIMIT_REACHED = 301; // 0x12d
|
||||
field public static final int ERROR_DUPLICATE_START_STREAM = 303; // 0x12f
|
||||
field public static final int ERROR_UNABLE_TO_START_SERVICE = 302; // 0x12e
|
||||
}
|
||||
|
||||
public class MbmsStreamingManagerCallback {
|
||||
public class MbmsStreamingManagerCallback extends android.os.Binder {
|
||||
ctor public MbmsStreamingManagerCallback();
|
||||
method public void onError(int, java.lang.String);
|
||||
method public void onMiddlewareReady();
|
||||
method public void onStreamingServicesUpdated(java.util.List<android.telephony.mbms.StreamingServiceInfo>);
|
||||
method public void error(int, java.lang.String) throws android.os.RemoteException;
|
||||
method public void middlewareReady() throws android.os.RemoteException;
|
||||
method public void streamingServicesUpdated(java.util.List<android.telephony.mbms.StreamingServiceInfo>) throws android.os.RemoteException;
|
||||
}
|
||||
|
||||
public class ServiceInfo {
|
||||
public class ServiceInfo implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method public java.lang.String getClassName();
|
||||
method public java.util.List<java.util.Locale> getLocales();
|
||||
method public java.util.Map<java.util.Locale, java.lang.String> getNames();
|
||||
method public java.lang.String getServiceId();
|
||||
method public java.util.Date getSessionEndTime();
|
||||
method public java.util.Date getSessionStartTime();
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
field public static final android.os.Parcelable.Creator<android.telephony.mbms.ServiceInfo> CREATOR;
|
||||
}
|
||||
|
||||
public class StreamingService {
|
||||
@@ -38538,19 +38543,17 @@ package android.telephony.mbms {
|
||||
field public static final int UNICAST_METHOD = 2; // 0x2
|
||||
}
|
||||
|
||||
public class StreamingServiceCallback {
|
||||
public class StreamingServiceCallback extends android.os.Binder {
|
||||
ctor public StreamingServiceCallback();
|
||||
method public void onBroadcastSignalStrengthUpdated(int);
|
||||
method public void onError(int, java.lang.String);
|
||||
method public void onMediaDescriptionUpdated();
|
||||
method public void onStreamMethodUpdated(int);
|
||||
method public void onStreamStateUpdated(int, int);
|
||||
method public void broadcastSignalStrengthUpdated(int) throws android.os.RemoteException;
|
||||
method public void error(int, java.lang.String) throws android.os.RemoteException;
|
||||
method public void mediaDescriptionUpdated() throws android.os.RemoteException;
|
||||
method public void streamMethodUpdated(int) throws android.os.RemoteException;
|
||||
method public void streamStateUpdated(int, int) throws android.os.RemoteException;
|
||||
field public static final int SIGNAL_STRENGTH_UNAVAILABLE = -1; // 0xffffffff
|
||||
}
|
||||
|
||||
public final class StreamingServiceInfo extends android.telephony.mbms.ServiceInfo implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
public class StreamingServiceInfo extends android.telephony.mbms.ServiceInfo implements android.os.Parcelable {
|
||||
field public static final android.os.Parcelable.Creator<android.telephony.mbms.StreamingServiceInfo> CREATOR;
|
||||
}
|
||||
|
||||
|
||||
@@ -41022,12 +41022,11 @@ package android.telephony {
|
||||
}
|
||||
|
||||
public class MbmsStreamingManager {
|
||||
method public static android.telephony.MbmsStreamingManager create(android.content.Context, android.telephony.mbms.MbmsStreamingManagerCallback, int, android.os.Handler) throws android.telephony.mbms.MbmsException;
|
||||
method public static android.telephony.MbmsStreamingManager create(android.content.Context, android.telephony.mbms.MbmsStreamingManagerCallback, android.os.Handler) throws android.telephony.mbms.MbmsException;
|
||||
method public static android.telephony.MbmsStreamingManager create(android.content.Context, android.telephony.mbms.MbmsStreamingManagerCallback, int) throws android.telephony.mbms.MbmsException;
|
||||
method public static android.telephony.MbmsStreamingManager create(android.content.Context, android.telephony.mbms.MbmsStreamingManagerCallback) throws android.telephony.mbms.MbmsException;
|
||||
method public void dispose();
|
||||
method public void getStreamingServices(java.util.List<java.lang.String>) throws android.telephony.mbms.MbmsException;
|
||||
method public android.telephony.mbms.StreamingService startStreaming(android.telephony.mbms.StreamingServiceInfo, android.telephony.mbms.StreamingServiceCallback, android.os.Handler) throws android.telephony.mbms.MbmsException;
|
||||
method public android.telephony.mbms.StreamingService startStreaming(android.telephony.mbms.StreamingServiceInfo, android.telephony.mbms.StreamingServiceCallback) throws android.telephony.mbms.MbmsException;
|
||||
field public static final java.lang.String MBMS_STREAMING_SERVICE_ACTION = "android.telephony.action.EmbmsStreaming";
|
||||
}
|
||||
|
||||
@@ -41737,6 +41736,7 @@ package android.telephony.mbms {
|
||||
}
|
||||
|
||||
public static class MbmsException.GeneralErrors {
|
||||
ctor public MbmsException.GeneralErrors();
|
||||
field public static final int ERROR_CARRIER_CHANGE_NOT_ALLOWED = 207; // 0xcf
|
||||
field public static final int ERROR_IN_E911 = 204; // 0xcc
|
||||
field public static final int ERROR_MIDDLEWARE_NOT_YET_READY = 201; // 0xc9
|
||||
@@ -41747,31 +41747,36 @@ package android.telephony.mbms {
|
||||
}
|
||||
|
||||
public static class MbmsException.InitializationErrors {
|
||||
ctor public MbmsException.InitializationErrors();
|
||||
field public static final int ERROR_APP_PERMISSIONS_NOT_GRANTED = 102; // 0x66
|
||||
field public static final int ERROR_DUPLICATE_INITIALIZE = 101; // 0x65
|
||||
field public static final int ERROR_UNABLE_TO_INITIALIZE = 103; // 0x67
|
||||
}
|
||||
|
||||
public static class MbmsException.StreamingErrors {
|
||||
ctor public MbmsException.StreamingErrors();
|
||||
field public static final int ERROR_CONCURRENT_SERVICE_LIMIT_REACHED = 301; // 0x12d
|
||||
field public static final int ERROR_DUPLICATE_START_STREAM = 303; // 0x12f
|
||||
field public static final int ERROR_UNABLE_TO_START_SERVICE = 302; // 0x12e
|
||||
}
|
||||
|
||||
public class MbmsStreamingManagerCallback {
|
||||
public class MbmsStreamingManagerCallback extends android.os.Binder {
|
||||
ctor public MbmsStreamingManagerCallback();
|
||||
method public void onError(int, java.lang.String);
|
||||
method public void onMiddlewareReady();
|
||||
method public void onStreamingServicesUpdated(java.util.List<android.telephony.mbms.StreamingServiceInfo>);
|
||||
method public void error(int, java.lang.String) throws android.os.RemoteException;
|
||||
method public void middlewareReady() throws android.os.RemoteException;
|
||||
method public void streamingServicesUpdated(java.util.List<android.telephony.mbms.StreamingServiceInfo>) throws android.os.RemoteException;
|
||||
}
|
||||
|
||||
public class ServiceInfo {
|
||||
public class ServiceInfo implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method public java.lang.String getClassName();
|
||||
method public java.util.List<java.util.Locale> getLocales();
|
||||
method public java.util.Map<java.util.Locale, java.lang.String> getNames();
|
||||
method public java.lang.String getServiceId();
|
||||
method public java.util.Date getSessionEndTime();
|
||||
method public java.util.Date getSessionStartTime();
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
field public static final android.os.Parcelable.Creator<android.telephony.mbms.ServiceInfo> CREATOR;
|
||||
}
|
||||
|
||||
public class StreamingService {
|
||||
@@ -41793,20 +41798,18 @@ package android.telephony.mbms {
|
||||
field public static final int UNICAST_METHOD = 2; // 0x2
|
||||
}
|
||||
|
||||
public class StreamingServiceCallback {
|
||||
public class StreamingServiceCallback extends android.os.Binder {
|
||||
ctor public StreamingServiceCallback();
|
||||
method public void onBroadcastSignalStrengthUpdated(int);
|
||||
method public void onError(int, java.lang.String);
|
||||
method public void onMediaDescriptionUpdated();
|
||||
method public void onStreamMethodUpdated(int);
|
||||
method public void onStreamStateUpdated(int, int);
|
||||
method public void broadcastSignalStrengthUpdated(int) throws android.os.RemoteException;
|
||||
method public void error(int, java.lang.String) throws android.os.RemoteException;
|
||||
method public void mediaDescriptionUpdated() throws android.os.RemoteException;
|
||||
method public void streamMethodUpdated(int) throws android.os.RemoteException;
|
||||
method public void streamStateUpdated(int, int) throws android.os.RemoteException;
|
||||
field public static final int SIGNAL_STRENGTH_UNAVAILABLE = -1; // 0xffffffff
|
||||
}
|
||||
|
||||
public final class StreamingServiceInfo extends android.telephony.mbms.ServiceInfo implements android.os.Parcelable {
|
||||
public class StreamingServiceInfo extends android.telephony.mbms.ServiceInfo implements android.os.Parcelable {
|
||||
ctor public StreamingServiceInfo(java.util.Map<java.util.Locale, java.lang.String>, java.lang.String, java.util.List<java.util.Locale>, java.lang.String, java.util.Date, java.util.Date);
|
||||
method public int describeContents();
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
field public static final android.os.Parcelable.Creator<android.telephony.mbms.StreamingServiceInfo> CREATOR;
|
||||
}
|
||||
|
||||
@@ -41821,7 +41824,6 @@ package android.telephony.mbms.vendor {
|
||||
method public android.net.Uri getPlaybackUri(int, java.lang.String) throws android.os.RemoteException;
|
||||
method public int getStreamingServices(int, java.util.List<java.lang.String>) throws android.os.RemoteException;
|
||||
method public int initialize(android.telephony.mbms.MbmsStreamingManagerCallback, int) throws android.os.RemoteException;
|
||||
method public void onAppCallbackDied(int, int);
|
||||
method public int startStreaming(int, java.lang.String, android.telephony.mbms.StreamingServiceCallback) throws android.os.RemoteException;
|
||||
method public void stopStreaming(int, java.lang.String) throws android.os.RemoteException;
|
||||
}
|
||||
|
||||
@@ -37950,12 +37950,11 @@ package android.telephony {
|
||||
}
|
||||
|
||||
public class MbmsStreamingManager {
|
||||
method public static android.telephony.MbmsStreamingManager create(android.content.Context, android.telephony.mbms.MbmsStreamingManagerCallback, int, android.os.Handler) throws android.telephony.mbms.MbmsException;
|
||||
method public static android.telephony.MbmsStreamingManager create(android.content.Context, android.telephony.mbms.MbmsStreamingManagerCallback, android.os.Handler) throws android.telephony.mbms.MbmsException;
|
||||
method public static android.telephony.MbmsStreamingManager create(android.content.Context, android.telephony.mbms.MbmsStreamingManagerCallback, int) throws android.telephony.mbms.MbmsException;
|
||||
method public static android.telephony.MbmsStreamingManager create(android.content.Context, android.telephony.mbms.MbmsStreamingManagerCallback) throws android.telephony.mbms.MbmsException;
|
||||
method public void dispose();
|
||||
method public void getStreamingServices(java.util.List<java.lang.String>) throws android.telephony.mbms.MbmsException;
|
||||
method public android.telephony.mbms.StreamingService startStreaming(android.telephony.mbms.StreamingServiceInfo, android.telephony.mbms.StreamingServiceCallback, android.os.Handler) throws android.telephony.mbms.MbmsException;
|
||||
method public android.telephony.mbms.StreamingService startStreaming(android.telephony.mbms.StreamingServiceInfo, android.telephony.mbms.StreamingServiceCallback) throws android.telephony.mbms.MbmsException;
|
||||
}
|
||||
|
||||
public class NeighboringCellInfo implements android.os.Parcelable {
|
||||
@@ -38581,6 +38580,7 @@ package android.telephony.mbms {
|
||||
}
|
||||
|
||||
public static class MbmsException.GeneralErrors {
|
||||
ctor public MbmsException.GeneralErrors();
|
||||
field public static final int ERROR_CARRIER_CHANGE_NOT_ALLOWED = 207; // 0xcf
|
||||
field public static final int ERROR_IN_E911 = 204; // 0xcc
|
||||
field public static final int ERROR_MIDDLEWARE_NOT_YET_READY = 201; // 0xc9
|
||||
@@ -38591,31 +38591,36 @@ package android.telephony.mbms {
|
||||
}
|
||||
|
||||
public static class MbmsException.InitializationErrors {
|
||||
ctor public MbmsException.InitializationErrors();
|
||||
field public static final int ERROR_APP_PERMISSIONS_NOT_GRANTED = 102; // 0x66
|
||||
field public static final int ERROR_DUPLICATE_INITIALIZE = 101; // 0x65
|
||||
field public static final int ERROR_UNABLE_TO_INITIALIZE = 103; // 0x67
|
||||
}
|
||||
|
||||
public static class MbmsException.StreamingErrors {
|
||||
ctor public MbmsException.StreamingErrors();
|
||||
field public static final int ERROR_CONCURRENT_SERVICE_LIMIT_REACHED = 301; // 0x12d
|
||||
field public static final int ERROR_DUPLICATE_START_STREAM = 303; // 0x12f
|
||||
field public static final int ERROR_UNABLE_TO_START_SERVICE = 302; // 0x12e
|
||||
}
|
||||
|
||||
public class MbmsStreamingManagerCallback {
|
||||
public class MbmsStreamingManagerCallback extends android.os.Binder {
|
||||
ctor public MbmsStreamingManagerCallback();
|
||||
method public void onError(int, java.lang.String);
|
||||
method public void onMiddlewareReady();
|
||||
method public void onStreamingServicesUpdated(java.util.List<android.telephony.mbms.StreamingServiceInfo>);
|
||||
method public void error(int, java.lang.String) throws android.os.RemoteException;
|
||||
method public void middlewareReady() throws android.os.RemoteException;
|
||||
method public void streamingServicesUpdated(java.util.List<android.telephony.mbms.StreamingServiceInfo>) throws android.os.RemoteException;
|
||||
}
|
||||
|
||||
public class ServiceInfo {
|
||||
public class ServiceInfo implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method public java.lang.String getClassName();
|
||||
method public java.util.List<java.util.Locale> getLocales();
|
||||
method public java.util.Map<java.util.Locale, java.lang.String> getNames();
|
||||
method public java.lang.String getServiceId();
|
||||
method public java.util.Date getSessionEndTime();
|
||||
method public java.util.Date getSessionStartTime();
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
field public static final android.os.Parcelable.Creator<android.telephony.mbms.ServiceInfo> CREATOR;
|
||||
}
|
||||
|
||||
public class StreamingService {
|
||||
@@ -38637,19 +38642,17 @@ package android.telephony.mbms {
|
||||
field public static final int UNICAST_METHOD = 2; // 0x2
|
||||
}
|
||||
|
||||
public class StreamingServiceCallback {
|
||||
public class StreamingServiceCallback extends android.os.Binder {
|
||||
ctor public StreamingServiceCallback();
|
||||
method public void onBroadcastSignalStrengthUpdated(int);
|
||||
method public void onError(int, java.lang.String);
|
||||
method public void onMediaDescriptionUpdated();
|
||||
method public void onStreamMethodUpdated(int);
|
||||
method public void onStreamStateUpdated(int, int);
|
||||
method public void broadcastSignalStrengthUpdated(int) throws android.os.RemoteException;
|
||||
method public void error(int, java.lang.String) throws android.os.RemoteException;
|
||||
method public void mediaDescriptionUpdated() throws android.os.RemoteException;
|
||||
method public void streamMethodUpdated(int) throws android.os.RemoteException;
|
||||
method public void streamStateUpdated(int, int) throws android.os.RemoteException;
|
||||
field public static final int SIGNAL_STRENGTH_UNAVAILABLE = -1; // 0xffffffff
|
||||
}
|
||||
|
||||
public final class StreamingServiceInfo extends android.telephony.mbms.ServiceInfo implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
public class StreamingServiceInfo extends android.telephony.mbms.ServiceInfo implements android.os.Parcelable {
|
||||
field public static final android.os.Parcelable.Creator<android.telephony.mbms.StreamingServiceInfo> CREATOR;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,8 @@ import android.annotation.SystemApi;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Looper;
|
||||
import android.os.RemoteException;
|
||||
import android.telephony.mbms.InternalStreamingManagerCallback;
|
||||
import android.telephony.mbms.InternalStreamingServiceCallback;
|
||||
import android.telephony.mbms.MbmsException;
|
||||
import android.telephony.mbms.MbmsStreamingManagerCallback;
|
||||
import android.telephony.mbms.MbmsUtils;
|
||||
@@ -58,20 +54,17 @@ public class MbmsStreamingManager {
|
||||
"android.telephony.action.EmbmsStreaming";
|
||||
|
||||
private AtomicReference<IMbmsStreamingService> mService = new AtomicReference<>(null);
|
||||
private InternalStreamingManagerCallback mInternalCallback;
|
||||
private MbmsStreamingManagerCallback mCallbackToApp;
|
||||
|
||||
private final Context mContext;
|
||||
private int mSubscriptionId = INVALID_SUBSCRIPTION_ID;
|
||||
|
||||
/** @hide */
|
||||
private MbmsStreamingManager(Context context, MbmsStreamingManagerCallback callback,
|
||||
int subscriptionId, Handler handler) {
|
||||
int subscriptionId) {
|
||||
mContext = context;
|
||||
mCallbackToApp = callback;
|
||||
mSubscriptionId = subscriptionId;
|
||||
if (handler == null) {
|
||||
handler = new Handler(Looper.getMainLooper());
|
||||
}
|
||||
mInternalCallback = new InternalStreamingManagerCallback(callback, handler);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,38 +78,23 @@ public class MbmsStreamingManager {
|
||||
* @param callback A callback object on which you wish to receive results of asynchronous
|
||||
* operations.
|
||||
* @param subscriptionId The subscription ID to use.
|
||||
* @param handler The handler you wish to receive callbacks on. If null, callbacks will be
|
||||
* processed on the main looper (in other words, the looper returned from
|
||||
* {@link Looper#getMainLooper()}).
|
||||
*/
|
||||
public static MbmsStreamingManager create(Context context,
|
||||
MbmsStreamingManagerCallback callback, int subscriptionId, Handler handler)
|
||||
MbmsStreamingManagerCallback callback, int subscriptionId)
|
||||
throws MbmsException {
|
||||
MbmsStreamingManager manager = new MbmsStreamingManager(context, callback,
|
||||
subscriptionId, handler);
|
||||
MbmsStreamingManager manager = new MbmsStreamingManager(context, callback, subscriptionId);
|
||||
manager.bindAndInitialize();
|
||||
return manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new MbmsStreamingManager using the system default data subscription ID.
|
||||
* See {@link #create(Context, MbmsStreamingManagerCallback, int, Handler)}.
|
||||
*/
|
||||
public static MbmsStreamingManager create(Context context,
|
||||
MbmsStreamingManagerCallback callback, Handler handler)
|
||||
throws MbmsException {
|
||||
return create(context, callback, SubscriptionManager.getDefaultSubscriptionId(), handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new MbmsStreamingManager using the system default data subscription ID and
|
||||
* default {@link Handler}.
|
||||
* See {@link #create(Context, MbmsStreamingManagerCallback, int, Handler)}.
|
||||
* See {@link #create(Context, MbmsStreamingManagerCallback, int)}.
|
||||
*/
|
||||
public static MbmsStreamingManager create(Context context,
|
||||
MbmsStreamingManagerCallback callback)
|
||||
throws MbmsException {
|
||||
return create(context, callback, SubscriptionManager.getDefaultSubscriptionId(), null);
|
||||
return create(context, callback, SubscriptionManager.getDefaultSubscriptionId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -175,11 +153,11 @@ public class MbmsStreamingManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts streaming a requested service, reporting status to the indicated callback.
|
||||
* 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#onStreamStateUpdated(int, int)}
|
||||
* {@link android.telephony.mbms.StreamingServiceCallback#streamStateUpdated(int, int)}
|
||||
*
|
||||
* May throw an
|
||||
* {@link MbmsException} containing any of the error codes in
|
||||
@@ -189,33 +167,24 @@ public class MbmsStreamingManager {
|
||||
*
|
||||
* May also throw an {@link IllegalArgumentException} or an {@link IllegalStateException}
|
||||
*
|
||||
* Asynchronous errors through the callback include any of the errors in
|
||||
* Asynchronous errors through the listener include any of the errors in
|
||||
* {@link android.telephony.mbms.MbmsException.GeneralErrors} or
|
||||
* {@link android.telephony.mbms.MbmsException.StreamingErrors}.
|
||||
*
|
||||
* @param serviceInfo The information about the service to stream.
|
||||
* @param callback A callback that'll be called when something about the stream changes.
|
||||
* @param handler A handler that calls to {@code callback} should be called on. If null,
|
||||
* defaults to the handler provided via
|
||||
* {@link #create(Context, MbmsStreamingManagerCallback, int, Handler)}.
|
||||
* @param listener A listener that'll be called when something about the stream changes.
|
||||
* @return An instance of {@link StreamingService} through which the stream can be controlled.
|
||||
*/
|
||||
public StreamingService startStreaming(StreamingServiceInfo serviceInfo,
|
||||
StreamingServiceCallback callback, Handler handler) throws MbmsException {
|
||||
StreamingServiceCallback listener) throws MbmsException {
|
||||
IMbmsStreamingService streamingService = mService.get();
|
||||
if (streamingService == null) {
|
||||
throw new MbmsException(MbmsException.ERROR_MIDDLEWARE_NOT_BOUND);
|
||||
}
|
||||
|
||||
InternalStreamingServiceCallback serviceCallback = new InternalStreamingServiceCallback(
|
||||
callback, handler == null ? mInternalCallback.getHandler() : handler);
|
||||
|
||||
StreamingService serviceForApp = new StreamingService(
|
||||
mSubscriptionId, streamingService, serviceInfo, serviceCallback);
|
||||
|
||||
try {
|
||||
int returnCode = streamingService.startStreaming(
|
||||
mSubscriptionId, serviceInfo.getServiceId(), serviceCallback);
|
||||
mSubscriptionId, serviceInfo.getServiceId(), listener);
|
||||
if (returnCode != MbmsException.SUCCESS) {
|
||||
throw new MbmsException(returnCode);
|
||||
}
|
||||
@@ -225,7 +194,7 @@ public class MbmsStreamingManager {
|
||||
throw new MbmsException(MbmsException.ERROR_MIDDLEWARE_LOST);
|
||||
}
|
||||
|
||||
return serviceForApp;
|
||||
return new StreamingService(mSubscriptionId, streamingService, serviceInfo, listener);
|
||||
}
|
||||
|
||||
private void bindAndInitialize() throws MbmsException {
|
||||
@@ -237,15 +206,14 @@ public class MbmsStreamingManager {
|
||||
IMbmsStreamingService.Stub.asInterface(service);
|
||||
int result;
|
||||
try {
|
||||
result = streamingService.initialize(mInternalCallback,
|
||||
mSubscriptionId);
|
||||
result = streamingService.initialize(mCallbackToApp, mSubscriptionId);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(LOG_TAG, "Service died before initialization");
|
||||
return;
|
||||
} catch (RuntimeException e) {
|
||||
Log.e(LOG_TAG, "Runtime exception during initialization");
|
||||
try {
|
||||
mInternalCallback.error(
|
||||
mCallbackToApp.error(
|
||||
MbmsException.InitializationErrors
|
||||
.ERROR_UNABLE_TO_INITIALIZE,
|
||||
e.toString());
|
||||
@@ -256,7 +224,7 @@ public class MbmsStreamingManager {
|
||||
}
|
||||
if (result != MbmsException.SUCCESS) {
|
||||
try {
|
||||
mInternalCallback.error(
|
||||
mCallbackToApp.error(
|
||||
result, "Error returned during initialization");
|
||||
} catch (RemoteException e) {
|
||||
// ignore
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License
|
||||
*/
|
||||
|
||||
package android.telephony.mbms;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.RemoteException;
|
||||
import android.telephony.mbms.IMbmsStreamingManagerCallback;
|
||||
import android.telephony.mbms.MbmsStreamingManagerCallback;
|
||||
import android.telephony.mbms.StreamingServiceInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** @hide */
|
||||
public class InternalStreamingManagerCallback extends IMbmsStreamingManagerCallback.Stub {
|
||||
private final Handler mHandler;
|
||||
private final MbmsStreamingManagerCallback mAppCallback;
|
||||
|
||||
public InternalStreamingManagerCallback(MbmsStreamingManagerCallback appCallback,
|
||||
Handler handler) {
|
||||
mAppCallback = appCallback;
|
||||
mHandler = handler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void error(int errorCode, String message) throws RemoteException {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mAppCallback.onError(errorCode, message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void streamingServicesUpdated(List<StreamingServiceInfo> services)
|
||||
throws RemoteException {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mAppCallback.onStreamingServicesUpdated(services);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void middlewareReady() throws RemoteException {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mAppCallback.onMiddlewareReady();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public Handler getHandler() {
|
||||
return mHandler;
|
||||
}
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License
|
||||
*/
|
||||
|
||||
package android.telephony.mbms;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.RemoteException;
|
||||
|
||||
/** @hide */
|
||||
public class InternalStreamingServiceCallback extends IStreamingServiceCallback.Stub {
|
||||
private final StreamingServiceCallback mAppCallback;
|
||||
private final Handler mHandler;
|
||||
|
||||
public InternalStreamingServiceCallback(StreamingServiceCallback appCallback, Handler handler) {
|
||||
mAppCallback = appCallback;
|
||||
mHandler = handler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void error(int errorCode, String message) throws RemoteException {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mAppCallback.onError(errorCode, message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void streamStateUpdated(int state, int reason) throws RemoteException {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mAppCallback.onStreamStateUpdated(state, reason);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mediaDescriptionUpdated() throws RemoteException {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mAppCallback.onMediaDescriptionUpdated();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void broadcastSignalStrengthUpdated(int signalStrength) throws RemoteException {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mAppCallback.onBroadcastSignalStrengthUpdated(signalStrength);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void streamMethodUpdated(int methodType) throws RemoteException {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mAppCallback.onStreamMethodUpdated(methodType);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,6 @@ public class MbmsException extends Exception {
|
||||
* middleware. They are applicable to both streaming and file-download use-cases.
|
||||
*/
|
||||
public static class InitializationErrors {
|
||||
private InitializationErrors() {}
|
||||
/**
|
||||
* Indicates that the app tried to create more than one instance each of
|
||||
* {@link android.telephony.MbmsStreamingManager} or
|
||||
@@ -61,10 +60,9 @@ public class MbmsException extends Exception {
|
||||
* streaming and file-download.
|
||||
*/
|
||||
public static class GeneralErrors {
|
||||
private GeneralErrors() {}
|
||||
/**
|
||||
* Indicates that the app attempted to perform an operation before receiving notification
|
||||
* that the middleware is ready via {@link MbmsStreamingManagerCallback#onMiddlewareReady()}
|
||||
* that the middleware is ready via {@link MbmsStreamingManagerCallback#middlewareReady()}
|
||||
* or TODO: link MbmsDownloadManagerCallback#middlewareReady
|
||||
*/
|
||||
public static final int ERROR_MIDDLEWARE_NOT_YET_READY = 201;
|
||||
@@ -98,7 +96,6 @@ public class MbmsException extends Exception {
|
||||
* Indicates the errors that are applicable only to the streaming use-case
|
||||
*/
|
||||
public static class StreamingErrors {
|
||||
private StreamingErrors() {}
|
||||
/** Indicates that the middleware cannot start a stream due to too many ongoing streams */
|
||||
public static final int ERROR_CONCURRENT_SERVICE_LIMIT_REACHED = 301;
|
||||
|
||||
@@ -107,8 +104,7 @@ public class MbmsException extends Exception {
|
||||
|
||||
/**
|
||||
* Indicates that the app called
|
||||
* {@link android.telephony.MbmsStreamingManager#startStreaming(
|
||||
* StreamingServiceInfo, StreamingServiceCallback, android.os.Handler)}
|
||||
* {@link android.telephony.MbmsStreamingManager#startStreaming(StreamingServiceInfo, StreamingServiceCallback)}
|
||||
* more than once for the same {@link StreamingServiceInfo}.
|
||||
*/
|
||||
public static final int ERROR_DUPLICATE_START_STREAM = 303;
|
||||
|
||||
@@ -26,14 +26,14 @@ import java.util.List;
|
||||
* services. An instance of this object should be passed into
|
||||
* {@link android.telephony.MbmsStreamingManager#create(Context, MbmsStreamingManagerCallback)}.
|
||||
*/
|
||||
public class MbmsStreamingManagerCallback {
|
||||
public class MbmsStreamingManagerCallback extends IMbmsStreamingManagerCallback.Stub {
|
||||
/**
|
||||
* Called by the middleware when it has detected an error condition. The possible error codes
|
||||
* are listed in {@link MbmsException}.
|
||||
* @param errorCode The error code.
|
||||
* @param message A human-readable message generated by the middleware for debugging purposes.
|
||||
*/
|
||||
public void onError(int errorCode, String message) {
|
||||
public void error(int errorCode, String message) throws RemoteException {
|
||||
// default implementation empty
|
||||
}
|
||||
|
||||
@@ -49,7 +49,8 @@ public class MbmsStreamingManagerCallback {
|
||||
* @param services a List of StreamingServiceInfos
|
||||
*
|
||||
*/
|
||||
public void onStreamingServicesUpdated(List<StreamingServiceInfo> services) {
|
||||
public void streamingServicesUpdated(List<StreamingServiceInfo> services)
|
||||
throws RemoteException {
|
||||
// default implementation empty
|
||||
}
|
||||
|
||||
@@ -61,7 +62,8 @@ public class MbmsStreamingManagerCallback {
|
||||
* being thrown with error code {@link MbmsException#ERROR_MIDDLEWARE_NOT_BOUND}
|
||||
* or {@link MbmsException.GeneralErrors#ERROR_MIDDLEWARE_NOT_YET_READY}
|
||||
*/
|
||||
public void onMiddlewareReady() {
|
||||
@Override
|
||||
public void middlewareReady() throws RemoteException {
|
||||
// default implementation empty
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import java.util.Set;
|
||||
* Describes a cell-broadcast service. This class should not be instantiated directly -- use
|
||||
* {@link StreamingServiceInfo} or FileServiceInfo TODO: add link once that's unhidden
|
||||
*/
|
||||
public class ServiceInfo {
|
||||
public class ServiceInfo implements Parcelable {
|
||||
// arbitrary limit on the number of locale -> name pairs we support
|
||||
final static int MAP_LIMIT = 1000;
|
||||
|
||||
@@ -67,6 +67,19 @@ public class ServiceInfo {
|
||||
sessionEndTime = (Date)end.clone();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<ServiceInfo> CREATOR =
|
||||
new Parcelable.Creator<ServiceInfo>() {
|
||||
@Override
|
||||
public ServiceInfo createFromParcel(Parcel source) {
|
||||
return new ServiceInfo(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServiceInfo[] newArray(int size) {
|
||||
return new ServiceInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
protected ServiceInfo(Parcel in) {
|
||||
int mapCount = in.readInt();
|
||||
@@ -94,7 +107,7 @@ public class ServiceInfo {
|
||||
sessionEndTime = (java.util.Date) in.readSerializable();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
Set<Locale> keySet = names.keySet();
|
||||
dest.writeInt(keySet.size());
|
||||
@@ -113,6 +126,11 @@ public class ServiceInfo {
|
||||
dest.writeSerializable(sessionEndTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* User displayable names listed by language. Do not modify the map returned from this method.
|
||||
*/
|
||||
|
||||
@@ -28,14 +28,14 @@ import java.lang.annotation.RetentionPolicy;
|
||||
/**
|
||||
* Class used to represent a single MBMS stream. After a stream has been started with
|
||||
* {@link android.telephony.MbmsStreamingManager#startStreaming(StreamingServiceInfo,
|
||||
* StreamingServiceCallback, android.os.Handler)},
|
||||
* StreamingServiceCallback)},
|
||||
* this class is used to hold information about the stream and control it.
|
||||
*/
|
||||
public class StreamingService {
|
||||
private static final String LOG_TAG = "MbmsStreamingService";
|
||||
|
||||
/**
|
||||
* The state of a stream, reported via {@link StreamingServiceCallback#onStreamStateUpdated}
|
||||
* The state of a stream, reported via {@link StreamingServiceCallback#streamStateUpdated}
|
||||
* @hide
|
||||
*/
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@@ -47,7 +47,7 @@ public class StreamingService {
|
||||
|
||||
/**
|
||||
* The reason for a stream state change, reported via
|
||||
* {@link StreamingServiceCallback#onStreamStateUpdated}
|
||||
* {@link StreamingServiceCallback#streamStateUpdated}
|
||||
* @hide
|
||||
*/
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@@ -64,7 +64,7 @@ public class StreamingService {
|
||||
/**
|
||||
* State changed due to a call to {@link #stopStreaming()} or
|
||||
* {@link android.telephony.MbmsStreamingManager#startStreaming(StreamingServiceInfo,
|
||||
* StreamingServiceCallback, android.os.Handler)}
|
||||
* StreamingServiceCallback)}
|
||||
*/
|
||||
public static final int REASON_BY_USER_REQUEST = 1;
|
||||
|
||||
@@ -95,24 +95,23 @@ public class StreamingService {
|
||||
|
||||
/**
|
||||
* The method of transmission currently used for a stream,
|
||||
* reported via {@link StreamingServiceCallback#onStreamMethodUpdated}
|
||||
* reported via {@link StreamingServiceCallback#streamMethodUpdated}
|
||||
*/
|
||||
public final static int BROADCAST_METHOD = 1;
|
||||
public final static int UNICAST_METHOD = 2;
|
||||
|
||||
private final int mSubscriptionId;
|
||||
private final StreamingServiceInfo mServiceInfo;
|
||||
private final InternalStreamingServiceCallback mCallback;
|
||||
private final IStreamingServiceCallback mCallback;
|
||||
|
||||
private IMbmsStreamingService mService;
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public StreamingService(int subscriptionId,
|
||||
IMbmsStreamingService service,
|
||||
StreamingServiceInfo streamingServiceInfo,
|
||||
InternalStreamingServiceCallback callback) {
|
||||
IStreamingServiceCallback callback) {
|
||||
mSubscriptionId = subscriptionId;
|
||||
mService = service;
|
||||
mServiceInfo = streamingServiceInfo;
|
||||
|
||||
@@ -16,11 +16,13 @@
|
||||
|
||||
package android.telephony.mbms;
|
||||
|
||||
import android.os.RemoteException;
|
||||
|
||||
/**
|
||||
* A callback class for use when the application is actively streaming content. The middleware
|
||||
* will provide updates on the status of the stream via this callback.
|
||||
*/
|
||||
public class StreamingServiceCallback {
|
||||
public class StreamingServiceCallback extends IStreamingServiceCallback.Stub {
|
||||
|
||||
/**
|
||||
* Indicates broadcast signal strength is not available for this service.
|
||||
@@ -37,7 +39,8 @@ public class StreamingServiceCallback {
|
||||
* @param errorCode The error code.
|
||||
* @param message A human-readable message generated by the middleware for debugging purposes.
|
||||
*/
|
||||
public void onError(int errorCode, String message) {
|
||||
@Override
|
||||
public void error(int errorCode, String message) throws RemoteException {
|
||||
// default implementation empty
|
||||
}
|
||||
|
||||
@@ -47,8 +50,9 @@ public class StreamingServiceCallback {
|
||||
* See {@link StreamingService#STATE_STOPPED}, {@link StreamingService#STATE_STARTED}
|
||||
* and {@link StreamingService#STATE_STALLED}.
|
||||
*/
|
||||
public void onStreamStateUpdated(@StreamingService.StreamingState int state,
|
||||
@StreamingService.StreamingStateChangeReason int reason) {
|
||||
@Override
|
||||
public void streamStateUpdated(@StreamingService.StreamingState int state,
|
||||
@StreamingService.StreamingStateChangeReason int reason) throws RemoteException {
|
||||
// default implementation empty
|
||||
}
|
||||
|
||||
@@ -62,7 +66,8 @@ public class StreamingServiceCallback {
|
||||
* This may be called when a looping stream hits the end or
|
||||
* when parameters have changed to account for time drift.
|
||||
*/
|
||||
public void onMediaDescriptionUpdated() {
|
||||
@Override
|
||||
public void mediaDescriptionUpdated() throws RemoteException {
|
||||
// default implementation empty
|
||||
}
|
||||
|
||||
@@ -76,7 +81,8 @@ public class StreamingServiceCallback {
|
||||
* {@link #SIGNAL_STRENGTH_UNAVAILABLE} if broadcast is not available
|
||||
* for this service due to timing, geography or popularity.
|
||||
*/
|
||||
public void onBroadcastSignalStrengthUpdated(int signalStrength) {
|
||||
@Override
|
||||
public void broadcastSignalStrengthUpdated(int signalStrength) throws RemoteException {
|
||||
// default implementation empty
|
||||
}
|
||||
|
||||
@@ -96,7 +102,8 @@ public class StreamingServiceCallback {
|
||||
* See {@link StreamingService#BROADCAST_METHOD} and
|
||||
* {@link StreamingService#UNICAST_METHOD}
|
||||
*/
|
||||
public void onStreamMethodUpdated(int methodType) {
|
||||
@Override
|
||||
public void streamMethodUpdated(int methodType) throws RemoteException {
|
||||
// default implementation empty
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.Map;
|
||||
/**
|
||||
* Describes a single MBMS streaming service.
|
||||
*/
|
||||
public final class StreamingServiceInfo extends ServiceInfo implements Parcelable {
|
||||
public class StreamingServiceInfo extends ServiceInfo implements Parcelable {
|
||||
|
||||
/**
|
||||
* @param names User displayable names listed by language.
|
||||
|
||||
@@ -19,7 +19,6 @@ package android.telephony.mbms.vendor;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.SystemApi;
|
||||
import android.net.Uri;
|
||||
import android.os.Binder;
|
||||
import android.os.RemoteException;
|
||||
import android.telephony.mbms.IMbmsStreamingManagerCallback;
|
||||
import android.telephony.mbms.IStreamingServiceCallback;
|
||||
@@ -60,42 +59,23 @@ public class MbmsStreamingServiceBase extends IMbmsStreamingService.Stub {
|
||||
* @hide
|
||||
*/
|
||||
@Override
|
||||
public final int initialize(IMbmsStreamingManagerCallback listener, final int subscriptionId)
|
||||
public final int initialize(IMbmsStreamingManagerCallback listener, int subscriptionId)
|
||||
throws RemoteException {
|
||||
final int uid = Binder.getCallingUid();
|
||||
listener.asBinder().linkToDeath(new DeathRecipient() {
|
||||
@Override
|
||||
public void binderDied() {
|
||||
onAppCallbackDied(uid, subscriptionId);
|
||||
}
|
||||
}, 0);
|
||||
|
||||
return initialize(new MbmsStreamingManagerCallback() {
|
||||
@Override
|
||||
public void onError(int errorCode, String message) {
|
||||
try {
|
||||
listener.error(errorCode, message);
|
||||
} catch (RemoteException e) {
|
||||
onAppCallbackDied(uid, subscriptionId);
|
||||
}
|
||||
public void error(int errorCode, String message) throws RemoteException {
|
||||
listener.error(errorCode, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStreamingServicesUpdated(List<StreamingServiceInfo> services) {
|
||||
try {
|
||||
listener.streamingServicesUpdated(services);
|
||||
} catch (RemoteException e) {
|
||||
onAppCallbackDied(uid, subscriptionId);
|
||||
}
|
||||
public void streamingServicesUpdated(List<StreamingServiceInfo> services) throws
|
||||
RemoteException {
|
||||
listener.streamingServicesUpdated(services);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMiddlewareReady() {
|
||||
try {
|
||||
listener.middlewareReady();
|
||||
} catch (RemoteException e) {
|
||||
onAppCallbackDied(uid, subscriptionId);
|
||||
}
|
||||
public void middlewareReady() throws RemoteException {
|
||||
listener.middlewareReady();
|
||||
}
|
||||
}, subscriptionId);
|
||||
}
|
||||
@@ -149,59 +129,32 @@ public class MbmsStreamingServiceBase extends IMbmsStreamingService.Stub {
|
||||
@Override
|
||||
public int startStreaming(int subscriptionId, String serviceId,
|
||||
IStreamingServiceCallback listener) throws RemoteException {
|
||||
final int uid = Binder.getCallingUid();
|
||||
listener.asBinder().linkToDeath(new DeathRecipient() {
|
||||
@Override
|
||||
public void binderDied() {
|
||||
onAppCallbackDied(uid, subscriptionId);
|
||||
}
|
||||
}, 0);
|
||||
|
||||
return startStreaming(subscriptionId, serviceId, new StreamingServiceCallback() {
|
||||
@Override
|
||||
public void onError(int errorCode, String message) {
|
||||
try {
|
||||
listener.error(errorCode, message);
|
||||
} catch (RemoteException e) {
|
||||
onAppCallbackDied(uid, subscriptionId);
|
||||
}
|
||||
public void error(int errorCode, String message) throws RemoteException {
|
||||
listener.error(errorCode, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStreamStateUpdated(@StreamingService.StreamingState int state,
|
||||
@StreamingService.StreamingStateChangeReason int reason) {
|
||||
try {
|
||||
listener.streamStateUpdated(state, reason);
|
||||
} catch (RemoteException e) {
|
||||
onAppCallbackDied(uid, subscriptionId);
|
||||
}
|
||||
public void streamStateUpdated(@StreamingService.StreamingState int state,
|
||||
@StreamingService.StreamingStateChangeReason int reason)
|
||||
throws RemoteException {
|
||||
listener.streamStateUpdated(state, reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMediaDescriptionUpdated() {
|
||||
try {
|
||||
listener.mediaDescriptionUpdated();
|
||||
} catch (RemoteException e) {
|
||||
onAppCallbackDied(uid, subscriptionId);
|
||||
}
|
||||
public void mediaDescriptionUpdated() throws RemoteException {
|
||||
listener.mediaDescriptionUpdated();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBroadcastSignalStrengthUpdated(int signalStrength) {
|
||||
try {
|
||||
listener.broadcastSignalStrengthUpdated(signalStrength);
|
||||
} catch (RemoteException e) {
|
||||
onAppCallbackDied(uid, subscriptionId);
|
||||
}
|
||||
public void broadcastSignalStrengthUpdated(int signalStrength) throws RemoteException {
|
||||
listener.broadcastSignalStrengthUpdated(signalStrength);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStreamMethodUpdated(int methodType) {
|
||||
try {
|
||||
listener.streamMethodUpdated(methodType);
|
||||
} catch (RemoteException e) {
|
||||
onAppCallbackDied(uid, subscriptionId);
|
||||
}
|
||||
public void streamMethodUpdated(int methodType) throws RemoteException {
|
||||
listener.streamMethodUpdated(methodType);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -268,12 +221,4 @@ public class MbmsStreamingServiceBase extends IMbmsStreamingService.Stub {
|
||||
@Override
|
||||
public void dispose(int subscriptionId) throws RemoteException {
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates that the app identified by the given UID and subscription ID has died.
|
||||
* @param uid the UID of the app, as returned by {@link Binder#getCallingUid()}.
|
||||
* @param subscriptionId The subscription ID the app is using.
|
||||
*/
|
||||
public void onAppCallbackDied(int uid, int subscriptionId) {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user