Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be305be0 authored by Hall Liu's avatar Hall Liu Committed by android-build-merger
Browse files

Merge "Rename MbmsDownloadSession#getDownloadStatus"

am: a07d895f

Change-Id: I1b6b063920de4de085f583d05876e246f1f65686
parents e09ba38a a07d895f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -40394,10 +40394,10 @@ package android.telephony {
    method public static android.telephony.MbmsDownloadSession create(android.content.Context, android.telephony.mbms.MbmsDownloadSessionCallback, android.os.Handler);
    method public static android.telephony.MbmsDownloadSession create(android.content.Context, android.telephony.mbms.MbmsDownloadSessionCallback, int, android.os.Handler);
    method public int download(android.telephony.mbms.DownloadRequest);
    method public int getDownloadStatus(android.telephony.mbms.DownloadRequest, android.telephony.mbms.FileInfo);
    method public java.io.File getTempFileRootDirectory();
    method public java.util.List<android.telephony.mbms.DownloadRequest> listPendingDownloads();
    method public int registerStateCallback(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadStateCallback, android.os.Handler);
    method public void requestDownloadState(android.telephony.mbms.DownloadRequest, android.telephony.mbms.FileInfo);
    method public void requestUpdateFileServices(java.util.List<java.lang.String>);
    method public void resetDownloadKnowledge(android.telephony.mbms.DownloadRequest);
    method public void setTempFileRootDirectory(java.io.File);
@@ -41280,6 +41280,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_UNKNOWN_DOWNLOAD_REQUEST = 402; // 0x192
    field public static final int ERROR_UNKNOWN_FILE_INFO = 403; // 0x193
  }
  public static class MbmsErrors.GeneralErrors {
+1 −1
Original line number Diff line number Diff line
@@ -4379,11 +4379,11 @@ package android.telephony.mbms.vendor {
    method public int cancelDownload(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
    method public void dispose(int) throws android.os.RemoteException;
    method public int download(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
    method public int getDownloadStatus(android.telephony.mbms.DownloadRequest, android.telephony.mbms.FileInfo) throws android.os.RemoteException;
    method public int initialize(int, android.telephony.mbms.MbmsDownloadSessionCallback) throws android.os.RemoteException;
    method public java.util.List<android.telephony.mbms.DownloadRequest> listPendingDownloads(int) throws android.os.RemoteException;
    method public void onAppCallbackDied(int, int);
    method public int registerStateCallback(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadStateCallback) throws android.os.RemoteException;
    method public int requestDownloadState(android.telephony.mbms.DownloadRequest, android.telephony.mbms.FileInfo) throws android.os.RemoteException;
    method public int requestUpdateFileServices(int, java.util.List<java.lang.String>) throws android.os.RemoteException;
    method public int resetDownloadKnowledge(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
    method public int setTempFileRootDirectory(int, java.lang.String) throws android.os.RemoteException;
+1 −1
Original line number Diff line number Diff line
@@ -495,11 +495,11 @@ package android.telephony.mbms.vendor {
    method public int cancelDownload(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
    method public void dispose(int) throws android.os.RemoteException;
    method public int download(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
    method public int getDownloadStatus(android.telephony.mbms.DownloadRequest, android.telephony.mbms.FileInfo) throws android.os.RemoteException;
    method public int initialize(int, android.telephony.mbms.MbmsDownloadSessionCallback) throws android.os.RemoteException;
    method public java.util.List<android.telephony.mbms.DownloadRequest> listPendingDownloads(int) throws android.os.RemoteException;
    method public void onAppCallbackDied(int, int);
    method public int registerStateCallback(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadStateCallback) throws android.os.RemoteException;
    method public int requestDownloadState(android.telephony.mbms.DownloadRequest, android.telephony.mbms.FileInfo) throws android.os.RemoteException;
    method public int requestUpdateFileServices(int, java.util.List<java.lang.String>) throws android.os.RemoteException;
    method public int resetDownloadKnowledge(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
    method public int setTempFileRootDirectory(int, java.lang.String) throws android.os.RemoteException;
+20 −8
Original line number Diff line number Diff line
@@ -686,30 +686,42 @@ public class MbmsDownloadSession implements AutoCloseable {
    }

    /**
     * Gets information about the status of a file pending download.
     * Requests information about the state of a file pending download.
     *
     * If there was a problem communicating with the middleware or if it has no records of the
     * The state will be delivered as a callback via
     * {@link DownloadStateCallback#onStateUpdated(DownloadRequest, FileInfo, int)}. If no such
     * callback has been registered via
     * {@link #registerStateCallback(DownloadRequest, DownloadStateCallback, Handler)}, this
     * method will be a no-op.
     *
     * If the middleware has no record of the
     * file indicated by {@code fileInfo} being associated with {@code downloadRequest},
     * {@link #STATUS_UNKNOWN} will be returned.
     * an {@link IllegalArgumentException} will be thrown.
     *
     * @param downloadRequest The download request to query.
     * @param fileInfo The particular file within the request to get information on.
     * @return The status of the download.
     */
    @DownloadStatus
    public int getDownloadStatus(DownloadRequest downloadRequest, FileInfo fileInfo) {
    public void requestDownloadState(DownloadRequest downloadRequest, FileInfo fileInfo) {
        IMbmsDownloadService downloadService = mService.get();
        if (downloadService == null) {
            throw new IllegalStateException("Middleware not yet bound");
        }

        try {
            return downloadService.getDownloadStatus(downloadRequest, fileInfo);
            int result = downloadService.requestDownloadState(downloadRequest, fileInfo);
            if (result != MbmsErrors.SUCCESS) {
                if (result == MbmsErrors.DownloadErrors.ERROR_UNKNOWN_DOWNLOAD_REQUEST) {
                    throw new IllegalArgumentException("Unknown download request.");
                }
                if (result == MbmsErrors.DownloadErrors.ERROR_UNKNOWN_FILE_INFO) {
                    throw new IllegalArgumentException("Unknown file.");
                }
                sendErrorToApp(result, null);
            }
        } catch (RemoteException e) {
            mService.set(null);
            sIsInitialized.set(false);
            sendErrorToApp(MbmsErrors.ERROR_MIDDLEWARE_LOST, null);
            return STATUS_UNKNOWN;
        }
    }

+3 −0
Original line number Diff line number Diff line
@@ -128,6 +128,9 @@ public class MbmsErrors {

        /** Indicates that the middleware has no record of the supplied {@link DownloadRequest}. */
        public static final int ERROR_UNKNOWN_DOWNLOAD_REQUEST = 402;

        /** Indicates the the middleware has no record of the supplied {@link FileInfo} */
        public static final int ERROR_UNKNOWN_FILE_INFO = 403;
    }

    private MbmsErrors() {}
Loading