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
17package com.android.internal.telephony.cdma;
18
19import android.util.Log;
20import com.android.internal.telephony.Connection;
21import com.android.internal.telephony.PhoneConstants;
22
23/**
24 * Represents a Supplementary Service Notification received from the network.
25 *
26 * {@hide}
27 */
28public class CdmaCallWaitingNotification {
29    static final String LOG_TAG = "CDMA";
30    public String number = null;
31    public int numberPresentation = 0;
32    public String name = null;
33    public int namePresentation = 0;
34    public int numberType = 0;
35    public int numberPlan = 0;
36    public int isPresent = 0;
37    public int signalType = 0;
38    public int alertPitch = 0;
39    public int signal = 0;
40
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
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                Log.d(LOG_TAG, "Unexpected presentation " + cli);
66                return PhoneConstants.PRESENTATION_UNKNOWN;
67        }
68    }
69}
70