blob: 7336c133af969c000eb4a03b15fb62da37f801dc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
/*
* Copyright (c) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.ims;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.ArrayList;
/**
* Provided STK Call Control Suplementary Service information
*
* {@hide}
*/
public class ImsSsData implements Parcelable {
//ServiceType
public static final int SS_CFU = 0;
public static final int SS_CF_BUSY = 1;
public static final int SS_CF_NO_REPLY = 2;
public static final int SS_CF_NOT_REACHABLE = 3;
public static final int SS_CF_ALL = 4;
public static final int SS_CF_ALL_CONDITIONAL = 5;
public static final int SS_CFUT = 6;
public static final int SS_CLIP = 7;
public static final int SS_CLIR = 8;
public static final int SS_COLP = 9;
public static final int SS_COLR = 10;
public static final int SS_CNAP = 11;
public static final int SS_WAIT = 12;
public static final int SS_BAOC = 13;
public static final int SS_BAOIC = 14;
public static final int SS_BAOIC_EXC_HOME = 15;
public static final int SS_BAIC = 16;
public static final int SS_BAIC_ROAMING = 17;
public static final int SS_ALL_BARRING = 18;
public static final int SS_OUTGOING_BARRING = 19;
public static final int SS_INCOMING_BARRING = 20;
public static final int SS_INCOMING_BARRING_DN = 21;
public static final int SS_INCOMING_BARRING_ANONYMOUS = 22;
//SSRequestType
public static final int SS_ACTIVATION = 0;
public static final int SS_DEACTIVATION = 1;
public static final int SS_INTERROGATION = 2;
public static final int SS_REGISTRATION = 3;
public static final int SS_ERASURE = 4;
//TeleserviceType
public static final int SS_ALL_TELE_AND_BEARER_SERVICES = 0;
public static final int SS_ALL_TELESEVICES = 1;
public static final int SS_TELEPHONY = 2;
public static final int SS_ALL_DATA_TELESERVICES = 3;
public static final int SS_SMS_SERVICES = 4;
public static final int SS_ALL_TELESERVICES_EXCEPT_SMS = 5;
// Refer to ServiceType
public int serviceType;
// Refere to SSRequestType
public int requestType;
// Refer to TeleserviceType
public int teleserviceType;
// Service Class
public int serviceClass;
// Error information
public int result;
public int[] ssInfo; /* Valid for all supplementary services.
This field will be empty for RequestType SS_INTERROGATION
and ServiceType SS_CF_*, SS_INCOMING_BARRING_DN,
SS_INCOMING_BARRING_ANONYMOUS.*/
public ImsCallForwardInfo[] cfInfo; /* Valid only for supplementary services
ServiceType SS_CF_* and RequestType SS_INTERROGATION */
public ImsSsInfo[] imsSsInfo; /* Valid only for ServiceType SS_INCOMING_BARRING_DN and
ServiceType SS_INCOMING_BARRING_ANONYMOUS */
public ImsSsData() {}
public ImsSsData(Parcel in) {
readFromParcel(in);
}
public static final Creator<ImsSsData> CREATOR = new Creator<ImsSsData>() {
@Override
public ImsSsData createFromParcel(Parcel in) {
return new ImsSsData(in);
}
@Override
public ImsSsData[] newArray(int size) {
return new ImsSsData[size];
}
};
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeInt(serviceType);
out.writeInt(requestType);
out.writeInt(teleserviceType);
out.writeInt(serviceClass);
out.writeInt(result);
out.writeIntArray(ssInfo);
out.writeParcelableArray(cfInfo, 0);
}
private void readFromParcel(Parcel in) {
serviceType = in.readInt();
requestType = in.readInt();
teleserviceType = in.readInt();
serviceClass = in.readInt();
result = in.readInt();
ssInfo = in.createIntArray();
cfInfo = (ImsCallForwardInfo[])in.readParcelableArray(this.getClass().getClassLoader());
}
@Override
public int describeContents() {
return 0;
}
public boolean isTypeCF() {
return (serviceType == SS_CFU || serviceType == SS_CF_BUSY ||
serviceType == SS_CF_NO_REPLY || serviceType == SS_CF_NOT_REACHABLE ||
serviceType == SS_CF_ALL || serviceType == SS_CF_ALL_CONDITIONAL);
}
public boolean isTypeUnConditional() {
return (serviceType == SS_CFU || serviceType == SS_CF_ALL);
}
public boolean isTypeCW() {
return (serviceType == SS_WAIT);
}
public boolean isTypeClip() {
return (serviceType == SS_CLIP);
}
public boolean isTypeColr() {
return (serviceType == SS_COLR);
}
public boolean isTypeColp() {
return (serviceType == SS_COLP);
}
public boolean isTypeClir() {
return (serviceType == SS_CLIR);
}
public boolean isTypeIcb() {
return (serviceType == SS_INCOMING_BARRING_DN ||
serviceType == SS_INCOMING_BARRING_ANONYMOUS);
}
public boolean isTypeBarring() {
return (serviceType == SS_BAOC || serviceType == SS_BAOIC ||
serviceType == SS_BAOIC_EXC_HOME || serviceType == SS_BAIC ||
serviceType == SS_BAIC_ROAMING || serviceType == SS_ALL_BARRING ||
serviceType == SS_OUTGOING_BARRING || serviceType == SS_INCOMING_BARRING);
}
public boolean isTypeInterrogation() {
return (requestType == SS_INTERROGATION);
}
public String toString() {
return "[ImsSsData] " + "ServiceType: " + serviceType
+ " RequestType: " + requestType
+ " TeleserviceType: " + teleserviceType
+ " ServiceClass: " + serviceClass
+ " Result: " + result;
}
}
|