1 /*
2  * Copyright (C) 2018 The Android Open Source Project
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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
15  */
16 
17 package android.telephony.mbms;
18 
19 import android.telephony.MbmsDownloadSession;
20 
21 /**
22  * A optional listener class used by download clients to track progress. Apps should extend this
23  * class and pass an instance into
24  * {@link MbmsDownloadSession#download(DownloadRequest)}
25  *
26  * This is optionally specified when requesting a download and will only be called while the app
27  * is running.
28  */
29 public class DownloadProgressListener {
30     /**
31      * Called when the middleware wants to report progress for a file in a {@link DownloadRequest}.
32      *
33      * @param request a {@link DownloadRequest}, indicating which download is being referenced.
34      * @param fileInfo a {@link FileInfo} specifying the file to report progress on.  Note that
35      *   the request may result in many files being downloaded and the client
36      *   may not have been able to get a list of them in advance.
37      * @param currentDownloadSize is the current amount downloaded.
38      * @param fullDownloadSize is the total number of bytes that make up the downloaded content.
39      *   This may be different from the decoded final size, but is useful in gauging download
40      *   progress.
41      * @param currentDecodedSize is the number of bytes that have been decoded.
42      * @param fullDecodedSize is the total number of bytes that make up the final decoded content.
43      */
onProgressUpdated(DownloadRequest request, FileInfo fileInfo, int currentDownloadSize, int fullDownloadSize, int currentDecodedSize, int fullDecodedSize)44     public void onProgressUpdated(DownloadRequest request, FileInfo fileInfo,
45             int currentDownloadSize, int fullDownloadSize,
46             int currentDecodedSize, int fullDecodedSize) {
47     }
48 }
49