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.presence;
18 
19 import com.android.ims.internal.uce.presence.IPresenceListener;
20 import com.android.ims.internal.uce.presence.PresCapInfo;
21 import com.android.ims.internal.uce.presence.PresServiceInfo;
22 import com.android.ims.internal.uce.common.UceLong;
23 import com.android.ims.internal.uce.common.StatusCode;
24 
25 /** IPresenceService
26 {@hide} */
27 interface IPresenceService
28 {
29 
30     /**
31      * Gets the version of the Presence service implementation.
32      * The verion information is received in getVersionCb callback.
33      * @param presenceServiceHdl returned in createPresenceService().
34      * @return StatusCode, status of the request placed.
35      */
36     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
getVersion(int presenceServiceHdl)37     StatusCode getVersion(int presenceServiceHdl);
38 
39     /**
40      * Adds a listener to the Presence service.
41      * @param presenceServiceHdl returned in createPresenceService().
42      * @param presenceServiceListener IPresenceListener Object.
43      * @param presenceServiceListenerHdl wrapper for client's listener handle to be stored.
44      *
45      * The service will fill UceLong.mUceLong with presenceListenerHandle.
46      *
47      * @return StatusCode, status of the request placed
48      */
49     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
addListener(int presenceServiceHdl, IPresenceListener presenceServiceListener, inout UceLong presenceServiceListenerHdl)50     StatusCode addListener(int presenceServiceHdl, IPresenceListener presenceServiceListener,
51                            inout UceLong presenceServiceListenerHdl);
52 
53     /**
54      * Removes a listener from the Presence service.
55      * @param presenceServiceHdl returned in createPresenceService().
56      * @param presenceServiceListenerHdl provided in createPresenceService() or Addlistener().
57      * @return StatusCode, status of the request placed.
58      */
59     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
removeListener(int presenceServiceHdl, in UceLong presenceServiceListenerHdl)60     StatusCode removeListener(int presenceServiceHdl, in UceLong presenceServiceListenerHdl);
61 
62     /**
63      * Re-enables the Presence service if it is in the Blocked state due to receiving a SIP
64      * response 489 Bad event.
65      * The application must call this API before calling any presence API after receiving a SIP
66      * response 489 Bad event.
67      * The status of this request is notified in cmdStatus callback.
68      *
69      * @param presenceServiceHdl returned in createPresenceService().
70      * @param userData, userData provided by client to identify the request/API call, it
71      *                  is returned in the cmdStatus() callback for client to match response
72      *                  with original request.
73      * @return StatusCode, status of the request placed.
74      */
75     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
reenableService(int presenceServiceHdl, int userData)76     StatusCode reenableService(int presenceServiceHdl, int userData);
77 
78     /**
79      * Sends a request to publish current device capabilities.
80      * The network response is notifed in sipResponseReceived() callback.
81      * @param presenceServiceHdl returned in createPresenceService().
82      * @param myCapInfo PresCapInfo object.
83      * @param userData, userData provided by client to identify the request/API call, it
84      *                  is returned in the cmdStatus() callback for client to match response
85      *                  with original request.
86      * @return StatusCode, status of the request placed.
87      */
88     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
publishMyCap(int presenceServiceHdl, in PresCapInfo myCapInfo , int userData)89     StatusCode publishMyCap(int presenceServiceHdl, in PresCapInfo myCapInfo , int userData);
90 
91     /**
92      * Retrieves the capability information for a single contact. Clients receive the requested
93      * information via the listener callback function capInfoReceived() callback.
94      *
95      * @param presenceServiceHdl returned in createPresenceService().
96      * @param remoteUri remote contact URI
97      * @param userData, userData provided by client to identify the request/API call, it
98      *                  is returned in the cmdStatus() callback for client to match response
99      *                  with original request.
100      * @return StatusCode, status of the request placed.
101      */
102     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
getContactCap(int presenceServiceHdl , String remoteUri, int userData)103     StatusCode getContactCap(int presenceServiceHdl , String remoteUri, int userData);
104 
105     /**
106      * Retrieves the capability information for a list of contacts. Clients receive the requested
107      * information via the listener callback function listCapInfoReceived() callback.
108      *
109      * @param presenceServiceHdl returned in createPresenceService().
110      * @param remoteUriList list of remote contact URI's.
111      * @param userData, userData provided by client to identify the request/API call, it
112      *                  is returned in the cmdStatus() callback for client to match response
113      *                  with original request.
114      * @return StatusCode, status of the request placed.
115      */
116     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
getContactListCap(int presenceServiceHdl, in String[] remoteUriList, int userData)117     StatusCode getContactListCap(int presenceServiceHdl, in String[] remoteUriList, int userData);
118 
119     /**
120      * Sets the mapping between a new feature tag and the corresponding service tuple information
121      * to be included in the published document.
122      * The staus of this call is received in cmdStatus callback.
123      *
124      * @param presenceServiceHdl returned in createPresenceService().
125      * @param featureTag to be supported
126      * @param PresServiceInfo service information describing the featureTag.
127      * @param userData, userData provided by client to identify the request/API call, it
128      *                  is returned in the cmdStatus() callback for client to match response
129      *                  with original request.
130      * @return StatusCode, status of the request placed.
131      */
132     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
setNewFeatureTag(int presenceServiceHdl, String featureTag, in PresServiceInfo serviceInfo, int userData)133     StatusCode  setNewFeatureTag(int presenceServiceHdl, String featureTag,
134                                  in PresServiceInfo serviceInfo, int userData);
135 
136 }
137