OSDN Git Service

Make EMBMS adjustments for 08/04
[android-x86/frameworks-base.git] / telephony / java / android / telephony / mbms / DownloadStateCallback.java
1 /*
2  * Copyright (C) 2016 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.os.RemoteException;
20 import android.telephony.MbmsDownloadManager;
21
22 /**
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)}
26  *
27  * This is optionally specified when requesting a download and will only be called while the app
28  * is running.
29  * @hide
30  */
31 public class DownloadStateCallback extends IDownloadStateCallback.Stub {
32
33     /**
34      * Called when the middleware wants to report progress for a file in a {@link DownloadRequest}.
35      *
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
43      *   progress.
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.
46      */
47     @Override
48     public void progress(DownloadRequest request, FileInfo fileInfo,
49             int currentDownloadSize, int fullDownloadSize,
50             int currentDecodedSize, int fullDecodedSize) throws RemoteException {
51     }
52
53     /**
54      * Gives download state callbacks for a file in a {@link DownloadRequest}.
55      *
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.
61      */
62     @Override
63     public void state(DownloadRequest request, FileInfo fileInfo,
64             @MbmsDownloadManager.DownloadStatus int state) {
65     }
66 }