2 * Copyright (c) 2015, Motorola Mobility LLC
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 Motorola Mobility nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
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
29 package com.android.service.ims;
32 import java.util.HashMap;
33 import java.util.List;
34 import java.util.ArrayList;
35 import android.os.RemoteException;
37 import com.android.ims.internal.Logger;
38 import com.android.ims.IRcsPresenceListener;
47 private Logger logger = Logger.getLogger(this.getClass().getName());
49 // filled before send the reques
52 // filled before send the request
53 // map to QRCS_PRES_CMD_ID
54 // QRCS_PRES_CMD_PUBLISHMYCAP
55 // QRCS_PRES_CMD_GETCONTACTCAP, we use it for capability
56 // QRCS_PRES_CMD_GETCONTACTLISTCAP, we use it for availability
57 // QRCS_PRES_CMD_SETNEWFEATURETAG
60 // filled after IQPresListener_CMDStatus
61 // QRCS_STATUSCODE, possible values are:
64 // QRCS_SUCCESS_ASYC_UPDATE
65 // QRCS_INVALID_SERVICE_HANDLE
66 // QRCS_INVALID_LISTENER_HANDLE
69 // QRCS_REQUEST_TIMEOUT
70 // QRCS_INSUFFICIENT_MEMORY
74 // Note: have converted it to ResultCode.
75 public int mCmdStatus;
77 //filled after IQPresListener_CMDStatus
78 public int mSipRequestId;
80 // filled after IQPresListener_SipResponseReceived
81 public int mSipResponseCode;
83 // filled after IQPresListener_SipResponseReceived
84 public String mSipReasonPhrase;
86 // filled before send the request
87 public IRcsPresenceListener mListener;
89 public Task(int taskId, int cmdId, IRcsPresenceListener listener){
95 public String toString(){
96 return "Task: mTaskId=" + mTaskId +
98 " mCmdStatus=" + mCmdStatus +
99 " mSipRequestId=" + mSipRequestId +
100 " mSipResponseCode=" + mSipResponseCode +
101 " mSipReasonPhrase=" + mSipReasonPhrase;