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