1 /* 2 * Copyright (C) 2023 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 android.telecom.cts.apps; 18 19 import android.os.Bundle; 20 import android.os.UserHandle; 21 import android.telecom.CallAttributes; 22 import android.telecom.CallEndpoint; 23 import android.telecom.PhoneAccountHandle; 24 import android.telecom.PhoneAccount; 25 import android.telecom.CallException; 26 import android.telecom.cts.apps.TestAppException; 27 import android.telecom.cts.apps.NoDataTransaction; 28 import android.telecom.cts.apps.CallEndpointTransaction; 29 import android.telecom.cts.apps.AvailableEndpointsTransaction; 30 import android.telecom.cts.apps.CallExceptionTransaction; 31 import android.telecom.cts.apps.PhoneAccountTransaction; 32 import android.telecom.cts.apps.BooleanTransaction; 33 import android.telecom.cts.apps.IRemoteOperationConsumer; 34 35 // Note: This interface is overridden by the following applications: 36 // - TransactionalVoipApp_Main, 37 // - ConnectionServiceVoipApp_Main, 38 // - ManagedConnectionServiceApp 39 // Which means modifying any of the interface methods requires modifying the overridden methods in 40 // every application. 41 interface IAppControl { 42 // The following AIDL methods do not currently fail via a TestAppException so they do not need 43 // to be wrapped in a Transaction isBound()44 boolean isBound(); getOwnAccountHandlesForApp()45 List<PhoneAccountHandle> getOwnAccountHandlesForApp(); getRegisteredPhoneAccounts()46 List<PhoneAccount> getRegisteredPhoneAccounts(); registerCustomPhoneAccount(in PhoneAccount account)47 void registerCustomPhoneAccount(in PhoneAccount account); unregisterPhoneAccountWithHandle( in PhoneAccountHandle handle)48 void unregisterPhoneAccountWithHandle( in PhoneAccountHandle handle); getProcessUserHandle()49 UserHandle getProcessUserHandle(); getProcessUid()50 int getProcessUid(); cleanup()51 void cleanup(); 52 53 // The below AIDL methods all need to return a BaseTransaction: registerDefaultPhoneAccount()54 NoDataTransaction registerDefaultPhoneAccount(); getDefaultPhoneAccount()55 PhoneAccountTransaction getDefaultPhoneAccount(); getCurrentCallEndpoint(String id)56 CallEndpointTransaction getCurrentCallEndpoint(String id); getAvailableCallEndpoints(String id)57 AvailableEndpointsTransaction getAvailableCallEndpoints(String id); addCall(in CallAttributes callAttributes)58 NoDataTransaction addCall(in CallAttributes callAttributes); addFailedCall(in CallAttributes callAttributes)59 NoDataTransaction addFailedCall(in CallAttributes callAttributes); addFailedCallWithCreateConnectionVerify(in CallAttributes callAttributes)60 NoDataTransaction addFailedCallWithCreateConnectionVerify(in CallAttributes callAttributes); addCallWithConsumer(in CallAttributes callAttributes, in IRemoteOperationConsumer consumer)61 NoDataTransaction addCallWithConsumer(in CallAttributes callAttributes, in IRemoteOperationConsumer consumer); verifyCallWithConsumer(in CallAttributes callAttributes, in IRemoteOperationConsumer consumer)62 NoDataTransaction verifyCallWithConsumer(in CallAttributes callAttributes, in IRemoteOperationConsumer consumer); setMuteState(String id, boolean isMuted)63 NoDataTransaction setMuteState(String id, boolean isMuted); sendConnectionEvent(String id, String event)64 NoDataTransaction sendConnectionEvent(String id, String event); isMuted(String id)65 BooleanTransaction isMuted(String id); transitionCallStateTo(String id, int state, boolean expectSuccess, in Bundle extras)66 CallExceptionTransaction transitionCallStateTo(String id, int state, boolean expectSuccess, in Bundle extras); requestCallEndpointChange(String id, in CallEndpoint callEndpoint)67 NoDataTransaction requestCallEndpointChange(String id, in CallEndpoint callEndpoint); removeNotificationForCall(String callId)68 NoDataTransaction removeNotificationForCall(String callId); isNotificationPostedForCall(String callId)69 BooleanTransaction isNotificationPostedForCall(String callId); isForegroundServiceDelegationActive( in PhoneAccountHandle handle)70 BooleanTransaction isForegroundServiceDelegationActive( in PhoneAccountHandle handle); 71 }