• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2019, The Android Open Source Project
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *     - Redistributions of source code must retain the above copyright
8  *       notice, this list of conditions and the following disclaimer.
9  *     - Redistributions in binary form must reproduce the above copyright
10  *       notice, this list of conditions and the following disclaimer in the
11  *       documentation and/or other materials provided with the distribution.
12  *     - Neither the name of The Android Open Source Project nor the names of its contributors may
13  *       be used to endorse or promote products derived from this software
14  *       without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MOTOROLA MOBILITY LLC BE LIABLE
20  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
26  * DAMAGE.
27  */
28 
29 package com.android.service.ims.presence;
30 
31 import android.telephony.ims.RcsContactUceCapability;
32 
33 import java.util.List;
34 
35 public interface ContactCapabilityResponse {
36 
37     /**
38      * Called when a capability request returns a "200 OK" (means capable) or "404 xxxx" for SIP
39      * request of single contact number (means not capable).
40      *
41      * @param reqId the request ID which is returned by requestCapability or
42      * requestAvailability
43      */
onSuccess(int reqId)44     void onSuccess(int reqId);
45 
46     /**
47      * Called when a local error is generated a SIP error is generated from the network.
48      *
49      * @param reqId the request ID which is returned by requestCapability or
50      * requestAvailability
51      * @param resultCode the result code which is defined in RcsManager.ResultCode.
52      */
onError(int reqId, int resultCode)53     void onError(int reqId, int resultCode);
54 
55     /**
56      * Called when the request returns a "terminated notify" indication from the network.
57      * The presence service will not receive any more notifications for the request after this
58      * indication is received.
59      *
60      * @param reqId the request ID which is returned by requestCapability or
61      * requestAvailability
62      */
onFinish(int reqId)63     void onFinish(int reqId);
64 
65     /**
66      * Called when there is a timeout waiting for the "terminated notify" indication from the
67      * network.
68      *
69      * @param reqId the request ID which is returned by requestCapability or
70      * requestAvailability.
71      */
onTimeout(int reqId)72     void onTimeout(int reqId);
73 
74     /**
75      * Called when there is an update to the capabilities from the network. On error, the
76      * capabilities will also be updates as not capable.
77      */
onCapabilitiesUpdated(int reqId, List<RcsContactUceCapability> contactCapabilities, boolean updateLastTimestamp)78     void onCapabilitiesUpdated(int reqId, List<RcsContactUceCapability> contactCapabilities,
79             boolean updateLastTimestamp);
80 }
81