2 * Copyright (C) 2016 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package android.telephony.mbms;
19 import android.os.RemoteException;
20 import android.telephony.MbmsDownloadManager;
23 * A optional listener class used by download clients to track progress. Apps should extend this
24 * class and pass an instance into
25 * {@link android.telephony.MbmsDownloadManager#download(DownloadRequest, DownloadStateCallback)}
27 * This is optionally specified when requesting a download and will only be called while the app
31 public class DownloadStateCallback extends IDownloadStateCallback.Stub {
34 * Called when the middleware wants to report progress for a file in a {@link DownloadRequest}.
36 * @param request a {@link DownloadRequest}, indicating which download is being referenced.
37 * @param fileInfo a {@link FileInfo} specifying the file to report progress on. Note that
38 * the request may result in many files being downloaded and the client
39 * may not have been able to get a list of them in advance.
40 * @param currentDownloadSize is the current amount downloaded.
41 * @param fullDownloadSize is the total number of bytes that make up the downloaded content.
42 * This may be different from the decoded final size, but is useful in gauging download
44 * @param currentDecodedSize is the number of bytes that have been decoded.
45 * @param fullDecodedSize is the total number of bytes that make up the final decoded content.
48 public void progress(DownloadRequest request, FileInfo fileInfo,
49 int currentDownloadSize, int fullDownloadSize,
50 int currentDecodedSize, int fullDecodedSize) throws RemoteException {
54 * Gives download state callbacks for a file in a {@link DownloadRequest}.
56 * @param request a {@link DownloadRequest}, indicating which download is being referenced.
57 * @param fileInfo a {@link FileInfo} specifying the file to report progress on. Note that
58 * the request may result in many files being downloaded and the client
59 * may not have been able to get a list of them in advance.
60 * @param state The current state of the download.
63 public void state(DownloadRequest request, FileInfo fileInfo,
64 @MbmsDownloadManager.DownloadStatus int state) {