1/*
2 * Copyright (c) 2013 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
17package com.android.ims;
18
19import android.os.Handler;
20import android.os.Message;
21import android.telephony.ims.ImsCallForwardInfo;
22import android.telephony.ims.ImsSsInfo;
23
24/**
25 * Provides APIs for the supplementary service settings using IMS (Ut interface).
26 * It is created from 3GPP TS 24.623 (XCAP(XML Configuration Access Protocol)
27 * over the Ut interface for manipulating supplementary services).
28 *
29 * @hide
30 */
31public interface ImsUtInterface {
32    /**
33     * Actions
34     * @hide
35     */
36    public static final int ACTION_DEACTIVATION = 0;
37    public static final int ACTION_ACTIVATION = 1;
38    public static final int ACTION_REGISTRATION = 3;
39    public static final int ACTION_ERASURE = 4;
40    public static final int ACTION_INTERROGATION = 5;
41
42    /**
43     * OIR (Originating Identification Restriction, 3GPP TS 24.607)
44     * OIP (Originating Identification Presentation, 3GPP TS 24.607)
45     * TIR (Terminating Identification Restriction, 3GPP TS 24.608)
46     * TIP (Terminating Identification Presentation, 3GPP TS 24.608)
47     */
48    public static final int OIR_DEFAULT = 0;    // "user subscription default value"
49    public static final int OIR_PRESENTATION_RESTRICTED = 1;
50    public static final int OIR_PRESENTATION_NOT_RESTRICTED = 2;
51
52    /**
53     * CW (Communication Waiting, 3GPP TS 24.615)
54     */
55
56    /**
57     * CDIV (Communication Diversion, 3GPP TS 24.604)
58     *     actions: target, no reply timer
59     */
60    public static final int CDIV_CF_UNCONDITIONAL = 0;
61    public static final int CDIV_CF_BUSY = 1;
62    public static final int CDIV_CF_NO_REPLY = 2;
63    public static final int CDIV_CF_NOT_REACHABLE = 3;
64    // For CS service code: 002
65    public static final int CDIV_CF_ALL = 4;
66    // For CS service code: 004
67    public static final int CDIV_CF_ALL_CONDITIONAL = 5;
68    // It's only supported in the IMS service (CS does not define it).
69    // IR.92 recommends that an UE activates both the CFNRc and the CFNL
70    // (CDIV using condition not-registered) to the same target.
71    public static final int CDIV_CF_NOT_LOGGED_IN = 6;
72
73    /**
74     * CB (Communication Barring, 3GPP TS 24.611)
75     */
76    // Barring of All Incoming Calls
77    public static final int CB_BAIC = 1;
78    // Barring of All Outgoing Calls
79    public static final int CB_BAOC = 2;
80    // Barring of Outgoing International Calls
81    public static final int CB_BOIC = 3;
82    // Barring of Outgoing International Calls - excluding Home Country
83    public static final int CB_BOIC_EXHC = 4;
84    // Barring of Incoming Calls - when roaming
85    public static final int CB_BIC_WR = 5;
86    // Barring of Anonymous Communication Rejection (ACR) - a particular case of ICB service
87    public static final int CB_BIC_ACR = 6;
88    // Barring of All Calls
89    public static final int CB_BA_ALL = 7;
90    // Barring of Outgoing Services (Service Code 333 - 3GPP TS 22.030 Table B-1)
91    public static final int CB_BA_MO = 8;
92    // Barring of Incoming Services (Service Code 353 - 3GPP TS 22.030 Table B-1)
93    public static final int CB_BA_MT = 9;
94    // Barring of Specific Incoming calls
95    public static final int CB_BS_MT = 10;
96
97    /**
98     * Invalid result value.
99     */
100    public static final int INVALID = (-1);
101
102
103
104    /**
105     * Operations for the supplementary service configuration
106     */
107
108    /**
109     * Retrieves the configuration of the call barring.
110     * The return value of ((AsyncResult)result.obj) is an array of {@link ImsSsInfo}.
111     */
112    public void queryCallBarring(int cbType, Message result);
113
114    /**
115     * Retrieves the configuration of the call barring for specified service class.
116     * The return value of ((AsyncResult)result.obj) is an array of {@link ImsSsInfo}.
117     */
118    public void queryCallBarring(int cbType, Message result, int serviceClass);
119
120    /**
121     * Retrieves the configuration of the call forward.
122     * The return value of ((AsyncResult)result.obj) is an array of {@link ImsCallForwardInfo}.
123     */
124    public void queryCallForward(int condition, String number, Message result);
125
126    /**
127     * Retrieves the configuration of the call waiting.
128     * The return value of ((AsyncResult)result.obj) is an array of {@link ImsSsInfo}.
129     */
130    public void queryCallWaiting(Message result);
131
132    /**
133     * Retrieves the default CLIR setting.
134     */
135    public void queryCLIR(Message result);
136
137    /**
138     * Retrieves the CLIP call setting.
139     */
140    public void queryCLIP(Message result);
141
142    /**
143     * Retrieves the COLR call setting.
144     */
145    public void queryCOLR(Message result);
146
147    /**
148     * Retrieves the COLP call setting.
149     */
150    public void queryCOLP(Message result);
151
152    /**
153     * Modifies the configuration of the call barring.
154     */
155    public void updateCallBarring(int cbType, int action,
156            Message result, String[] barrList);
157
158    /**
159     * Modifies the configuration of the call barring for specified service class.
160     */
161    public void updateCallBarring(int cbType, int action, Message result,
162            String[] barrList, int serviceClass);
163
164    /**
165     * Modifies the configuration of the call forward.
166     */
167    public void updateCallForward(int action, int condition, String number,
168            int serviceClass, int timeSeconds, Message result);
169
170    /**
171     * Modifies the configuration of the call waiting.
172     */
173    public void updateCallWaiting(boolean enable, int serviceClass, Message result);
174
175    /**
176     * Updates the configuration of the CLIR supplementary service.
177     */
178    public void updateCLIR(int clirMode, Message result);
179
180    /**
181     * Updates the configuration of the CLIP supplementary service.
182     */
183    public void updateCLIP(boolean enable, Message result);
184
185    /**
186     * Updates the configuration of the COLR supplementary service.
187     */
188    public void updateCOLR(int presentation, Message result);
189
190    /**
191     * Updates the configuration of the COLP supplementary service.
192     */
193    public void updateCOLP(boolean enable, Message result);
194
195    /**
196     * Register for UNSOL_ON_SS indications.
197     * @param handler the {@link Handler} that is notified when there is an ss indication.
198     * @param event  Supplimentary service indication event.
199     * @param Object user object.
200     */
201    public void registerForSuppServiceIndication(Handler handler, int event, Object object);
202
203    /**
204     * Deregister for UNSOL_ON_SS indications.
205     * @param handler the {@link Handler} that is notified when there is an ss indication.
206     */
207    public void unregisterForSuppServiceIndication(Handler handler);
208}
209