Merge "Rename addServiceAnnouncement-related methods"
This commit is contained in:
@@ -45344,14 +45344,14 @@ package android.telephony {
|
||||
|
||||
public class MbmsDownloadSession implements java.lang.AutoCloseable {
|
||||
method public void addProgressListener(@NonNull android.telephony.mbms.DownloadRequest, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.mbms.DownloadProgressListener);
|
||||
method public void addServiceAnnouncementFile(@NonNull byte[]);
|
||||
method public void addServiceAnnouncement(@NonNull byte[]);
|
||||
method public void addStatusListener(@NonNull android.telephony.mbms.DownloadRequest, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.mbms.DownloadStatusListener);
|
||||
method public void cancelDownload(@NonNull android.telephony.mbms.DownloadRequest);
|
||||
method public void close();
|
||||
method public static android.telephony.MbmsDownloadSession create(@NonNull android.content.Context, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.mbms.MbmsDownloadSessionCallback);
|
||||
method @Nullable public static android.telephony.MbmsDownloadSession create(@NonNull android.content.Context, @NonNull java.util.concurrent.Executor, int, @NonNull android.telephony.mbms.MbmsDownloadSessionCallback);
|
||||
method public void download(@NonNull android.telephony.mbms.DownloadRequest);
|
||||
method public static int getMaximumServiceAnnouncementFileSize();
|
||||
method public static int getMaximumServiceAnnouncementSize();
|
||||
method @Nullable public java.io.File getTempFileRootDirectory();
|
||||
method @NonNull public java.util.List<android.telephony.mbms.DownloadRequest> listPendingDownloads();
|
||||
method public void removeProgressListener(@NonNull android.telephony.mbms.DownloadRequest, @NonNull android.telephony.mbms.DownloadProgressListener);
|
||||
@@ -46958,7 +46958,7 @@ package android.telephony.mbms {
|
||||
|
||||
public static class MbmsErrors.DownloadErrors {
|
||||
field public static final int ERROR_CANNOT_CHANGE_TEMP_FILE_ROOT = 401; // 0x191
|
||||
field public static final int ERROR_MALFORMED_SERVICE_ANNOUNCEMENT_FILE = 404; // 0x194
|
||||
field public static final int ERROR_MALFORMED_SERVICE_ANNOUNCEMENT = 404; // 0x194
|
||||
field public static final int ERROR_UNKNOWN_DOWNLOAD_REQUEST = 402; // 0x192
|
||||
field public static final int ERROR_UNKNOWN_FILE_INFO = 403; // 0x193
|
||||
}
|
||||
|
||||
@@ -10321,7 +10321,7 @@ package android.telephony.mbms.vendor {
|
||||
public class MbmsDownloadServiceBase extends android.os.Binder implements android.os.IInterface {
|
||||
ctor public MbmsDownloadServiceBase();
|
||||
method public int addProgressListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadProgressListener) throws android.os.RemoteException;
|
||||
method public int addServiceAnnouncementFile(int, @NonNull byte[]);
|
||||
method public int addServiceAnnouncement(int, @NonNull byte[]);
|
||||
method public int addStatusListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadStatusListener) throws android.os.RemoteException;
|
||||
method public android.os.IBinder asBinder();
|
||||
method public int cancelDownload(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
|
||||
|
||||
@@ -4099,7 +4099,7 @@ package android.telephony.mbms.vendor {
|
||||
public class MbmsDownloadServiceBase extends android.os.Binder implements android.os.IInterface {
|
||||
ctor public MbmsDownloadServiceBase();
|
||||
method public int addProgressListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadProgressListener) throws android.os.RemoteException;
|
||||
method public int addServiceAnnouncementFile(int, @NonNull byte[]);
|
||||
method public int addServiceAnnouncement(int, @NonNull byte[]);
|
||||
method public int addStatusListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadStatusListener) throws android.os.RemoteException;
|
||||
method public android.os.IBinder asBinder();
|
||||
method public int cancelDownload(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
|
||||
|
||||
@@ -45200,14 +45200,14 @@ package android.telephony {
|
||||
|
||||
public class MbmsDownloadSession implements java.lang.AutoCloseable {
|
||||
method public void addProgressListener(@NonNull android.telephony.mbms.DownloadRequest, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.mbms.DownloadProgressListener);
|
||||
method public void addServiceAnnouncementFile(@NonNull byte[]);
|
||||
method public void addServiceAnnouncement(@NonNull byte[]);
|
||||
method public void addStatusListener(@NonNull android.telephony.mbms.DownloadRequest, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.mbms.DownloadStatusListener);
|
||||
method public void cancelDownload(@NonNull android.telephony.mbms.DownloadRequest);
|
||||
method public void close();
|
||||
method public static android.telephony.MbmsDownloadSession create(@NonNull android.content.Context, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.mbms.MbmsDownloadSessionCallback);
|
||||
method @Nullable public static android.telephony.MbmsDownloadSession create(@NonNull android.content.Context, @NonNull java.util.concurrent.Executor, int, @NonNull android.telephony.mbms.MbmsDownloadSessionCallback);
|
||||
method public void download(@NonNull android.telephony.mbms.DownloadRequest);
|
||||
method public static int getMaximumServiceAnnouncementFileSize();
|
||||
method public static int getMaximumServiceAnnouncementSize();
|
||||
method @Nullable public java.io.File getTempFileRootDirectory();
|
||||
method @NonNull public java.util.List<android.telephony.mbms.DownloadRequest> listPendingDownloads();
|
||||
method public void removeProgressListener(@NonNull android.telephony.mbms.DownloadRequest, @NonNull android.telephony.mbms.DownloadProgressListener);
|
||||
@@ -46814,7 +46814,7 @@ package android.telephony.mbms {
|
||||
|
||||
public static class MbmsErrors.DownloadErrors {
|
||||
field public static final int ERROR_CANNOT_CHANGE_TEMP_FILE_ROOT = 401; // 0x191
|
||||
field public static final int ERROR_MALFORMED_SERVICE_ANNOUNCEMENT_FILE = 404; // 0x194
|
||||
field public static final int ERROR_MALFORMED_SERVICE_ANNOUNCEMENT = 404; // 0x194
|
||||
field public static final int ERROR_UNKNOWN_DOWNLOAD_REQUEST = 402; // 0x192
|
||||
field public static final int ERROR_UNKNOWN_FILE_INFO = 403; // 0x193
|
||||
}
|
||||
|
||||
@@ -10219,7 +10219,7 @@ package android.telephony.mbms.vendor {
|
||||
public class MbmsDownloadServiceBase extends android.os.Binder implements android.os.IInterface {
|
||||
ctor public MbmsDownloadServiceBase();
|
||||
method public int addProgressListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadProgressListener) throws android.os.RemoteException;
|
||||
method public int addServiceAnnouncementFile(int, @NonNull byte[]);
|
||||
method public int addServiceAnnouncement(int, @NonNull byte[]);
|
||||
method public int addStatusListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadStatusListener) throws android.os.RemoteException;
|
||||
method public android.os.IBinder asBinder();
|
||||
method public int cancelDownload(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
|
||||
|
||||
@@ -231,7 +231,7 @@ public class MbmsDownloadSession implements AutoCloseable {
|
||||
|
||||
private static final String DESTINATION_SANITY_CHECK_FILE_NAME = "destinationSanityCheckFile";
|
||||
|
||||
private static final int MAX_SERVICE_ANNOUNCEMENT_FILE_SIZE = 10 * 1024; // 10KB
|
||||
private static final int MAX_SERVICE_ANNOUNCEMENT_SIZE = 10 * 1024; // 10KB
|
||||
|
||||
private static AtomicBoolean sIsInitialized = new AtomicBoolean(false);
|
||||
|
||||
@@ -321,13 +321,13 @@ public class MbmsDownloadSession implements AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum size of the service announcement file that can be provided via
|
||||
* {@link #addServiceAnnouncementFile}
|
||||
* Returns the maximum size of the service announcement descriptor that can be provided via
|
||||
* {@link #addServiceAnnouncement}
|
||||
* @return The maximum length of the byte array passed as an argument to
|
||||
* {@link #addServiceAnnouncementFile}.
|
||||
* {@link #addServiceAnnouncement}.
|
||||
*/
|
||||
public static int getMaximumServiceAnnouncementFileSize() {
|
||||
return MAX_SERVICE_ANNOUNCEMENT_FILE_SIZE;
|
||||
public static int getMaximumServiceAnnouncementSize() {
|
||||
return MAX_SERVICE_ANNOUNCEMENT_SIZE;
|
||||
}
|
||||
|
||||
private int bindAndInitialize() {
|
||||
@@ -436,15 +436,15 @@ public class MbmsDownloadSession implements AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Inform the middleware of a service announcement file received from a group communication
|
||||
* server.
|
||||
* Inform the middleware of a service announcement descriptor received from a group
|
||||
* communication server.
|
||||
*
|
||||
* When participating in a group call via the {@link MbmsGroupCallSession} API, applications may
|
||||
* receive a service announcement file from the group call server that informs them of
|
||||
* receive a service announcement descriptor from the group call server that informs them of
|
||||
* files that may be relevant to users communicating on the group call.
|
||||
*
|
||||
* After supplying the service announcement file received from the server to the middleware via
|
||||
* this API, applications will receive information on the available files via
|
||||
* After supplying the service announcement descriptor received from the server to the
|
||||
* middleware via this API, applications will receive information on the available files via
|
||||
* {@link MbmsDownloadSessionCallback#onFileServicesUpdated}, and the available files will be
|
||||
* downloadable via {@link MbmsDownloadSession#download} like other files published via
|
||||
* {@link MbmsDownloadSessionCallback#onFileServicesUpdated}.
|
||||
@@ -453,26 +453,26 @@ public class MbmsDownloadSession implements AutoCloseable {
|
||||
* callback may include any of the errors that are not specific to the streaming use-case.
|
||||
*
|
||||
* May throw an {@link IllegalStateException} when the middleware has not yet been bound,
|
||||
* or an {@link IllegalArgumentException} if the file is too large.
|
||||
* or an {@link IllegalArgumentException} if the byte array is too large.
|
||||
*
|
||||
* @param fileContents The contents of the service announcement file received from the group
|
||||
* call server. If the size of this array is greater than the value of
|
||||
* {@link #getMaximumServiceAnnouncementFileSize()}, an
|
||||
* @param contents The contents of the service announcement descriptor received from the
|
||||
* group call server. If the size of this array is greater than the value of
|
||||
* {@link #getMaximumServiceAnnouncementSize()}, an
|
||||
* {@link IllegalArgumentException} will be thrown.
|
||||
*/
|
||||
public void addServiceAnnouncementFile(@NonNull byte[] fileContents) {
|
||||
public void addServiceAnnouncement(@NonNull byte[] contents) {
|
||||
IMbmsDownloadService downloadService = mService.get();
|
||||
if (downloadService == null) {
|
||||
throw new IllegalStateException("Middleware not yet bound");
|
||||
}
|
||||
|
||||
if (fileContents.length > MAX_SERVICE_ANNOUNCEMENT_FILE_SIZE) {
|
||||
if (contents.length > MAX_SERVICE_ANNOUNCEMENT_SIZE) {
|
||||
throw new IllegalArgumentException("File too large");
|
||||
}
|
||||
|
||||
try {
|
||||
int returnCode = downloadService.addServiceAnnouncementFile(
|
||||
mSubscriptionId, fileContents);
|
||||
int returnCode = downloadService.addServiceAnnouncement(
|
||||
mSubscriptionId, contents);
|
||||
if (returnCode == MbmsErrors.UNKNOWN) {
|
||||
// Unbind and throw an obvious error
|
||||
close();
|
||||
|
||||
@@ -144,11 +144,11 @@ public class MbmsErrors {
|
||||
public static final int ERROR_UNKNOWN_FILE_INFO = 403;
|
||||
|
||||
/**
|
||||
* Indicates that the service announcement file passed via
|
||||
* {@link android.telephony.MbmsDownloadSession#addServiceAnnouncementFile(byte[])}
|
||||
* Indicates that the service announcement descriptor passed via
|
||||
* {@link android.telephony.MbmsDownloadSession#addServiceAnnouncement(byte[])}
|
||||
* is malformed.
|
||||
*/
|
||||
public static final int ERROR_MALFORMED_SERVICE_ANNOUNCEMENT_FILE = 404;
|
||||
public static final int ERROR_MALFORMED_SERVICE_ANNOUNCEMENT = 404;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,7 +189,7 @@ public class MbmsErrors {
|
||||
DownloadErrors.ERROR_CANNOT_CHANGE_TEMP_FILE_ROOT,
|
||||
DownloadErrors.ERROR_UNKNOWN_DOWNLOAD_REQUEST,
|
||||
DownloadErrors.ERROR_UNKNOWN_FILE_INFO,
|
||||
DownloadErrors.ERROR_MALFORMED_SERVICE_ANNOUNCEMENT_FILE,
|
||||
DownloadErrors.ERROR_MALFORMED_SERVICE_ANNOUNCEMENT,
|
||||
GroupCallErrors.ERROR_UNABLE_TO_START_SERVICE,
|
||||
GroupCallErrors.ERROR_DUPLICATE_START_GROUP_CALL,
|
||||
})
|
||||
|
||||
@@ -35,7 +35,7 @@ interface IMbmsDownloadService
|
||||
|
||||
int setTempFileRootDirectory(int subId, String rootDirectoryPath);
|
||||
|
||||
int addServiceAnnouncementFile(int subId, in byte[] fileContents);
|
||||
int addServiceAnnouncement(int subId, in byte[] contents);
|
||||
|
||||
int download(in DownloadRequest downloadRequest);
|
||||
|
||||
|
||||
@@ -217,23 +217,23 @@ public class MbmsDownloadServiceBase extends IMbmsDownloadService.Stub {
|
||||
|
||||
/**
|
||||
* Called when the client application wishes to receive file information according to a
|
||||
* service announcement file received from a group call server.
|
||||
* service announcement descriptor received from a group call server.
|
||||
*
|
||||
* The service announcement file is in the format of a multipart MIME file with XML parts,
|
||||
* though no validation is performed on the contents of the {@code fileContents} argument --
|
||||
* The service announcement descriptor is in the format of a multipart MIME file with XML parts,
|
||||
* though no validation is performed on the contents of the {@code contents} argument --
|
||||
* implementing middleware applications should perform their own validation and return
|
||||
* {@link MbmsErrors.DownloadErrors#ERROR_MALFORMED_SERVICE_ANNOUNCEMENT_FILE} if the file is
|
||||
* {@link MbmsErrors.DownloadErrors#ERROR_MALFORMED_SERVICE_ANNOUNCEMENT} if the descriptor is
|
||||
* malformed.
|
||||
*
|
||||
* @param subscriptionId The subscription id the service announcement applies to.
|
||||
* @param fileContents The contents of the service announcement file.
|
||||
* @param contents The contents of the service announcement descriptor.
|
||||
* @return {@link MbmsErrors#SUCCESS}, or
|
||||
* {@link MbmsErrors.DownloadErrors#ERROR_MALFORMED_SERVICE_ANNOUNCEMENT_FILE}
|
||||
* {@link MbmsErrors.DownloadErrors#ERROR_MALFORMED_SERVICE_ANNOUNCEMENT}
|
||||
*/
|
||||
// TODO: are there any public specifications of what the file format is that I can link to?
|
||||
@Override
|
||||
public @MbmsErrors.MbmsError int addServiceAnnouncementFile(
|
||||
int subscriptionId, @NonNull byte[] fileContents) {
|
||||
public @MbmsErrors.MbmsError int addServiceAnnouncement(
|
||||
int subscriptionId, @NonNull byte[] contents) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user