aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/android/ims/ImsServiceBase.java
blob: 0a15c9d9ea4f3c9fa541305a49f594174fd3a015 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.ims;

import android.app.PendingIntent;

import android.telephony.ims.ImsCallProfile;
import com.android.ims.internal.IImsCallSession;
import com.android.ims.internal.IImsCallSessionListener;
import com.android.ims.internal.IImsConfig;
import com.android.ims.internal.IImsEcbm;
import com.android.ims.internal.IImsMultiEndpoint;
import com.android.ims.internal.IImsRegistrationListener;
import com.android.ims.internal.IImsService;
import com.android.ims.internal.IImsUt;
import android.os.Message;

/*
 * Stub for IImsService interface. To enable forward compatibility during
 * development - empty APIs should not be deployed.
 *
 * @hide
 */
public abstract class ImsServiceBase {
    /**
     * IImsService stub implementation.
     */
    private final class ImsServiceBinder extends IImsService.Stub {
        @Override
        public int open(int phoneId, int serviceClass, PendingIntent incomingCallIntent,
                 IImsRegistrationListener listener) {
            return onOpen(phoneId, serviceClass, incomingCallIntent, listener);
        }

        @Override
        public void close(int serviceId) {
            onClose(serviceId);
        }

        @Override
        public boolean isConnected(int serviceId, int serviceType, int callType) {
            return onIsConnected(serviceId, serviceType, callType);
        }

        @Override
        public boolean isOpened(int serviceId) {
            return onIsOpened(serviceId);
        }

        @Override
        public void setRegistrationListener(int serviceId, IImsRegistrationListener listener) {
            onSetRegistrationListener(serviceId, listener);
        }

        @Override
        public void addRegistrationListener(int serviceId, int serviceType, IImsRegistrationListener listener) {
            onAddRegistrationListener(serviceId, serviceType, listener);
        }


        @Override
        public ImsCallProfile createCallProfile(int serviceId, int serviceType, int callType) {
            return onCreateCallProfile(serviceId, serviceType, callType);
        }

        @Override
        public IImsCallSession createCallSession(int serviceId, ImsCallProfile profile,
                                          IImsCallSessionListener listener) {
            return onCreateCallSession(serviceId, profile, listener);
        }

        @Override
        public IImsCallSession getPendingCallSession(int serviceId, String callId) {
            return onGetPendingCallSession(serviceId, callId);
        }

        @Override
        public IImsUt getUtInterface(int serviceId) {
            return onGetUtInterface(serviceId);
        }

        @Override
        public IImsConfig getConfigInterface(int phoneId) {
            return onGetConfigInterface(phoneId);
        }

        @Override
        public void turnOnIms(int phoneId) {
            onTurnOnIms(phoneId);
        }

        @Override
        public void turnOffIms(int phoneId) {
            onTurnOffIms(phoneId);
        }

        @Override
        public IImsEcbm getEcbmInterface(int serviceId) {
            return onGetEcbmInterface(serviceId);
        }

        @Override
        public void setUiTTYMode(int serviceId, int uiTtyMode, Message onComplete) {
            onSetUiTTYMode(serviceId, uiTtyMode, onComplete);
        }

        @Override
        public IImsMultiEndpoint getMultiEndpointInterface(int serviceId) {
            return onGetMultiEndpointInterface(serviceId);
        }
    }

    private ImsServiceBinder mBinder;

    public ImsServiceBinder getBinder() {
        if (mBinder == null) {
            mBinder = new ImsServiceBinder();
        }

        return mBinder;
    }

    protected int onOpen(int phoneId, int serviceClass, PendingIntent incomingCallIntent,
                    IImsRegistrationListener listener) {
        // no-op

        return 0; // DUMMY VALUE
    }

    protected void onClose(int serviceId) {
        // no-op
    }

    protected boolean onIsConnected(int serviceId, int serviceType, int callType) {
        // no-op

        return false; // DUMMY VALUE
    }

    protected boolean onIsOpened(int serviceId) {
        // no-op

        return false; // DUMMY VALUE
    }

    protected void onSetRegistrationListener(int serviceId, IImsRegistrationListener listener) {
        // no-op
    }

    protected void onAddRegistrationListener(int serviceId, int serviceType, IImsRegistrationListener listener) {
        // no-op
    }

    protected ImsCallProfile onCreateCallProfile(int serviceId, int serviceType, int callType) {
        // no-op

        return null;
    }

    protected IImsCallSession onCreateCallSession(int serviceId, ImsCallProfile profile,
                                             IImsCallSessionListener listener) {
        // no-op

        return null;
    }

    protected IImsCallSession onGetPendingCallSession(int serviceId, String callId) {
        // no-op

        return null;
    }

    protected IImsUt onGetUtInterface(int serviceId) {
        // no-op

        return null;
    }

    protected IImsConfig onGetConfigInterface(int phoneId) {
        // no-op

        return null;
    }

    protected void onTurnOnIms(int phoneId) {
        // no-op
    }

    protected void onTurnOffIms(int phoneId) {
        // no-op
    }

    protected IImsEcbm onGetEcbmInterface(int serviceId) {
        // no-op

        return null;
    }

    protected void onSetUiTTYMode(int serviceId, int uiTtyMode, Message onComplete) {
        // no-op
    }

    protected IImsMultiEndpoint onGetMultiEndpointInterface(int serviceId) {
        // no-op
        return null;
    }
}