1 /* 2 * Copyright (C) 2022 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.telecom; 18 19 import android.os.OutcomeReceiver; 20 import android.telecom.CallAttributes; 21 import android.telecom.CallControl; 22 import android.telecom.CallControlCallback; 23 import android.telecom.CallEventCallback; 24 import android.telecom.CallException; 25 26 import java.util.concurrent.Executor; 27 28 /** 29 * @hide 30 */ 31 public class TransactionalCall { 32 33 private final String mCallId; 34 private final CallAttributes mCallAttributes; 35 private final Executor mExecutor; 36 private final OutcomeReceiver<CallControl, CallException> mPendingControl; 37 private final CallControlCallback mCallControlCallback; 38 private final CallEventCallback mCallStateCallback; 39 private CallControl mCallControl; 40 TransactionalCall(String callId, CallAttributes callAttributes, Executor executor, OutcomeReceiver<CallControl, CallException> pendingControl, CallControlCallback callControlCallback, CallEventCallback callStateCallback)41 public TransactionalCall(String callId, CallAttributes callAttributes, 42 Executor executor, OutcomeReceiver<CallControl, CallException> pendingControl, 43 CallControlCallback callControlCallback, 44 CallEventCallback callStateCallback) { 45 mCallId = callId; 46 mCallAttributes = callAttributes; 47 mExecutor = executor; 48 mPendingControl = pendingControl; 49 mCallControlCallback = callControlCallback; 50 mCallStateCallback = callStateCallback; 51 } 52 53 setCallControl(CallControl callControl)54 public void setCallControl(CallControl callControl) { 55 mCallControl = callControl; 56 } 57 getCallControl()58 public CallControl getCallControl() { 59 return mCallControl; 60 } 61 getCallId()62 public String getCallId() { 63 return mCallId; 64 } 65 getCallAttributes()66 public CallAttributes getCallAttributes() { 67 return mCallAttributes; 68 } 69 getExecutor()70 public Executor getExecutor() { 71 return mExecutor; 72 } 73 getPendingControl()74 public OutcomeReceiver<CallControl, CallException> getPendingControl() { 75 return mPendingControl; 76 } 77 getCallControlCallback()78 public CallControlCallback getCallControlCallback() { 79 return mCallControlCallback; 80 } 81 getCallStateCallback()82 public CallEventCallback getCallStateCallback() { 83 return mCallStateCallback; 84 } 85 } 86