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 isPresent = 0;
34    public int signalType = 0;
35    public int alertPitch = 0;
36    public int signal = 0;
37
38    public String toString()
39    {
40        return super.toString() + "Call Waiting Notification  "
41            + " number: " + number
42            + " numberPresentation: " + numberPresentation
43            + " name: " + name
44            + " namePresentation: " + namePresentation
45            + " isPresent: " + isPresent
46            + " signalType: " + signalType
47            + " alertPitch: " + alertPitch
48            + " signal: " + signal ;
49    }
50
51    public static int
52    presentationFromCLIP(int cli)
53    {
54        switch(cli) {
55            case 0: return Connection.PRESENTATION_ALLOWED;
56            case 1: return Connection.PRESENTATION_RESTRICTED;
57            case 2: return Connection.PRESENTATION_UNKNOWN;
58            default:
59                // This shouldn't happen, just log an error and treat as Unknown
60                Log.d(LOG_TAG, "Unexpected presentation " + cli);
61                return Connection.PRESENTATION_UNKNOWN;
62        }
63    }
64}
65