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