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 
34 // Note: This interface is overridden by the following applications:
35 //  - TransactionalVoipApp_Main,
36 //  - ConnectionServiceVoipApp_Main,
37 //  - ManagedConnectionServiceApp
38 // Which means modifying any of the interface methods requires modifying the overridden methods in
39 // every application.
40 interface IAppControl {
41     // The following AIDL methods do not currently fail via a TestAppException so they do not need
42     // to be wrapped in a Transaction
isBound()43     boolean isBound();
getOwnAccountHandlesForApp()44     List<PhoneAccountHandle> getOwnAccountHandlesForApp();
getRegisteredPhoneAccounts()45     List<PhoneAccount> getRegisteredPhoneAccounts();
registerCustomPhoneAccount(in PhoneAccount account)46     void registerCustomPhoneAccount(in PhoneAccount account);
unregisterPhoneAccountWithHandle( in PhoneAccountHandle handle)47     void unregisterPhoneAccountWithHandle( in PhoneAccountHandle handle);
getProcessUserHandle()48     UserHandle getProcessUserHandle();
getProcessUid()49     int getProcessUid();
cleanup()50     void cleanup();
51 
52     // The below AIDL methods all need to return a BaseTransaction:
registerDefaultPhoneAccount()53     NoDataTransaction registerDefaultPhoneAccount();
getDefaultPhoneAccount()54     PhoneAccountTransaction getDefaultPhoneAccount();
getCurrentCallEndpoint(String id)55     CallEndpointTransaction getCurrentCallEndpoint(String id);
getAvailableCallEndpoints(String id)56     AvailableEndpointsTransaction getAvailableCallEndpoints(String id);
addCall(in CallAttributes callAttributes)57     NoDataTransaction addCall(in CallAttributes callAttributes);
setMuteState(String id, boolean isMuted)58     NoDataTransaction setMuteState(String id, boolean isMuted);
isMuted(String id)59     BooleanTransaction isMuted(String id);
transitionCallStateTo(String id, int state, boolean expectSuccess, in Bundle extras)60     CallExceptionTransaction transitionCallStateTo(String id, int state, boolean expectSuccess, in Bundle extras);
requestCallEndpointChange(String id, in CallEndpoint callEndpoint)61     NoDataTransaction requestCallEndpointChange(String id, in CallEndpoint callEndpoint);
removeNotificationForCall(String callId)62     NoDataTransaction removeNotificationForCall(String callId);
isNotificationPostedForCall(String callId)63     BooleanTransaction isNotificationPostedForCall(String callId);
64 }