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 com.android.ims.internal.uce.uceservice; 18 19 import com.android.ims.internal.uce.uceservice.IUceListener; 20 import com.android.ims.internal.uce.presence.IPresenceService; 21 import com.android.ims.internal.uce.options.IOptionsListener; 22 import com.android.ims.internal.uce.presence.IPresenceListener; 23 import com.android.ims.internal.uce.options.IOptionsService; 24 import com.android.ims.internal.uce.common.UceLong; 25 import com.android.ims.internal.uce.common.StatusCode; 26 27 /** IUceService 28 * UCE service interface class. 29 * {@hide} */ 30 interface IUceService 31 { 32 33 /** 34 * Starts the Uce service. 35 * @param uceListener IUceListener object 36 * @return boolean true if the service stop start is processed successfully, FALSE otherwise. 37 * 38 * Service status is returned in setStatus callback in IUceListener. 39 * @hide 40 */ 41 @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) startService(IUceListener uceListener)42 boolean startService(IUceListener uceListener); 43 44 /** 45 * Stops the UCE service. 46 * @return boolean true if the service stop request is processed successfully, FALSE otherwise. 47 * @hide 48 */ 49 @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) stopService()50 boolean stopService(); 51 52 53 54 /** 55 * Requests the UCE service start status. 56 * @return boolean true if service started else false. 57 * @hide 58 */ 59 @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) isServiceStarted()60 boolean isServiceStarted(); 61 62 /** 63 * Creates a options service for Capability Discovery. 64 * @param optionsListener IOptionsListener object. 65 * @param optionsServiceListenerHdl wrapper for client's listener handle to be stored. 66 * 67 * The service will fill UceLong.mUceLong with presenceListenerHandle allocated and 68 * used to validate callbacks received in IPresenceListener are indeed from the 69 * service the client created. 70 * 71 * @return optionsServiceHandle 72 * 73 * @hide 74 * 75 * @deprecated This is replaced with new API createOptionsServiceForSubscription() 76 */ 77 @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) createOptionsService(IOptionsListener optionsListener, inout UceLong optionsServiceListenerHdl)78 int createOptionsService(IOptionsListener optionsListener, 79 inout UceLong optionsServiceListenerHdl); 80 /** 81 * Creates a options service for Capability Discovery. 82 * @param optionsListener IOptionsListener object. 83 * @param optionsServiceListenerHdl wrapper for client's listener handle to be stored. 84 * @param iccId the ICC-ID derived from SubscriptionInfo for the Service requested 85 * 86 * The service will fill UceLong.mUceLong with presenceListenerHandle allocated and 87 * used to validate callbacks received in IPresenceListener are indeed from the 88 * service the client created. 89 * 90 * @return optionsServiceHandle 91 * 92 * @hide 93 */ createOptionsServiceForSubscription(IOptionsListener optionsListener, inout UceLong optionsServiceListenerHdl, in String iccId)94 int createOptionsServiceForSubscription(IOptionsListener optionsListener, 95 inout UceLong optionsServiceListenerHdl, 96 in String iccId); 97 98 /** 99 * Destroys a Options service. 100 * @param optionsServiceHandle this is received in serviceCreated() callback 101 * in IOptionsListener 102 * @hide 103 */ 104 @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) destroyOptionsService(int optionsServiceHandle)105 void destroyOptionsService(int optionsServiceHandle); 106 107 /** 108 * Creates a presence service. 109 * @param presenceServiceListener IPresenceListener object 110 * @param presenceServiceListenerHdl wrapper for client's listener handle to be stored. 111 * 112 * The service will fill UceLong.mUceLong with presenceListenerHandle allocated and 113 * used to validate callbacks received in IPresenceListener are indeed from the 114 * service the client created. 115 * 116 * @return presenceServiceHdl 117 * 118 * @hide 119 * 120 * @deprecated This is replaced with new API createPresenceServiceForSubscription() 121 */ 122 @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) createPresenceService(IPresenceListener presenceServiceListener, inout UceLong presenceServiceListenerHdl)123 int createPresenceService(IPresenceListener presenceServiceListener, 124 inout UceLong presenceServiceListenerHdl); 125 /** 126 * Creates a presence service. 127 * @param presenceServiceListener IPresenceListener object 128 * @param presenceServiceListenerHdl wrapper for client's listener handle to be stored. 129 * @param iccId the ICC-ID derived from SubscriptionInfo for the Service requested 130 * 131 * The service will fill UceLong.mUceLong with presenceListenerHandle allocated and 132 * used to validate callbacks received in IPresenceListener are indeed from the 133 * service the client created. 134 * 135 * @return presenceServiceHdl 136 * 137 * @hide 138 */ createPresenceServiceForSubscription(IPresenceListener presenceServiceListener, inout UceLong presenceServiceListenerHdl, in String iccId)139 int createPresenceServiceForSubscription(IPresenceListener presenceServiceListener, 140 inout UceLong presenceServiceListenerHdl, 141 in String iccId); 142 143 /** 144 * Destroys a presence service. 145 * 146 * @param presenceServiceHdl handle returned during createPresenceService() 147 * 148 * @hide 149 */ 150 @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) destroyPresenceService(int presenceServiceHdl)151 void destroyPresenceService(int presenceServiceHdl); 152 153 154 155 /** 156 * Query the UCE Service for information to know whether the is registered. 157 * 158 * @return boolean, true if Registered to for network events else false. 159 * 160 * @hide 161 */ 162 @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) getServiceStatus()163 boolean getServiceStatus(); 164 165 /** 166 * Query the UCE Service for presence Service. 167 * 168 * @return IPresenceService object. 169 * 170 * @hide 171 * 172 * @deprecated use API getPresenceServiceForSubscription() 173 */ 174 @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) getPresenceService()175 IPresenceService getPresenceService(); 176 177 /** 178 * Query the UCE Service for presence Service. 179 * 180 * @param iccId the ICC-ID derived from SubscriptionInfo for the Service requested 181 * 182 * @return IPresenceService object. 183 * 184 * @hide 185 */ getPresenceServiceForSubscription(in String iccId)186 IPresenceService getPresenceServiceForSubscription(in String iccId); 187 188 /** 189 * Query the UCE Service for options service object. 190 * 191 * @return IOptionsService object. 192 * 193 * @deprecated use API getOptionsServiceForSubscription() 194 * 195 * @hide 196 */ 197 @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) getOptionsService()198 IOptionsService getOptionsService(); 199 200 /** 201 * Query the UCE Service for options service object. 202 * 203 * @param iccId the ICC-ID derived from SubscriptionInfo for the Service requested 204 * 205 * @return IOptionsService object. 206 * 207 * @hide 208 */ getOptionsServiceForSubscription(in String iccId)209 IOptionsService getOptionsServiceForSubscription(in String iccId); 210 211 } 212