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    static public final int MO_CODE_UNCONDITIONAL_CF_ACTIVE     = 0;
39    static public final int MO_CODE_SOME_CF_ACTIVE              = 1;
40    static public final int MO_CODE_CALL_FORWARDED              = 2;
41    static public final int MO_CODE_CALL_IS_WAITING             = 3;
42    static public final int MO_CODE_CUG_CALL                    = 4;
43    static public final int MO_CODE_OUTGOING_CALLS_BARRED       = 5;
44    static public final int MO_CODE_INCOMING_CALLS_BARRED       = 6;
45    static public final int MO_CODE_CLIR_SUPPRESSION_REJECTED   = 7;
46    static public final int MO_CODE_CALL_DEFLECTED              = 8;
47
48    static public final int MT_CODE_FORWARDED_CALL              = 0;
49    static public final int MT_CODE_CUG_CALL                    = 1;
50    static public final int MT_CODE_CALL_ON_HOLD                = 2;
51    static public final int MT_CODE_CALL_RETRIEVED              = 3;
52    static public final int MT_CODE_MULTI_PARTY_CALL            = 4;
53    static public final int MT_CODE_ON_HOLD_CALL_RELEASED       = 5;
54    static public final int MT_CODE_FORWARD_CHECK_RECEIVED      = 6;
55    static public final int MT_CODE_CALL_CONNECTING_ECT         = 7;
56    static public final int MT_CODE_CALL_CONNECTED_ECT          = 8;
57    static public final int MT_CODE_DEFLECTED_CALL              = 9;
58    static public final int MT_CODE_ADDITIONAL_CALL_FORWARDED   = 10;
59
60    @Override
61    public String toString()
62    {
63        return super.toString() + " mobile"
64            + (notificationType == 0 ? " originated " : " terminated ")
65            + " code: " + code
66            + " index: " + index
67            + " \""
68            + PhoneNumberUtils.stringFromStringAndTOA(number, type) + "\" ";
69    }
70
71}
72