1 /* 2 * Copyright (C) 2017 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.MbmsStreamingSession; 20 21 /** @hide */ 22 public class MbmsErrors { 23 /** Indicates that the operation was successful. */ 24 public static final int SUCCESS = 0; 25 26 // Following errors are generated in the manager and should not be returned from the 27 // middleware 28 /** 29 * Indicates that either no MBMS middleware app is installed on the device or multiple 30 * middleware apps are installed on the device. 31 */ 32 public static final int ERROR_NO_UNIQUE_MIDDLEWARE = 1; 33 34 /** 35 * Indicates that the app attempted to perform an operation on an instance of 36 * {@link android.telephony.MbmsDownloadSession} or 37 * {@link MbmsStreamingSession} without being bound to the middleware. 38 */ 39 public static final int ERROR_MIDDLEWARE_NOT_BOUND = 2; 40 41 /** Indicates that the middleware has died and the requested operation was not completed.*/ 42 public static final int ERROR_MIDDLEWARE_LOST = 3; 43 44 /** 45 * Indicates errors that may be generated during initialization by the 46 * middleware. They are applicable to both streaming and file-download use-cases. 47 */ 48 public static class InitializationErrors { 49 private InitializationErrors() {} 50 /** 51 * Indicates that the app tried to create more than one instance each of 52 * {@link MbmsStreamingSession} or {@link android.telephony.MbmsDownloadSession}. 53 */ 54 public static final int ERROR_DUPLICATE_INITIALIZE = 101; 55 /** Indicates that the app is not authorized to access media via MBMS.*/ 56 public static final int ERROR_APP_PERMISSIONS_NOT_GRANTED = 102; 57 /** Indicates that the middleware was unable to initialize for this app. */ 58 public static final int ERROR_UNABLE_TO_INITIALIZE = 103; 59 } 60 61 /** 62 * Indicates the errors that may occur at any point and are applicable to both 63 * streaming and file-download. 64 */ 65 public static class GeneralErrors { 66 private GeneralErrors() {} 67 /** 68 * Indicates that the app attempted to perform an operation before receiving notification 69 * that the middleware is ready via {@link MbmsStreamingSessionCallback#onMiddlewareReady()} 70 * or {@link MbmsDownloadSessionCallback#onMiddlewareReady()}. 71 */ 72 public static final int ERROR_MIDDLEWARE_NOT_YET_READY = 201; 73 /** 74 * Indicates that the middleware ran out of memory and was unable to complete the requested 75 * operation. 76 */ 77 public static final int ERROR_OUT_OF_MEMORY = 202; 78 /** 79 * Indicates that the requested operation failed due to the middleware being unavailable due 80 * to a transient condition. The app may retry the operation at a later time. 81 */ 82 public static final int ERROR_MIDDLEWARE_TEMPORARILY_UNAVAILABLE = 203; 83 /** 84 * Indicates that the requested operation was not performed due to being in emergency 85 * callback mode. 86 */ 87 public static final int ERROR_IN_E911 = 204; 88 /** Indicates that MBMS is not available due to the device being in roaming. */ 89 public static final int ERROR_NOT_CONNECTED_TO_HOME_CARRIER_LTE = 205; 90 /** Indicates that MBMS is not available due to a SIM read error. */ 91 public static final int ERROR_UNABLE_TO_READ_SIM = 206; 92 /** 93 * Indicates that MBMS is not available due to the inserted SIM being from an unsupported 94 * carrier. 95 */ 96 public static final int ERROR_CARRIER_CHANGE_NOT_ALLOWED = 207; 97 } 98 99 /** 100 * Indicates the errors that are applicable only to the streaming use-case 101 */ 102 public static class StreamingErrors { 103 private StreamingErrors() {} 104 /** Indicates that the middleware cannot start a stream due to too many ongoing streams */ 105 public static final int ERROR_CONCURRENT_SERVICE_LIMIT_REACHED = 301; 106 107 /** Indicates that the middleware was unable to start the streaming service */ 108 public static final int ERROR_UNABLE_TO_START_SERVICE = 302; 109 110 /** 111 * Indicates that the app called 112 * {@link MbmsStreamingSession#startStreaming( 113 * StreamingServiceInfo, StreamingServiceCallback, android.os.Handler)} 114 * more than once for the same {@link StreamingServiceInfo}. 115 */ 116 public static final int ERROR_DUPLICATE_START_STREAM = 303; 117 } 118 119 /** 120 * Indicates the errors that are applicable only to the file-download use-case 121 */ 122 public static class DownloadErrors { 123 private DownloadErrors() { } 124 /** 125 * Indicates that the app is not allowed to change the temp file root at this time due to 126 * outstanding download requests. 127 */ 128 public static final int ERROR_CANNOT_CHANGE_TEMP_FILE_ROOT = 401; 129 130 /** Indicates that the middleware has no record of the supplied {@link DownloadRequest}. */ 131 public static final int ERROR_UNKNOWN_DOWNLOAD_REQUEST = 402; 132 } 133 134 private MbmsErrors() {} 135 } 136