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.telephony.MbmsDownloadSession; 20 21 import java.util.List; 22 23 /** 24 * A callback class that apps should use to receive information on file downloads over 25 * cell-broadcast. 26 * @hide 27 */ 28 public class MbmsDownloadSessionCallback { 29 30 /** 31 * Indicates that the middleware has encountered an asynchronous error. 32 * @param errorCode Any error code listed in {@link MbmsErrors} 33 * @param message A message, intended for debugging purposes, describing the error in further 34 * detail. 35 */ 36 public void onError(int errorCode, String message) { 37 // default implementation empty 38 } 39 40 /** 41 * Called to indicate published File Services have changed. 42 * 43 * This will only be called after the application has requested a list of file services and 44 * specified a service class list of interest via 45 * {@link MbmsDownloadSession#requestUpdateFileServices(List)}. If there are subsequent calls to 46 * {@link MbmsDownloadSession#requestUpdateFileServices(List)}, 47 * this method may not be called again if 48 * the list of service classes would remain the same. 49 * 50 * @param services The most recently updated list of available file services. 51 */ 52 public void onFileServicesUpdated(List<FileServiceInfo> services) { 53 // default implementation empty 54 } 55 56 /** 57 * Called to indicate that the middleware has been initialized and is ready. 58 * 59 * Before this method is called, calling any method on an instance of 60 * {@link MbmsDownloadSession} will result in an {@link IllegalStateException} 61 * being thrown or {@link #onError(int, String)} being called with error code 62 * {@link MbmsErrors.GeneralErrors#ERROR_MIDDLEWARE_NOT_YET_READY} 63 */ 64 public void onMiddlewareReady() { 65 // default implementation empty 66 } 67 } 68