1 /* 2 * Copyright (C) 2016 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.imsphone; 18 19 import com.android.internal.telephony.Call; 20 import com.android.internal.telephony.CallStateException; 21 import com.android.internal.telephony.Connection; 22 import com.android.internal.telephony.Phone; 23 24 import java.util.List; 25 26 /** 27 * Companion class for {@link ImsExternalConnection}; represents an external call which was 28 * received via {@link com.android.ims.ImsExternalCallState} info. 29 */ 30 public class ImsExternalCall extends Call { 31 32 private Phone mPhone; 33 34 public ImsExternalCall(Phone phone, ImsExternalConnection connection) { 35 mPhone = phone; 36 mConnections.add(connection); 37 } 38 39 @Override 40 public List<Connection> getConnections() { 41 return mConnections; 42 } 43 44 @Override 45 public Phone getPhone() { 46 return mPhone; 47 } 48 49 @Override 50 public boolean isMultiparty() { 51 return false; 52 } 53 54 @Override 55 public void hangup() throws CallStateException { 56 57 } 58 59 /** 60 * Sets the call state to active. 61 */ 62 public void setActive() { 63 setState(State.ACTIVE); 64 } 65 66 /** 67 * Sets the call state to terminated. 68 */ 69 public void setTerminated() { 70 setState(State.DISCONNECTED); 71 } 72 } 73