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;
21
22/**
23 * Represents a Supplementary Service Notification received from the network.
24 *
25 * {@hide}
26 */
27public class CdmaCallWaitingNotification {
28    static final String LOG_TAG = "CDMA";
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    public String toString()
41    {
42        return super.toString() + "Call Waiting Notification  "
43            + " number: " + number
44            + " numberPresentation: " + numberPresentation
45            + " name: " + name
46            + " namePresentation: " + namePresentation
47            + " numberType: " + numberType
48            + " numberPlan: " + numberPlan
49            + " isPresent: " + isPresent
50            + " signalType: " + signalType
51            + " alertPitch: " + alertPitch
52            + " signal: " + signal ;
53    }
54
55    public static int
56    presentationFromCLIP(int cli)
57    {
58        switch(cli) {
59            case 0: return Connection.PRESENTATION_ALLOWED;
60            case 1: return Connection.PRESENTATION_RESTRICTED;
61            case 2: return Connection.PRESENTATION_UNKNOWN;
62            default:
63                // This shouldn't happen, just log an error and treat as Unknown
64                Log.d(LOG_TAG, "Unexpected presentation " + cli);
65                return Connection.PRESENTATION_UNKNOWN;
66        }
67    }
68}
69