1 /*
2  * Copyright (C) 2009 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.cdma;
18 
19 import android.telephony.Rlog;
20 import com.android.internal.telephony.PhoneConstants;
21 
22 /**
23  * Represents a Supplementary Service Notification received from the network.
24  *
25  * {@hide}
26  */
27 public class CdmaCallWaitingNotification {
28     static final String LOG_TAG = "CdmaCallWaitingNotification";
29     public String number = null;
30     public int numberPresentation = 0;
31     public String name = null;
32     public int namePresentation = 0;
33     public int numberType = 0;
34     public int numberPlan = 0;
35     public int isPresent = 0;
36     public int signalType = 0;
37     public int alertPitch = 0;
38     public int signal = 0;
39 
40     @Override
toString()41     public String toString()
42     {
43         return super.toString() + "Call Waiting Notification  "
44             + " number: " + number
45             + " numberPresentation: " + numberPresentation
46             + " name: " + name
47             + " namePresentation: " + namePresentation
48             + " numberType: " + numberType
49             + " numberPlan: " + numberPlan
50             + " isPresent: " + isPresent
51             + " signalType: " + signalType
52             + " alertPitch: " + alertPitch
53             + " signal: " + signal ;
54     }
55 
56     public static int
presentationFromCLIP(int cli)57     presentationFromCLIP(int cli)
58     {
59         switch(cli) {
60             case 0: return PhoneConstants.PRESENTATION_ALLOWED;
61             case 1: return PhoneConstants.PRESENTATION_RESTRICTED;
62             case 2: return PhoneConstants.PRESENTATION_UNKNOWN;
63             default:
64                 // This shouldn't happen, just log an error and treat as Unknown
65                 Rlog.d(LOG_TAG, "Unexpected presentation " + cli);
66                 return PhoneConstants.PRESENTATION_UNKNOWN;
67         }
68     }
69 }
70