1/*
2 * Copyright (C) 2007 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.internal.telephony.gsm;
18
19import android.telephony.PhoneNumberUtils;
20
21/**
22 * Represents a Supplementary Service Notification received from the network.
23 *
24 * {@hide}
25 */
26public class SuppServiceNotification {
27    /** Type of notification: 0 = MO; 1 = MT */
28    public int notificationType;
29    /** TS 27.007 7.17 "code1" or "code2" */
30    public int code;
31    /** TS 27.007 7.17 "index" */
32    public int index;
33    /** TS 27.007 7.17 "type" (MT only) */
34    public int type;
35    /** TS 27.007 7.17 "number" (MT only) */
36    public String number;
37
38    /** List of forwarded numbers, if any */
39    public String[] history;
40
41    static public final int MO_CODE_UNCONDITIONAL_CF_ACTIVE     = 0;
42    static public final int MO_CODE_SOME_CF_ACTIVE              = 1;
43    static public final int MO_CODE_CALL_FORWARDED              = 2;
44    static public final int MO_CODE_CALL_IS_WAITING             = 3;
45    static public final int MO_CODE_CUG_CALL                    = 4;
46    static public final int MO_CODE_OUTGOING_CALLS_BARRED       = 5;
47    static public final int MO_CODE_INCOMING_CALLS_BARRED       = 6;
48    static public final int MO_CODE_CLIR_SUPPRESSION_REJECTED   = 7;
49    static public final int MO_CODE_CALL_DEFLECTED              = 8;
50
51    static public final int MT_CODE_FORWARDED_CALL              = 0;
52    static public final int MT_CODE_CUG_CALL                    = 1;
53    static public final int MT_CODE_CALL_ON_HOLD                = 2;
54    static public final int MT_CODE_CALL_RETRIEVED              = 3;
55    static public final int MT_CODE_MULTI_PARTY_CALL            = 4;
56    static public final int MT_CODE_ON_HOLD_CALL_RELEASED       = 5;
57    static public final int MT_CODE_FORWARD_CHECK_RECEIVED      = 6;
58    static public final int MT_CODE_CALL_CONNECTING_ECT         = 7;
59    static public final int MT_CODE_CALL_CONNECTED_ECT          = 8;
60    static public final int MT_CODE_DEFLECTED_CALL              = 9;
61    static public final int MT_CODE_ADDITIONAL_CALL_FORWARDED   = 10;
62
63    @Override
64    public String toString()
65    {
66        return super.toString() + " mobile"
67            + (notificationType == 0 ? " originated " : " terminated ")
68            + " code: " + code
69            + " index: " + index
70            + " history: " + history
71            + " \""
72            + PhoneNumberUtils.stringFromStringAndTOA(number, type) + "\" ";
73    }
74
75}
76