Home | History | Annotate | Download | only in gsm
      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 
     17 package com.android.internal.telephony.gsm;
     18 
     19 import android.telephony.PhoneNumberUtils;
     20 
     21 /**
     22  * Represents a Supplementary Service Notification received from the network.
     23  *
     24  * {@hide}
     25  */
     26 public class SuppServiceNotification {
     27     /** Type of notification: 0 = code1; 1 = code2 */
     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     /**
     42      * Notification type is from the "code 1" group (per TS 27.007 7.17).
     43      * This means the {@link #code} will be a code such as {@link #CODE_1_CALL_FORWARDED}.
     44      */
     45     public static final int NOTIFICATION_TYPE_CODE_1 = 0;
     46 
     47     /**
     48      * Notification type is from the "code 2" group (per TS 27.007 7.17).
     49      * This means the {@link #code} will be a code such as {@link #CODE_2_CALL_ON_HOLD}.
     50      */
     51     public static final int NOTIFICATION_TYPE_CODE_2 = 1;
     52 
     53     /**
     54      * Indicates that unconditional call forwarding is active.
     55      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
     56      * See TS 27.007 7.17.
     57      */
     58     public static final int CODE_1_UNCONDITIONAL_CF_ACTIVE     = 0;
     59 
     60     /**
     61      * Indicates that some conditional call forwarding options are active.
     62      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
     63      * See TS 27.007 7.17.
     64      */
     65     public static final int CODE_1_SOME_CF_ACTIVE              = 1;
     66 
     67     /**
     68      * Indicates that an outgoing call has been forwarded to another number.
     69      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
     70      * See TS 27.007 7.17.
     71      */
     72     public static final int CODE_1_CALL_FORWARDED              = 2;
     73 
     74     /**
     75      * Indicates that an outgoing call is waiting.  This means that the called party is already in
     76      * another call and is hearing the call waiting tone.
     77      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
     78      * See TS 27.007 7.17.
     79      */
     80     public static final int CODE_1_CALL_IS_WAITING             = 3;
     81 
     82     /**
     83      * Indicates that an outgoing call is to a number in a closed user group.
     84      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
     85      * See TS 27.007 7.17.
     86      */
     87     public static final int CODE_1_CUG_CALL                    = 4;
     88 
     89     /**
     90      * Indicates that outgoing calls are barred.
     91      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
     92      * See TS 27.007 7.17.
     93      */
     94     public static final int CODE_1_OUTGOING_CALLS_BARRED       = 5;
     95 
     96     /**
     97      * Indicates that incoming calls are barred.
     98      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
     99      * See TS 27.007 7.17.
    100      */
    101     public static final int CODE_1_INCOMING_CALLS_BARRED       = 6;
    102 
    103     /**
    104      * Indicates that CLIR suppression has been rejected for an outgoing call.
    105      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
    106      * See TS 27.007 7.17.
    107      */
    108     public static final int CODE_1_CLIR_SUPPRESSION_REJECTED   = 7;
    109 
    110     /**
    111      * Indicates that an outgoing call bas been deflected to another number.
    112      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
    113      * See TS 27.007 7.17.
    114      */
    115     public static final int CODE_1_CALL_DEFLECTED              = 8;
    116 
    117     /**
    118      * Indicates that an incoming call is a forwarded call.
    119      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
    120      * See TS 27.007 7.17.
    121      */
    122     public static final int CODE_2_FORWARDED_CALL              = 0;
    123 
    124     /**
    125      * Indicates that an incoming call is from a member of a closed user group.
    126      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
    127      * See TS 27.007 7.17.
    128      */
    129     public static final int CODE_2_CUG_CALL                    = 1;
    130 
    131     /**
    132      * Indicates that a call has been remotely put on hold.
    133      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
    134      * See TS 27.007 7.17.
    135      */
    136     public static final int CODE_2_CALL_ON_HOLD                = 2;
    137 
    138     /**
    139      * Indicates that a call has been remotely resumed (retrieved).
    140      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
    141      * See TS 27.007 7.17.
    142      */
    143     public static final int CODE_2_CALL_RETRIEVED              = 3;
    144 
    145     /**
    146      * Indicates that a conference call has been entered.
    147      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
    148      * See TS 27.007 7.17.
    149      */
    150     public static final int CODE_2_MULTI_PARTY_CALL            = 4;
    151 
    152     /**
    153      * Indicates that an ongoing call on hold has been released.
    154      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
    155      * See TS 27.007 7.17.
    156      */
    157     public static final int CODE_2_ON_HOLD_CALL_RELEASED       = 5;
    158 
    159     /**
    160      * Indicates that a forward check message was received.
    161      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
    162      * See TS 27.007 7.17.
    163      */
    164     public static final int CODE_2_FORWARD_CHECK_RECEIVED      = 6;
    165 
    166     /**
    167      * Indicates that a call is being connected (alerting) with another party as a result of an
    168      * explicit call transfer operation.
    169      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
    170      * See TS 27.007 7.17.
    171      */
    172     public static final int CODE_2_CALL_CONNECTING_ECT         = 7;
    173 
    174     /**
    175      * Indicates that a call has been connected with another party as a result of an explicit call
    176      * transfer operation.
    177      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
    178      * See TS 27.007 7.17.
    179      */
    180     public static final int CODE_2_CALL_CONNECTED_ECT          = 8;
    181 
    182     /**
    183      * Indicates that an outgoing call has been deflected to another number.
    184      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
    185      * See TS 27.007 7.17.
    186      */
    187     public static final int CODE_2_DEFLECTED_CALL              = 9;
    188 
    189     /**
    190      * Indicates that an additional incoming call has been forwarded.
    191      * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
    192      * See TS 27.007 7.17.
    193      */
    194     public static final int CODE_2_ADDITIONAL_CALL_FORWARDED   = 10;
    195 
    196     @Override
    197     public String toString()
    198     {
    199         return super.toString() + " mobile"
    200             + (notificationType == 0 ? " originated " : " terminated ")
    201             + " code: " + code
    202             + " index: " + index
    203             + " history: " + history
    204             + " \""
    205             + PhoneNumberUtils.stringFromStringAndTOA(number, type) + "\" ";
    206     }
    207 
    208 }
    209