1 /*
2  * Copyright (C) 2019 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.telephony.ims.aidl;
18 
19 import android.net.Uri;
20 import android.telephony.ims.DelegateRequest;
21 import android.telephony.ims.aidl.IImsCapabilityCallback;
22 import android.telephony.ims.aidl.IImsRegistrationCallback;
23 import android.telephony.ims.aidl.IRcsUceControllerCallback;
24 import android.telephony.ims.aidl.IRcsUcePublishStateCallback;
25 import android.telephony.ims.aidl.IRcsUcePublishStateCallback;
26 import android.telephony.ims.aidl.ISipDelegate;
27 import android.telephony.ims.aidl.ISipDelegateMessageCallback;
28 import android.telephony.ims.aidl.ISipDelegateConnectionStateCallback;
29 
30 import com.android.ims.ImsFeatureContainer;
31 import com.android.ims.internal.IImsServiceFeatureCallback;
32 import com.android.internal.telephony.IIntegerConsumer;
33 import com.android.internal.telephony.ISipDialogStateCallback;
34 
35 /**
36  * Interface used to interact with the Telephony IMS.
37  *
38  * {@hide}
39  */
40 interface IImsRcsController {
41     // IMS RCS registration commands
registerImsRegistrationCallback(int subId, IImsRegistrationCallback c)42     void registerImsRegistrationCallback(int subId, IImsRegistrationCallback c);
unregisterImsRegistrationCallback(int subId, IImsRegistrationCallback c)43     void unregisterImsRegistrationCallback(int subId, IImsRegistrationCallback c);
getImsRcsRegistrationState(int subId, IIntegerConsumer consumer)44     void getImsRcsRegistrationState(int subId, IIntegerConsumer consumer);
getImsRcsRegistrationTransportType(int subId, IIntegerConsumer consumer)45     void getImsRcsRegistrationTransportType(int subId, IIntegerConsumer consumer);
46 
47     // IMS RCS capability commands
registerRcsAvailabilityCallback(int subId, IImsCapabilityCallback c)48     void registerRcsAvailabilityCallback(int subId, IImsCapabilityCallback c);
unregisterRcsAvailabilityCallback(int subId, IImsCapabilityCallback c)49     void unregisterRcsAvailabilityCallback(int subId, IImsCapabilityCallback c);
isCapable(int subId, int capability, int radioTech)50     boolean isCapable(int subId, int capability, int radioTech);
isAvailable(int subId, int capability, int radioTech)51     boolean isAvailable(int subId, int capability, int radioTech);
52 
53     // ImsUceAdapter specific
requestCapabilities(int subId, String callingPackage, String callingFeatureId, in List<Uri> contactNumbers, IRcsUceControllerCallback c)54     void requestCapabilities(int subId, String callingPackage, String callingFeatureId,
55             in List<Uri> contactNumbers, IRcsUceControllerCallback c);
requestAvailability(int subId, String callingPackage, String callingFeatureId, in Uri contactNumber, IRcsUceControllerCallback c)56     void requestAvailability(int subId, String callingPackage,
57             String callingFeatureId, in Uri contactNumber,
58             IRcsUceControllerCallback c);
getUcePublishState(int subId)59     int getUcePublishState(int subId);
isUceSettingEnabled(int subId, String callingPackage, String callingFeatureId)60     boolean isUceSettingEnabled(int subId, String callingPackage, String callingFeatureId);
setUceSettingEnabled(int subId, boolean isEnabled)61     void setUceSettingEnabled(int subId, boolean isEnabled);
registerUcePublishStateCallback(int subId, IRcsUcePublishStateCallback c)62     void registerUcePublishStateCallback(int subId, IRcsUcePublishStateCallback c);
unregisterUcePublishStateCallback(int subId, IRcsUcePublishStateCallback c)63     void unregisterUcePublishStateCallback(int subId, IRcsUcePublishStateCallback c);
64 
65     // SipDelegateManager
isSipDelegateSupported(int subId)66     boolean isSipDelegateSupported(int subId);
createSipDelegate(int subId, in DelegateRequest request, String packageName, ISipDelegateConnectionStateCallback delegateState, ISipDelegateMessageCallback delegateMessage)67     void createSipDelegate(int subId, in DelegateRequest request, String packageName,
68             ISipDelegateConnectionStateCallback delegateState,
69             ISipDelegateMessageCallback delegateMessage);
destroySipDelegate(int subId, ISipDelegate connection, int reason)70     void destroySipDelegate(int subId, ISipDelegate connection, int reason);
triggerNetworkRegistration(int subId, ISipDelegate connection, int sipCode, String sipReason)71     void triggerNetworkRegistration(int subId, ISipDelegate connection, int sipCode,
72             String sipReason);
73     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)")
registerSipDialogStateCallback(int subId, in ISipDialogStateCallback cb)74     void registerSipDialogStateCallback(int subId, in ISipDialogStateCallback cb);
75     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)")
unregisterSipDialogStateCallback(int subId, in ISipDialogStateCallback cb)76     void unregisterSipDialogStateCallback(int subId, in ISipDialogStateCallback cb);
77 
78     // Internal commands that should not be made public
registerRcsFeatureCallback(int slotId, in IImsServiceFeatureCallback callback)79     void registerRcsFeatureCallback(int slotId, in IImsServiceFeatureCallback callback);
unregisterImsFeatureCallback(in IImsServiceFeatureCallback callback)80     void unregisterImsFeatureCallback(in IImsServiceFeatureCallback callback);
81 }
82