Rename addServiceAnnouncement-related methods

Address feedback on the API

Fixes: 155926142
Test: CTS
Change-Id: I69e17faf4d09ab686fdd97975bc7f069597b87b3
diff --git a/telephony/api/system-current.txt b/telephony/api/system-current.txt
index f4e2f14..4b425bd 100644
--- a/telephony/api/system-current.txt
+++ b/telephony/api/system-current.txt
@@ -1937,7 +1937,7 @@
   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;
diff --git a/telephony/java/android/telephony/MbmsDownloadSession.java b/telephony/java/android/telephony/MbmsDownloadSession.java
index 3d96fc6..7b8d591 100644
--- a/telephony/java/android/telephony/MbmsDownloadSession.java
+++ b/telephony/java/android/telephony/MbmsDownloadSession.java
@@ -231,7 +231,7 @@
 
     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 @@
     }
 
     /**
-     * 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 @@
     }
 
     /**
-     * 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 @@
      * 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();
diff --git a/telephony/java/android/telephony/mbms/MbmsErrors.java b/telephony/java/android/telephony/mbms/MbmsErrors.java
index 8611d26b..40f3ae8 100644
--- a/telephony/java/android/telephony/mbms/MbmsErrors.java
+++ b/telephony/java/android/telephony/mbms/MbmsErrors.java
@@ -144,11 +144,11 @@
         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 @@
             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,
     })
diff --git a/telephony/java/android/telephony/mbms/vendor/IMbmsDownloadService.aidl b/telephony/java/android/telephony/mbms/vendor/IMbmsDownloadService.aidl
index 36136ab..04efd53 100755
--- a/telephony/java/android/telephony/mbms/vendor/IMbmsDownloadService.aidl
+++ b/telephony/java/android/telephony/mbms/vendor/IMbmsDownloadService.aidl
@@ -35,7 +35,7 @@
 
     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);
 
diff --git a/telephony/java/android/telephony/mbms/vendor/MbmsDownloadServiceBase.java b/telephony/java/android/telephony/mbms/vendor/MbmsDownloadServiceBase.java
index 3279ce6..1302d11 100644
--- a/telephony/java/android/telephony/mbms/vendor/MbmsDownloadServiceBase.java
+++ b/telephony/java/android/telephony/mbms/vendor/MbmsDownloadServiceBase.java
@@ -217,23 +217,23 @@
 
     /**
      * 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;
     }