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