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.annotation.IntDef; 20 import android.telephony.MbmsDownloadSession; 21 22 import java.lang.annotation.Retention; 23 import java.lang.annotation.RetentionPolicy; 24 25 /** 26 * A optional listener class used by download clients to track progress. Apps should extend this 27 * class and pass an instance into 28 * {@link MbmsDownloadSession#download(DownloadRequest)} 29 * 30 * This is optionally specified when requesting a download and will only be called while the app 31 * is running. 32 */ 33 public class DownloadStatusListener { 34 /** 35 * Gives download status callbacks for a file in a {@link DownloadRequest}. 36 * 37 * @param request a {@link DownloadRequest}, indicating which download is being referenced. 38 * @param fileInfo a {@link FileInfo} specifying the file to report progress on. Note that 39 * the request may result in many files being downloaded and the client 40 * may not have been able to get a list of them in advance. 41 * @param status The current status of the download. 42 */ onStatusUpdated(DownloadRequest request, FileInfo fileInfo, @MbmsDownloadSession.DownloadStatus int status)43 public void onStatusUpdated(DownloadRequest request, FileInfo fileInfo, 44 @MbmsDownloadSession.DownloadStatus int status) { 45 } 46 } 47