field public static final int STATUS_UNKNOWN_ERROR = 4; // 0x4
}
+ public class MbmsStreamingManager {
+ 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) throws android.telephony.mbms.MbmsException;
+ }
+
public class NeighboringCellInfo implements android.os.Parcelable {
ctor public deprecated NeighboringCellInfo();
ctor public deprecated NeighboringCellInfo(int, int);
}
+package android.telephony.mbms {
+
+ public class MbmsException extends java.lang.Exception {
+ method public int getErrorCode();
+ field public static final int ERROR_MIDDLEWARE_LOST = 3; // 0x3
+ field public static final int ERROR_MIDDLEWARE_NOT_BOUND = 2; // 0x2
+ field public static final int ERROR_NO_UNIQUE_MIDDLEWARE = 1; // 0x1
+ field public static final int SUCCESS = 0; // 0x0
+ }
+
+ 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
+ field public static final int ERROR_MIDDLEWARE_TEMPORARILY_UNAVAILABLE = 203; // 0xcb
+ field public static final int ERROR_NOT_CONNECTED_TO_HOME_CARRIER_LTE = 205; // 0xcd
+ field public static final int ERROR_OUT_OF_MEMORY = 202; // 0xca
+ field public static final int ERROR_UNABLE_TO_READ_SIM = 206; // 0xce
+ }
+
+ 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 extends android.os.Binder {
+ ctor public MbmsStreamingManagerCallback();
+ 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 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 {
+ method public void dispose() throws android.telephony.mbms.MbmsException;
+ method public android.telephony.mbms.StreamingServiceInfo getInfo();
+ method public android.net.Uri getPlaybackUri() throws android.telephony.mbms.MbmsException;
+ method public void stopStreaming() throws android.telephony.mbms.MbmsException;
+ field public static final int BROADCAST_METHOD = 1; // 0x1
+ field public static final int REASON_BY_USER_REQUEST = 1; // 0x1
+ field public static final int REASON_END_OF_SESSION = 2; // 0x2
+ field public static final int REASON_FREQUENCY_CONFLICT = 3; // 0x3
+ field public static final int REASON_LEFT_MBMS_BROADCAST_AREA = 5; // 0x5
+ field public static final int REASON_NONE = 0; // 0x0
+ field public static final int REASON_NOT_CONNECTED_TO_HOMECARRIER_LTE = 5; // 0x5
+ field public static final int REASON_OUT_OF_MEMORY = 4; // 0x4
+ field public static final int STATE_STALLED = 3; // 0x3
+ field public static final int STATE_STARTED = 2; // 0x2
+ field public static final int STATE_STOPPED = 1; // 0x1
+ field public static final int UNICAST_METHOD = 2; // 0x2
+ }
+
+ public class StreamingServiceCallback extends android.os.Binder {
+ ctor public StreamingServiceCallback();
+ 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 class StreamingServiceInfo extends android.telephony.mbms.ServiceInfo implements android.os.Parcelable {
+ field public static final android.os.Parcelable.Creator<android.telephony.mbms.StreamingServiceInfo> CREATOR;
+ }
+
+}
+
package android.test {
public abstract deprecated class ActivityInstrumentationTestCase<T extends android.app.Activity> extends android.test.ActivityTestCase {
field public static final int STATUS_UNKNOWN_ERROR = 4; // 0x4
}
+ public class MbmsStreamingManager {
+ 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) throws android.telephony.mbms.MbmsException;
+ field public static final java.lang.String MBMS_STREAMING_SERVICE_ACTION = "android.telephony.action.EmbmsStreaming";
+ }
+
public class NeighboringCellInfo implements android.os.Parcelable {
ctor public deprecated NeighboringCellInfo();
ctor public deprecated NeighboringCellInfo(int, int);
}
+package android.telephony.mbms {
+
+ public class MbmsException extends java.lang.Exception {
+ method public int getErrorCode();
+ field public static final int ERROR_MIDDLEWARE_LOST = 3; // 0x3
+ field public static final int ERROR_MIDDLEWARE_NOT_BOUND = 2; // 0x2
+ field public static final int ERROR_NO_UNIQUE_MIDDLEWARE = 1; // 0x1
+ field public static final int SUCCESS = 0; // 0x0
+ }
+
+ 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
+ field public static final int ERROR_MIDDLEWARE_TEMPORARILY_UNAVAILABLE = 203; // 0xcb
+ field public static final int ERROR_NOT_CONNECTED_TO_HOME_CARRIER_LTE = 205; // 0xcd
+ field public static final int ERROR_OUT_OF_MEMORY = 202; // 0xca
+ field public static final int ERROR_UNABLE_TO_READ_SIM = 206; // 0xce
+ }
+
+ 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 extends android.os.Binder {
+ ctor public MbmsStreamingManagerCallback();
+ 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 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 {
+ method public void dispose() throws android.telephony.mbms.MbmsException;
+ method public android.telephony.mbms.StreamingServiceInfo getInfo();
+ method public android.net.Uri getPlaybackUri() throws android.telephony.mbms.MbmsException;
+ method public void stopStreaming() throws android.telephony.mbms.MbmsException;
+ field public static final int BROADCAST_METHOD = 1; // 0x1
+ field public static final int REASON_BY_USER_REQUEST = 1; // 0x1
+ field public static final int REASON_END_OF_SESSION = 2; // 0x2
+ field public static final int REASON_FREQUENCY_CONFLICT = 3; // 0x3
+ field public static final int REASON_LEFT_MBMS_BROADCAST_AREA = 5; // 0x5
+ field public static final int REASON_NONE = 0; // 0x0
+ field public static final int REASON_NOT_CONNECTED_TO_HOMECARRIER_LTE = 5; // 0x5
+ field public static final int REASON_OUT_OF_MEMORY = 4; // 0x4
+ field public static final int STATE_STALLED = 3; // 0x3
+ field public static final int STATE_STARTED = 2; // 0x2
+ field public static final int STATE_STOPPED = 1; // 0x1
+ field public static final int UNICAST_METHOD = 2; // 0x2
+ }
+
+ public class StreamingServiceCallback extends android.os.Binder {
+ ctor public StreamingServiceCallback();
+ 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 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);
+ field public static final android.os.Parcelable.Creator<android.telephony.mbms.StreamingServiceInfo> CREATOR;
+ }
+
+}
+
+package android.telephony.mbms.vendor {
+
+ public class MbmsStreamingServiceBase extends android.os.Binder {
+ ctor public MbmsStreamingServiceBase();
+ method public void dispose(int) throws android.os.RemoteException;
+ method public void disposeStream(int, java.lang.String) throws android.os.RemoteException;
+ 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 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;
+ }
+
+}
+
package android.test {
public abstract deprecated class ActivityInstrumentationTestCase<T extends android.app.Activity> extends android.test.ActivityTestCase {
field public static final int STATUS_UNKNOWN_ERROR = 4; // 0x4
}
+ public class MbmsStreamingManager {
+ 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) throws android.telephony.mbms.MbmsException;
+ }
+
public class NeighboringCellInfo implements android.os.Parcelable {
ctor public deprecated NeighboringCellInfo();
ctor public deprecated NeighboringCellInfo(int, int);
}
+package android.telephony.mbms {
+
+ public class MbmsException extends java.lang.Exception {
+ method public int getErrorCode();
+ field public static final int ERROR_MIDDLEWARE_LOST = 3; // 0x3
+ field public static final int ERROR_MIDDLEWARE_NOT_BOUND = 2; // 0x2
+ field public static final int ERROR_NO_UNIQUE_MIDDLEWARE = 1; // 0x1
+ field public static final int SUCCESS = 0; // 0x0
+ }
+
+ 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
+ field public static final int ERROR_MIDDLEWARE_TEMPORARILY_UNAVAILABLE = 203; // 0xcb
+ field public static final int ERROR_NOT_CONNECTED_TO_HOME_CARRIER_LTE = 205; // 0xcd
+ field public static final int ERROR_OUT_OF_MEMORY = 202; // 0xca
+ field public static final int ERROR_UNABLE_TO_READ_SIM = 206; // 0xce
+ }
+
+ 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 extends android.os.Binder {
+ ctor public MbmsStreamingManagerCallback();
+ 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 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 {
+ method public void dispose() throws android.telephony.mbms.MbmsException;
+ method public android.telephony.mbms.StreamingServiceInfo getInfo();
+ method public android.net.Uri getPlaybackUri() throws android.telephony.mbms.MbmsException;
+ method public void stopStreaming() throws android.telephony.mbms.MbmsException;
+ field public static final int BROADCAST_METHOD = 1; // 0x1
+ field public static final int REASON_BY_USER_REQUEST = 1; // 0x1
+ field public static final int REASON_END_OF_SESSION = 2; // 0x2
+ field public static final int REASON_FREQUENCY_CONFLICT = 3; // 0x3
+ field public static final int REASON_LEFT_MBMS_BROADCAST_AREA = 5; // 0x5
+ field public static final int REASON_NONE = 0; // 0x0
+ field public static final int REASON_NOT_CONNECTED_TO_HOMECARRIER_LTE = 5; // 0x5
+ field public static final int REASON_OUT_OF_MEMORY = 4; // 0x4
+ field public static final int STATE_STALLED = 3; // 0x3
+ field public static final int STATE_STARTED = 2; // 0x2
+ field public static final int STATE_STOPPED = 1; // 0x1
+ field public static final int UNICAST_METHOD = 2; // 0x2
+ }
+
+ public class StreamingServiceCallback extends android.os.Binder {
+ ctor public StreamingServiceCallback();
+ 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 class StreamingServiceInfo extends android.telephony.mbms.ServiceInfo implements android.os.Parcelable {
+ field public static final android.os.Parcelable.Creator<android.telephony.mbms.StreamingServiceInfo> CREATOR;
+ }
+
+}
+
package android.test {
public abstract deprecated class ActivityInstrumentationTestCase<T extends android.app.Activity> extends android.test.ActivityTestCase {
package android.telephony;
+import android.annotation.SdkConstant;
+import android.annotation.SystemApi;
import android.content.ComponentName;
import android.content.Context;
import android.content.ServiceConnection;
/**
* This class provides functionality for streaming media over MBMS.
- * @hide
*/
public class MbmsStreamingManager {
private static final String LOG_TAG = "MbmsStreamingManager";
+
+ /**
+ * Service action which must be handled by the middleware implementing the MBMS streaming
+ * interface.
+ * @hide
+ */
+ @SystemApi
+ @SdkConstant(SdkConstant.SdkConstantType.SERVICE_ACTION)
public static final String MBMS_STREAMING_SERVICE_ACTION =
"android.telephony.action.EmbmsStreaming";
return;
} catch (RuntimeException e) {
Log.e(LOG_TAG, "Runtime exception during initialization");
- mCallbackToApp.error(
- MbmsException.InitializationErrors.ERROR_UNABLE_TO_INITIALIZE,
- e.toString());
+ try {
+ mCallbackToApp.error(
+ MbmsException.InitializationErrors
+ .ERROR_UNABLE_TO_INITIALIZE,
+ e.toString());
+ } catch (RemoteException e1) {
+ // ignore
+ }
return;
}
if (result != MbmsException.SUCCESS) {
- mCallbackToApp.error(result, "Error returned during initialization");
+ try {
+ mCallbackToApp.error(
+ result, "Error returned during initialization");
+ } catch (RemoteException e) {
+ // ignore
+ }
return;
}
mService.set(streamingService);
}
};
+ /**
+ * @hide
+ * TODO: systemapi
+ */
public FileInfo(Uri uri, String mimeType, long size, byte[] md5Hash) {
this.uri = uri;
this.mimeType = mimeType;
public class FileServiceInfo extends ServiceInfo implements Parcelable {
private final List<FileInfo> files;
+ /** @hide TODO: systemapi */
public FileServiceInfo(Map<Locale, String> newNames, String newClassName,
List<Locale> newLocales, String newServiceId, Date start, Date end,
List<FileInfo> newFiles) {
package android.telephony.mbms;
-/** @hide */
public class MbmsException extends Exception {
/** Indicates that the operation was successful. */
public static final int SUCCESS = 0;
/**
* Indicates that the app attempted to perform an operation on an instance of
- * {@link android.telephony.MbmsDownloadManager} or
+ * TODO: link android.telephony.MbmsDownloadManager or
* {@link android.telephony.MbmsStreamingManager} without being bound to the middleware.
*/
public static final int ERROR_MIDDLEWARE_NOT_BOUND = 2;
/**
* Indicates that the app tried to create more than one instance each of
* {@link android.telephony.MbmsStreamingManager} or
- * {@link android.telephony.MbmsDownloadManager}.
+ * TODO: link android.telephony.MbmsDownloadManager
*/
public static final int ERROR_DUPLICATE_INITIALIZE = 101;
/** Indicates that the app is not authorized to access media via MBMS.*/
/**
* Indicates that the app attempted to perform an operation before receiving notification
* that the middleware is ready via {@link MbmsStreamingManagerCallback#middlewareReady()}
- * or {@link MbmsDownloadManagerCallback#middlewareReady()}.
+ * or TODO: link MbmsDownloadManagerCallback#middlewareReady
*/
public static final int ERROR_MIDDLEWARE_NOT_YET_READY = 201;
/**
/**
* Indicates the errors that are applicable only to the file-download use-case
+ * TODO: unhide
+ * @hide
*/
public static class DownloadErrors {
/**
private final int mErrorCode;
- /** @hide
- * TODO: future systemapi
- */
+ /** @hide */
public MbmsException(int errorCode) {
super();
mErrorCode = errorCode;
package android.telephony.mbms;
+import android.content.Context;
+import android.os.RemoteException;
+
import java.util.List;
/**
- * A Parcelable class with Cell-Broadcast service information.
- * @hide
+ * A callback class that is used to receive information from the middleware on MBMS streaming
+ * services. An instance of this object should be passed into
+ * {@link android.telephony.MbmsStreamingManager#create(Context, MbmsStreamingManagerCallback)}.
*/
public class MbmsStreamingManagerCallback extends IMbmsStreamingManagerCallback.Stub {
-
- public final static int ERROR_CARRIER_NOT_SUPPORTED = 1;
- public final static int ERROR_UNABLE_TO_INITIALIZE = 2;
- public final static int ERROR_UNABLE_TO_ALLOCATE_MEMORY = 3;
-
-
- public void error(int errorCode, String message) {
+ /**
+ * 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 error(int errorCode, String message) throws RemoteException {
// default implementation empty
}
* @param services a List of StreamingServiceInfos
*
*/
- public void streamingServicesUpdated(List<StreamingServiceInfo> services) {
+ public void streamingServicesUpdated(List<StreamingServiceInfo> services)
+ throws RemoteException {
// default implementation empty
}
* or {@link MbmsException.GeneralErrors#ERROR_MIDDLEWARE_NOT_YET_READY}
*/
@Override
- public void middlewareReady() {
+ public void middlewareReady() throws RemoteException {
// default implementation empty
}
}
import java.util.Set;
/**
- * A Parcelable class with Cell-Broadcast service information.
- * @hide
+ * 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 implements Parcelable {
// arbitrary limit on the number of locale -> name pairs we support
final static int MAP_LIMIT = 1000;
- /**
- * User displayable names listed by language. Unmodifiable.
- */
- final Map<Locale, String> names;
-
- /**
- * The class name for this service - used to catagorize and filter
- */
- final String className;
-
- /**
- * The languages available for this service content
- */
- final List<Locale> locales;
-
- /**
- * The carrier's identifier for the service.
- */
- final String serviceId;
-
- /**
- * The start time indicating when this service will be available.
- */
- final Date sessionStartTime;
-
- /**
- * The end time indicating when this sesion stops being available.
- */
- final Date sessionEndTime;
+ private final Map<Locale, String> names;
+ private final String className;
+ private final List<Locale> locales;
+ private final String serviceId;
+ private final Date sessionStartTime;
+ private final Date sessionEndTime;
+ /** @hide */
public ServiceInfo(Map<Locale, String> newNames, String newClassName, List<Locale> newLocales,
String newServiceId, Date start, Date end) {
if (newNames == null || newNames.isEmpty() || TextUtils.isEmpty(newClassName)
sessionEndTime = (Date)end.clone();
}
- public static final Parcelable.Creator<FileServiceInfo> CREATOR =
- new Parcelable.Creator<FileServiceInfo>() {
+ public static final Parcelable.Creator<ServiceInfo> CREATOR =
+ new Parcelable.Creator<ServiceInfo>() {
@Override
- public FileServiceInfo createFromParcel(Parcel source) {
- return new FileServiceInfo(source);
+ public ServiceInfo createFromParcel(Parcel source) {
+ return new ServiceInfo(source);
}
@Override
- public FileServiceInfo[] newArray(int size) {
- return new FileServiceInfo[size];
+ public ServiceInfo[] newArray(int size) {
+ return new ServiceInfo[size];
}
};
- ServiceInfo(Parcel in) {
+ /** @hide */
+ protected ServiceInfo(Parcel in) {
int mapCount = in.readInt();
if (mapCount > MAP_LIMIT || mapCount < 0) {
throw new RuntimeException("bad map length" + mapCount);
return 0;
}
+ /**
+ * User displayable names listed by language. Do not modify the map returned from this method.
+ */
public Map<Locale, String> getNames() {
return names;
}
+ /**
+ * The class name for this service - used to categorize and filter
+ */
public String getClassName() {
return className;
}
+ /**
+ * The languages available for this service content
+ */
public List<Locale> getLocales() {
return locales;
}
+ /**
+ * The carrier's identifier for the service.
+ */
public String getServiceId() {
return serviceId;
}
+ /**
+ * The start time indicating when this service will be available.
+ */
public Date getSessionStartTime() {
return sessionStartTime;
}
+ /**
+ * The end time indicating when this session stops being available.
+ */
public Date getSessionEndTime() {
return sessionEndTime;
}
import java.lang.annotation.RetentionPolicy;
/**
- * @hide
+ * Class used to represent a single MBMS stream. After a stream has been started with
+ * {@link android.telephony.MbmsStreamingManager#startStreaming(StreamingServiceInfo,
+ * StreamingServiceCallback)},
+ * this class is used to hold information about the stream and control it.
*/
public class StreamingService {
private static final String LOG_TAG = "MbmsStreamingService";
/**
* State changed due to a call to {@link #stopStreaming()} or
- * {@link android.telephony.MbmsStreamingManager#startStreaming(StreamingServiceInfo, StreamingServiceCallback)}
+ * {@link android.telephony.MbmsStreamingManager#startStreaming(StreamingServiceInfo,
+ * StreamingServiceCallback)}
*/
public static final int REASON_BY_USER_REQUEST = 1;
package android.telephony.mbms;
+import android.os.RemoteException;
+
/**
- * A Callback class for use when the application is actively streaming content.
- * @hide
+ * 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 extends IStreamingServiceCallback.Stub {
*/
public static final int SIGNAL_STRENGTH_UNAVAILABLE = -1;
+ /**
+ * Called by the middleware when it has detected an error condition in this stream. 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.
+ */
@Override
- public void error(int errorCode, String message) {
+ public void error(int errorCode, String message) throws RemoteException {
// default implementation empty
}
*/
@Override
public void streamStateUpdated(@StreamingService.StreamingState int state,
- @StreamingService.StreamingStateChangeReason int reason) {
+ @StreamingService.StreamingStateChangeReason int reason) throws RemoteException {
// default implementation empty
}
* when parameters have changed to account for time drift.
*/
@Override
- public void mediaDescriptionUpdated() {
+ public void mediaDescriptionUpdated() throws RemoteException {
// default implementation empty
}
* for this service due to timing, geography or popularity.
*/
@Override
- public void broadcastSignalStrengthUpdated(int signalStrength) {
+ public void broadcastSignalStrengthUpdated(int signalStrength) throws RemoteException {
// default implementation empty
}
* {@link StreamingService#UNICAST_METHOD}
*/
@Override
- public void streamMethodUpdated(int methodType) {
+ public void streamMethodUpdated(int methodType) throws RemoteException {
// default implementation empty
}
}
package android.telephony.mbms;
+import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.Map;
/**
- * A Parcelable class Cell-Broadcast media stream information.
- * This may not have any more info than ServiceInfo, but kept for completeness.
- * @hide
+ * Describes a single MBMS streaming service.
*/
public class StreamingServiceInfo extends ServiceInfo implements Parcelable {
- public StreamingServiceInfo(Map<Locale, String> newNames, String newClassName,
- List<Locale> newLocales, String newServiceId, Date start, Date end) {
- super(newNames, newClassName, newLocales, newServiceId, start, end);
+ /**
+ * @param names User displayable names listed by language.
+ * @param className The class name for this service - used by frontend apps to categorize and
+ * filter.
+ * @param locales The languages available for this service content.
+ * @param serviceId The carrier's identifier for the service.
+ * @param start The start time indicating when this service will be available.
+ * @param end The end time indicating when this session stops being available.
+ * @hide
+ */
+ @SystemApi
+ public StreamingServiceInfo(Map<Locale, String> names, String className,
+ List<Locale> locales, String serviceId, Date start, Date end) {
+ super(names, className, locales, serviceId, start, end);
}
public static final Parcelable.Creator<StreamingServiceInfo> CREATOR =
}
};
- StreamingServiceInfo(Parcel in) {
+ private StreamingServiceInfo(Parcel in) {
super(in);
}
package android.telephony.mbms.vendor;
import android.annotation.Nullable;
+import android.annotation.SystemApi;
import android.net.Uri;
import android.os.RemoteException;
import android.telephony.mbms.IMbmsStreamingManagerCallback;
import android.telephony.mbms.IStreamingServiceCallback;
import android.telephony.mbms.MbmsException;
+import android.telephony.mbms.MbmsStreamingManagerCallback;
+import android.telephony.mbms.StreamingService;
+import android.telephony.mbms.StreamingServiceCallback;
+import android.telephony.mbms.StreamingServiceInfo;
import java.util.List;
/**
* @hide
- * TODO: future systemapi
*/
+@SystemApi
public class MbmsStreamingServiceBase extends IMbmsStreamingService.Stub {
/**
* Initialize streaming service for this app and subId, registering the listener.
* @param listener The callback to use to communicate with the app.
* @param subscriptionId The subscription ID to use.
*/
- @Override
- public int initialize(IMbmsStreamingManagerCallback listener, int subscriptionId)
+ public int initialize(MbmsStreamingManagerCallback listener, int subscriptionId)
throws RemoteException {
return 0;
}
/**
+ * Actual AIDL implementation that hides the callback AIDL from the middleware.
+ * @hide
+ */
+ @Override
+ public final int initialize(IMbmsStreamingManagerCallback listener, int subscriptionId)
+ throws RemoteException {
+ return initialize(new MbmsStreamingManagerCallback() {
+ @Override
+ public void error(int errorCode, String message) throws RemoteException {
+ listener.error(errorCode, message);
+ }
+
+ @Override
+ public void streamingServicesUpdated(List<StreamingServiceInfo> services) throws
+ RemoteException {
+ listener.streamingServicesUpdated(services);
+ }
+
+ @Override
+ public void middlewareReady() throws RemoteException {
+ listener.middlewareReady();
+ }
+ }, subscriptionId);
+ }
+
+
+ /**
* Registers serviceClasses of interest with the appName/subId key.
* Starts async fetching data on streaming services of matching classes to be reported
* later via {@link IMbmsStreamingManagerCallback#streamingServicesUpdated(List)}
* @param listener The listener object on which the app wishes to receive updates.
* @return Any error in {@link android.telephony.mbms.MbmsException.GeneralErrors}
*/
+ public int startStreaming(int subscriptionId, String serviceId,
+ StreamingServiceCallback listener) throws RemoteException {
+ return 0;
+ }
+
+ /**
+ * Actual AIDL implementation of startStreaming that hides the callback AIDL from the
+ * middleware.
+ * @hide
+ */
@Override
public int startStreaming(int subscriptionId, String serviceId,
IStreamingServiceCallback listener) throws RemoteException {
- return 0;
+ return startStreaming(subscriptionId, serviceId, new StreamingServiceCallback() {
+ @Override
+ public void error(int errorCode, String message) throws RemoteException {
+ listener.error(errorCode, message);
+ }
+
+ @Override
+ public void streamStateUpdated(@StreamingService.StreamingState int state,
+ @StreamingService.StreamingStateChangeReason int reason)
+ throws RemoteException {
+ listener.streamStateUpdated(state, reason);
+ }
+
+ @Override
+ public void mediaDescriptionUpdated() throws RemoteException {
+ listener.mediaDescriptionUpdated();
+ }
+
+ @Override
+ public void broadcastSignalStrengthUpdated(int signalStrength) throws RemoteException {
+ listener.broadcastSignalStrengthUpdated(signalStrength);
+ }
+
+ @Override
+ public void streamMethodUpdated(int methodType) throws RemoteException {
+ listener.streamMethodUpdated(methodType);
+ }
+ });
}
/**