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.Bundle; 20 import android.telecom.CallControl; 21 import android.telecom.CallEndpoint; 22 import com.android.internal.telecom.ICallControl; 23 import android.os.ResultReceiver; 24 import android.telecom.CallAudioState; 25 import android.telecom.CallException; 26 import android.telecom.DisconnectCause; 27 import java.util.List; 28 29 /** 30 * {@hide} 31 */ 32 oneway interface ICallEventCallback { 33 // publicly exposed. Client should override onAddCallControl(String callId, int resultCode, in ICallControl callControl, in CallException exception)34 void onAddCallControl(String callId, int resultCode, in ICallControl callControl, 35 in CallException exception); 36 // -- Call Event Actions / Call State Transitions onSetActive(String callId, in ResultReceiver callback)37 void onSetActive(String callId, in ResultReceiver callback); onSetInactive(String callId, in ResultReceiver callback)38 void onSetInactive(String callId, in ResultReceiver callback); onAnswer(String callId, int videoState, in ResultReceiver callback)39 void onAnswer(String callId, int videoState, in ResultReceiver callback); onDisconnect(String callId, in DisconnectCause cause, in ResultReceiver callback)40 void onDisconnect(String callId, in DisconnectCause cause, in ResultReceiver callback); 41 // -- Streaming related. Client registered call streaming capabilities should override onCallStreamingStarted(String callId, in ResultReceiver callback)42 void onCallStreamingStarted(String callId, in ResultReceiver callback); onCallStreamingFailed(String callId, int reason)43 void onCallStreamingFailed(String callId, int reason); 44 // -- Audio related. onCallEndpointChanged(String callId, in CallEndpoint endpoint)45 void onCallEndpointChanged(String callId, in CallEndpoint endpoint); onAvailableCallEndpointsChanged(String callId, in List<CallEndpoint> endpoint)46 void onAvailableCallEndpointsChanged(String callId, in List<CallEndpoint> endpoint); onMuteStateChanged(String callId, boolean isMuted)47 void onMuteStateChanged(String callId, boolean isMuted); 48 // -- Video Related onVideoStateChanged(String callId, int videoState)49 void onVideoStateChanged(String callId, int videoState); 50 // -- Events onEvent(String callId, String event, in Bundle extras)51 void onEvent(String callId, String event, in Bundle extras); 52 // hidden methods that help with cleanup removeCallFromTransactionalServiceWrapper(String callId)53 void removeCallFromTransactionalServiceWrapper(String callId); 54 }