Merge "Rename addServiceAnnouncement-related methods" am: 6f68b4bf53

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1311925

Change-Id: I505ebfd17d8ae54b3e61b8fee45e531361953076
This commit is contained in:
Hall Liu
2020-06-12 23:03:12 +00:00
committed by Automerger Merge Worker
9 changed files with 41 additions and 41 deletions

View File

@@ -45344,14 +45344,14 @@ package android.telephony {
public class MbmsDownloadSession implements java.lang.AutoCloseable { 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 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 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 cancelDownload(@NonNull android.telephony.mbms.DownloadRequest);
method public void close(); 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 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 @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 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 @Nullable public java.io.File getTempFileRootDirectory();
method @NonNull public java.util.List<android.telephony.mbms.DownloadRequest> listPendingDownloads(); 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); 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 { public static class MbmsErrors.DownloadErrors {
field public static final int ERROR_CANNOT_CHANGE_TEMP_FILE_ROOT = 401; // 0x191 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_DOWNLOAD_REQUEST = 402; // 0x192
field public static final int ERROR_UNKNOWN_FILE_INFO = 403; // 0x193 field public static final int ERROR_UNKNOWN_FILE_INFO = 403; // 0x193
} }

View File

@@ -10321,7 +10321,7 @@ package android.telephony.mbms.vendor {
public class MbmsDownloadServiceBase extends android.os.Binder implements android.os.IInterface { public class MbmsDownloadServiceBase extends android.os.Binder implements android.os.IInterface {
ctor public MbmsDownloadServiceBase(); ctor public MbmsDownloadServiceBase();
method public int addProgressListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadProgressListener) throws android.os.RemoteException; 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 int addStatusListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadStatusListener) throws android.os.RemoteException;
method public android.os.IBinder asBinder(); method public android.os.IBinder asBinder();
method public int cancelDownload(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException; method public int cancelDownload(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;

View File

@@ -4099,7 +4099,7 @@ package android.telephony.mbms.vendor {
public class MbmsDownloadServiceBase extends android.os.Binder implements android.os.IInterface { public class MbmsDownloadServiceBase extends android.os.Binder implements android.os.IInterface {
ctor public MbmsDownloadServiceBase(); ctor public MbmsDownloadServiceBase();
method public int addProgressListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadProgressListener) throws android.os.RemoteException; 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 int addStatusListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadStatusListener) throws android.os.RemoteException;
method public android.os.IBinder asBinder(); method public android.os.IBinder asBinder();
method public int cancelDownload(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException; method public int cancelDownload(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;

View File

@@ -45200,14 +45200,14 @@ package android.telephony {
public class MbmsDownloadSession implements java.lang.AutoCloseable { 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 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 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 cancelDownload(@NonNull android.telephony.mbms.DownloadRequest);
method public void close(); 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 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 @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 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 @Nullable public java.io.File getTempFileRootDirectory();
method @NonNull public java.util.List<android.telephony.mbms.DownloadRequest> listPendingDownloads(); 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); 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 { public static class MbmsErrors.DownloadErrors {
field public static final int ERROR_CANNOT_CHANGE_TEMP_FILE_ROOT = 401; // 0x191 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_DOWNLOAD_REQUEST = 402; // 0x192
field public static final int ERROR_UNKNOWN_FILE_INFO = 403; // 0x193 field public static final int ERROR_UNKNOWN_FILE_INFO = 403; // 0x193
} }

View File

@@ -10219,7 +10219,7 @@ package android.telephony.mbms.vendor {
public class MbmsDownloadServiceBase extends android.os.Binder implements android.os.IInterface { public class MbmsDownloadServiceBase extends android.os.Binder implements android.os.IInterface {
ctor public MbmsDownloadServiceBase(); ctor public MbmsDownloadServiceBase();
method public int addProgressListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadProgressListener) throws android.os.RemoteException; 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 int addStatusListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadStatusListener) throws android.os.RemoteException;
method public android.os.IBinder asBinder(); method public android.os.IBinder asBinder();
method public int cancelDownload(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException; method public int cancelDownload(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;

View File

@@ -231,7 +231,7 @@ public class MbmsDownloadSession implements AutoCloseable {
private static final String DESTINATION_SANITY_CHECK_FILE_NAME = "destinationSanityCheckFile"; 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); 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 * Returns the maximum size of the service announcement descriptor that can be provided via
* {@link #addServiceAnnouncementFile} * {@link #addServiceAnnouncement}
* @return The maximum length of the byte array passed as an argument to * @return The maximum length of the byte array passed as an argument to
* {@link #addServiceAnnouncementFile}. * {@link #addServiceAnnouncement}.
*/ */
public static int getMaximumServiceAnnouncementFileSize() { public static int getMaximumServiceAnnouncementSize() {
return MAX_SERVICE_ANNOUNCEMENT_FILE_SIZE; return MAX_SERVICE_ANNOUNCEMENT_SIZE;
} }
private int bindAndInitialize() { 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 * Inform the middleware of a service announcement descriptor received from a group
* server. * communication server.
* *
* When participating in a group call via the {@link MbmsGroupCallSession} API, applications may * 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. * 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 * After supplying the service announcement descriptor received from the server to the
* this API, applications will receive information on the available files via * middleware via this API, applications will receive information on the available files via
* {@link MbmsDownloadSessionCallback#onFileServicesUpdated}, and the available files will be * {@link MbmsDownloadSessionCallback#onFileServicesUpdated}, and the available files will be
* downloadable via {@link MbmsDownloadSession#download} like other files published via * downloadable via {@link MbmsDownloadSession#download} like other files published via
* {@link MbmsDownloadSessionCallback#onFileServicesUpdated}. * {@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. * 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, * 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 * @param contents The contents of the service announcement descriptor received from the
* call server. If the size of this array is greater than the value of * group call server. If the size of this array is greater than the value of
* {@link #getMaximumServiceAnnouncementFileSize()}, an * {@link #getMaximumServiceAnnouncementSize()}, an
* {@link IllegalArgumentException} will be thrown. * {@link IllegalArgumentException} will be thrown.
*/ */
public void addServiceAnnouncementFile(@NonNull byte[] fileContents) { public void addServiceAnnouncement(@NonNull byte[] contents) {
IMbmsDownloadService downloadService = mService.get(); IMbmsDownloadService downloadService = mService.get();
if (downloadService == null) { if (downloadService == null) {
throw new IllegalStateException("Middleware not yet bound"); 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"); throw new IllegalArgumentException("File too large");
} }
try { try {
int returnCode = downloadService.addServiceAnnouncementFile( int returnCode = downloadService.addServiceAnnouncement(
mSubscriptionId, fileContents); mSubscriptionId, contents);
if (returnCode == MbmsErrors.UNKNOWN) { if (returnCode == MbmsErrors.UNKNOWN) {
// Unbind and throw an obvious error // Unbind and throw an obvious error
close(); close();

View File

@@ -144,11 +144,11 @@ public class MbmsErrors {
public static final int ERROR_UNKNOWN_FILE_INFO = 403; public static final int ERROR_UNKNOWN_FILE_INFO = 403;
/** /**
* Indicates that the service announcement file passed via * Indicates that the service announcement descriptor passed via
* {@link android.telephony.MbmsDownloadSession#addServiceAnnouncementFile(byte[])} * {@link android.telephony.MbmsDownloadSession#addServiceAnnouncement(byte[])}
* is malformed. * 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_CANNOT_CHANGE_TEMP_FILE_ROOT,
DownloadErrors.ERROR_UNKNOWN_DOWNLOAD_REQUEST, DownloadErrors.ERROR_UNKNOWN_DOWNLOAD_REQUEST,
DownloadErrors.ERROR_UNKNOWN_FILE_INFO, DownloadErrors.ERROR_UNKNOWN_FILE_INFO,
DownloadErrors.ERROR_MALFORMED_SERVICE_ANNOUNCEMENT_FILE, DownloadErrors.ERROR_MALFORMED_SERVICE_ANNOUNCEMENT,
GroupCallErrors.ERROR_UNABLE_TO_START_SERVICE, GroupCallErrors.ERROR_UNABLE_TO_START_SERVICE,
GroupCallErrors.ERROR_DUPLICATE_START_GROUP_CALL, GroupCallErrors.ERROR_DUPLICATE_START_GROUP_CALL,
}) })

View File

@@ -35,7 +35,7 @@ interface IMbmsDownloadService
int setTempFileRootDirectory(int subId, String rootDirectoryPath); 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); int download(in DownloadRequest downloadRequest);

View File

@@ -217,23 +217,23 @@ public class MbmsDownloadServiceBase extends IMbmsDownloadService.Stub {
/** /**
* Called when the client application wishes to receive file information according to a * 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, * 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 fileContents} argument -- * though no validation is performed on the contents of the {@code contents} argument --
* implementing middleware applications should perform their own validation and return * 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. * malformed.
* *
* @param subscriptionId The subscription id the service announcement applies to. * @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 * @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? // TODO: are there any public specifications of what the file format is that I can link to?
@Override @Override
public @MbmsErrors.MbmsError int addServiceAnnouncementFile( public @MbmsErrors.MbmsError int addServiceAnnouncement(
int subscriptionId, @NonNull byte[] fileContents) { int subscriptionId, @NonNull byte[] contents) {
return 0; return 0;
} }