Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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 | R* limitations under the License. |
| 15 | */ |
| 16 | |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 17 | package android.telecom; |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 18 | |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 19 | import android.net.Uri; |
| 20 | import android.os.Handler; |
| 21 | import android.os.Message; |
| 22 | import android.os.RemoteException; |
| 23 | |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 24 | import com.android.internal.os.SomeArgs; |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 25 | import com.android.internal.telecom.IConnectionServiceAdapter; |
| 26 | import com.android.internal.telecom.IVideoProvider; |
| 27 | import com.android.internal.telecom.RemoteServiceCallback; |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 28 | |
| 29 | import java.util.List; |
| 30 | |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 31 | /** |
| 32 | * A component that provides an RPC servant implementation of {@link IConnectionServiceAdapter}, |
| 33 | * posting incoming messages on the main thread on a client-supplied delegate object. |
| 34 | * |
| 35 | * TODO: Generate this and similar classes using a compiler starting from AIDL interfaces. |
| 36 | * |
| 37 | * @hide |
| 38 | */ |
| 39 | final class ConnectionServiceAdapterServant { |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 40 | private static final int MSG_HANDLE_CREATE_CONNECTION_COMPLETE = 1; |
| 41 | private static final int MSG_SET_ACTIVE = 2; |
| 42 | private static final int MSG_SET_RINGING = 3; |
| 43 | private static final int MSG_SET_DIALING = 4; |
| 44 | private static final int MSG_SET_DISCONNECTED = 5; |
| 45 | private static final int MSG_SET_ON_HOLD = 6; |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 46 | private static final int MSG_SET_RINGBACK_REQUESTED = 7; |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 47 | private static final int MSG_SET_CONNECTION_CAPABILITIES = 8; |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 48 | private static final int MSG_SET_IS_CONFERENCED = 9; |
| 49 | private static final int MSG_ADD_CONFERENCE_CALL = 10; |
| 50 | private static final int MSG_REMOVE_CALL = 11; |
| 51 | private static final int MSG_ON_POST_DIAL_WAIT = 12; |
| 52 | private static final int MSG_QUERY_REMOTE_CALL_SERVICES = 13; |
| 53 | private static final int MSG_SET_VIDEO_STATE = 14; |
| 54 | private static final int MSG_SET_VIDEO_CALL_PROVIDER = 15; |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 55 | private static final int MSG_SET_IS_VOIP_AUDIO_MODE = 16; |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 56 | private static final int MSG_SET_STATUS_HINTS = 17; |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 57 | private static final int MSG_SET_ADDRESS = 18; |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 58 | private static final int MSG_SET_CALLER_DISPLAY_NAME = 19; |
Evan Charlton | 23dc241 | 2014-09-03 10:07:03 -0700 | [diff] [blame] | 59 | private static final int MSG_SET_CONFERENCEABLE_CONNECTIONS = 20; |
Tyler Gunn | 4a57b9b | 2014-10-30 14:27:48 -0700 | [diff] [blame] | 60 | private static final int MSG_ADD_EXISTING_CONNECTION = 21; |
Nancy Chen | 27d1c2d | 2014-12-15 16:12:50 -0800 | [diff] [blame] | 61 | private static final int MSG_ON_POST_DIAL_CHAR = 22; |
Anthony Lee | 17455a3 | 2015-04-24 15:25:29 -0700 | [diff] [blame^] | 62 | private static final int MSG_SET_CONFERENCE_MERGE_FAILED = 23; |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 63 | |
| 64 | private final IConnectionServiceAdapter mDelegate; |
| 65 | |
| 66 | private final Handler mHandler = new Handler() { |
| 67 | @Override |
| 68 | public void handleMessage(Message msg) { |
| 69 | try { |
| 70 | internalHandleMessage(msg); |
| 71 | } catch (RemoteException e) { |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | // Internal method defined to centralize handling of RemoteException |
| 76 | private void internalHandleMessage(Message msg) throws RemoteException { |
| 77 | switch (msg.what) { |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 78 | case MSG_HANDLE_CREATE_CONNECTION_COMPLETE: { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 79 | SomeArgs args = (SomeArgs) msg.obj; |
| 80 | try { |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 81 | mDelegate.handleCreateConnectionComplete( |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 82 | (String) args.arg1, |
| 83 | (ConnectionRequest) args.arg2, |
| 84 | (ParcelableConnection) args.arg3); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 85 | } finally { |
| 86 | args.recycle(); |
| 87 | } |
| 88 | break; |
| 89 | } |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 90 | case MSG_SET_ACTIVE: |
| 91 | mDelegate.setActive((String) msg.obj); |
| 92 | break; |
| 93 | case MSG_SET_RINGING: |
| 94 | mDelegate.setRinging((String) msg.obj); |
| 95 | break; |
| 96 | case MSG_SET_DIALING: |
| 97 | mDelegate.setDialing((String) msg.obj); |
| 98 | break; |
| 99 | case MSG_SET_DISCONNECTED: { |
| 100 | SomeArgs args = (SomeArgs) msg.obj; |
| 101 | try { |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 102 | mDelegate.setDisconnected((String) args.arg1, (DisconnectCause) args.arg2); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 103 | } finally { |
| 104 | args.recycle(); |
| 105 | } |
| 106 | break; |
| 107 | } |
| 108 | case MSG_SET_ON_HOLD: |
| 109 | mDelegate.setOnHold((String) msg.obj); |
| 110 | break; |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 111 | case MSG_SET_RINGBACK_REQUESTED: |
| 112 | mDelegate.setRingbackRequested((String) msg.obj, msg.arg1 == 1); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 113 | break; |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 114 | case MSG_SET_CONNECTION_CAPABILITIES: |
| 115 | mDelegate.setConnectionCapabilities((String) msg.obj, msg.arg1); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 116 | break; |
| 117 | case MSG_SET_IS_CONFERENCED: { |
| 118 | SomeArgs args = (SomeArgs) msg.obj; |
| 119 | try { |
| 120 | mDelegate.setIsConferenced((String) args.arg1, (String) args.arg2); |
| 121 | } finally { |
| 122 | args.recycle(); |
| 123 | } |
| 124 | break; |
| 125 | } |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 126 | case MSG_ADD_CONFERENCE_CALL: { |
| 127 | SomeArgs args = (SomeArgs) msg.obj; |
| 128 | try { |
| 129 | mDelegate.addConferenceCall( |
| 130 | (String) args.arg1, (ParcelableConference) args.arg2); |
| 131 | } finally { |
| 132 | args.recycle(); |
| 133 | } |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 134 | break; |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 135 | } |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 136 | case MSG_REMOVE_CALL: |
| 137 | mDelegate.removeCall((String) msg.obj); |
| 138 | break; |
| 139 | case MSG_ON_POST_DIAL_WAIT: { |
| 140 | SomeArgs args = (SomeArgs) msg.obj; |
| 141 | try { |
| 142 | mDelegate.onPostDialWait((String) args.arg1, (String) args.arg2); |
| 143 | } finally { |
| 144 | args.recycle(); |
| 145 | } |
| 146 | break; |
| 147 | } |
Nancy Chen | 27d1c2d | 2014-12-15 16:12:50 -0800 | [diff] [blame] | 148 | case MSG_ON_POST_DIAL_CHAR: { |
| 149 | SomeArgs args = (SomeArgs) msg.obj; |
| 150 | try { |
| 151 | mDelegate.onPostDialChar((String) args.arg1, (char) args.argi1); |
| 152 | } finally { |
| 153 | args.recycle(); |
| 154 | } |
| 155 | break; |
| 156 | } |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 157 | case MSG_QUERY_REMOTE_CALL_SERVICES: |
| 158 | mDelegate.queryRemoteConnectionServices((RemoteServiceCallback) msg.obj); |
| 159 | break; |
| 160 | case MSG_SET_VIDEO_STATE: |
| 161 | mDelegate.setVideoState((String) msg.obj, msg.arg1); |
| 162 | break; |
| 163 | case MSG_SET_VIDEO_CALL_PROVIDER: { |
| 164 | SomeArgs args = (SomeArgs) msg.obj; |
| 165 | try { |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 166 | mDelegate.setVideoProvider((String) args.arg1, |
| 167 | (IVideoProvider) args.arg2); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 168 | } finally { |
| 169 | args.recycle(); |
| 170 | } |
| 171 | break; |
| 172 | } |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 173 | case MSG_SET_IS_VOIP_AUDIO_MODE: |
| 174 | mDelegate.setIsVoipAudioMode((String) msg.obj, msg.arg1 == 1); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 175 | break; |
| 176 | case MSG_SET_STATUS_HINTS: { |
| 177 | SomeArgs args = (SomeArgs) msg.obj; |
| 178 | try { |
| 179 | mDelegate.setStatusHints((String) args.arg1, (StatusHints) args.arg2); |
| 180 | } finally { |
| 181 | args.recycle(); |
| 182 | } |
| 183 | break; |
| 184 | } |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 185 | case MSG_SET_ADDRESS: { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 186 | SomeArgs args = (SomeArgs) msg.obj; |
| 187 | try { |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 188 | mDelegate.setAddress((String) args.arg1, (Uri) args.arg2, args.argi1); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 189 | } finally { |
| 190 | args.recycle(); |
| 191 | } |
| 192 | break; |
| 193 | } |
| 194 | case MSG_SET_CALLER_DISPLAY_NAME: { |
| 195 | SomeArgs args = (SomeArgs) msg.obj; |
| 196 | try { |
| 197 | mDelegate.setCallerDisplayName( |
| 198 | (String) args.arg1, (String) args.arg2, args.argi1); |
| 199 | } finally { |
| 200 | args.recycle(); |
| 201 | } |
| 202 | break; |
| 203 | } |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 204 | case MSG_SET_CONFERENCEABLE_CONNECTIONS: { |
| 205 | SomeArgs args = (SomeArgs) msg.obj; |
| 206 | try { |
| 207 | mDelegate.setConferenceableConnections( |
| 208 | (String) args.arg1, (List<String>) args.arg2); |
| 209 | } finally { |
| 210 | args.recycle(); |
| 211 | } |
| 212 | break; |
| 213 | } |
Tyler Gunn | 4a57b9b | 2014-10-30 14:27:48 -0700 | [diff] [blame] | 214 | case MSG_ADD_EXISTING_CONNECTION: { |
| 215 | SomeArgs args = (SomeArgs) msg.obj; |
| 216 | try { |
| 217 | mDelegate.addExistingConnection( |
| 218 | (String) args.arg1, (ParcelableConnection) args.arg2); |
| 219 | } finally { |
| 220 | args.recycle(); |
| 221 | } |
| 222 | break; |
| 223 | } |
Anthony Lee | 17455a3 | 2015-04-24 15:25:29 -0700 | [diff] [blame^] | 224 | case MSG_SET_CONFERENCE_MERGE_FAILED: { |
| 225 | SomeArgs args = (SomeArgs) msg.obj; |
| 226 | try { |
| 227 | mDelegate.setConferenceMergeFailed((String) args.arg1); |
| 228 | } finally { |
| 229 | args.recycle(); |
| 230 | } |
| 231 | break; |
| 232 | } |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 233 | } |
| 234 | } |
| 235 | }; |
| 236 | |
| 237 | private final IConnectionServiceAdapter mStub = new IConnectionServiceAdapter.Stub() { |
| 238 | @Override |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 239 | public void handleCreateConnectionComplete( |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 240 | String id, |
| 241 | ConnectionRequest request, |
| 242 | ParcelableConnection connection) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 243 | SomeArgs args = SomeArgs.obtain(); |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 244 | args.arg1 = id; |
| 245 | args.arg2 = request; |
| 246 | args.arg3 = connection; |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 247 | mHandler.obtainMessage(MSG_HANDLE_CREATE_CONNECTION_COMPLETE, args).sendToTarget(); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 248 | } |
| 249 | |
| 250 | @Override |
| 251 | public void setActive(String connectionId) { |
| 252 | mHandler.obtainMessage(MSG_SET_ACTIVE, connectionId).sendToTarget(); |
| 253 | } |
| 254 | |
| 255 | @Override |
| 256 | public void setRinging(String connectionId) { |
| 257 | mHandler.obtainMessage(MSG_SET_RINGING, connectionId).sendToTarget(); |
| 258 | } |
| 259 | |
| 260 | @Override |
| 261 | public void setDialing(String connectionId) { |
| 262 | mHandler.obtainMessage(MSG_SET_DIALING, connectionId).sendToTarget(); |
| 263 | } |
| 264 | |
| 265 | @Override |
| 266 | public void setDisconnected( |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 267 | String connectionId, DisconnectCause disconnectCause) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 268 | SomeArgs args = SomeArgs.obtain(); |
| 269 | args.arg1 = connectionId; |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 270 | args.arg2 = disconnectCause; |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 271 | mHandler.obtainMessage(MSG_SET_DISCONNECTED, args).sendToTarget(); |
| 272 | } |
| 273 | |
| 274 | @Override |
| 275 | public void setOnHold(String connectionId) { |
| 276 | mHandler.obtainMessage(MSG_SET_ON_HOLD, connectionId).sendToTarget(); |
| 277 | } |
| 278 | |
| 279 | @Override |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 280 | public void setRingbackRequested(String connectionId, boolean ringback) { |
| 281 | mHandler.obtainMessage(MSG_SET_RINGBACK_REQUESTED, ringback ? 1 : 0, 0, connectionId) |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 282 | .sendToTarget(); |
| 283 | } |
| 284 | |
| 285 | @Override |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 286 | public void setConnectionCapabilities(String connectionId, int connectionCapabilities) { |
| 287 | mHandler.obtainMessage( |
| 288 | MSG_SET_CONNECTION_CAPABILITIES, connectionCapabilities, 0, connectionId) |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 289 | .sendToTarget(); |
| 290 | } |
| 291 | |
| 292 | @Override |
Anthony Lee | 17455a3 | 2015-04-24 15:25:29 -0700 | [diff] [blame^] | 293 | public void setConferenceMergeFailed(String callId) { |
| 294 | SomeArgs args = SomeArgs.obtain(); |
| 295 | args.arg1 = callId; |
| 296 | mHandler.obtainMessage(MSG_SET_CONFERENCE_MERGE_FAILED, args).sendToTarget(); |
| 297 | } |
| 298 | |
| 299 | @Override |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 300 | public void setIsConferenced(String callId, String conferenceCallId) { |
| 301 | SomeArgs args = SomeArgs.obtain(); |
| 302 | args.arg1 = callId; |
| 303 | args.arg2 = conferenceCallId; |
| 304 | mHandler.obtainMessage(MSG_SET_IS_CONFERENCED, args).sendToTarget(); |
| 305 | } |
| 306 | |
| 307 | @Override |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 308 | public void addConferenceCall(String callId, ParcelableConference parcelableConference) { |
| 309 | SomeArgs args = SomeArgs.obtain(); |
| 310 | args.arg1 = callId; |
| 311 | args.arg2 = parcelableConference; |
| 312 | mHandler.obtainMessage(MSG_ADD_CONFERENCE_CALL, args).sendToTarget(); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 313 | } |
| 314 | |
| 315 | @Override |
| 316 | public void removeCall(String connectionId) { |
| 317 | mHandler.obtainMessage(MSG_REMOVE_CALL, connectionId).sendToTarget(); |
| 318 | } |
| 319 | |
| 320 | @Override |
| 321 | public void onPostDialWait(String connectionId, String remainingDigits) { |
| 322 | SomeArgs args = SomeArgs.obtain(); |
| 323 | args.arg1 = connectionId; |
| 324 | args.arg2 = remainingDigits; |
| 325 | mHandler.obtainMessage(MSG_ON_POST_DIAL_WAIT, args).sendToTarget(); |
| 326 | } |
| 327 | |
| 328 | @Override |
Nancy Chen | 27d1c2d | 2014-12-15 16:12:50 -0800 | [diff] [blame] | 329 | public void onPostDialChar(String connectionId, char nextChar) { |
| 330 | SomeArgs args = SomeArgs.obtain(); |
| 331 | args.arg1 = connectionId; |
| 332 | args.argi1 = nextChar; |
| 333 | mHandler.obtainMessage(MSG_ON_POST_DIAL_CHAR, args).sendToTarget(); |
| 334 | } |
| 335 | |
| 336 | @Override |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 337 | public void queryRemoteConnectionServices(RemoteServiceCallback callback) { |
| 338 | mHandler.obtainMessage(MSG_QUERY_REMOTE_CALL_SERVICES, callback).sendToTarget(); |
| 339 | } |
| 340 | |
| 341 | @Override |
| 342 | public void setVideoState(String connectionId, int videoState) { |
| 343 | mHandler.obtainMessage(MSG_SET_VIDEO_STATE, videoState, 0, connectionId).sendToTarget(); |
| 344 | } |
| 345 | |
| 346 | @Override |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 347 | public void setVideoProvider(String connectionId, IVideoProvider videoProvider) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 348 | SomeArgs args = SomeArgs.obtain(); |
| 349 | args.arg1 = connectionId; |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 350 | args.arg2 = videoProvider; |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 351 | mHandler.obtainMessage(MSG_SET_VIDEO_CALL_PROVIDER, args).sendToTarget(); |
| 352 | } |
| 353 | |
| 354 | @Override |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 355 | public final void setIsVoipAudioMode(String connectionId, boolean isVoip) { |
| 356 | mHandler.obtainMessage(MSG_SET_IS_VOIP_AUDIO_MODE, isVoip ? 1 : 0, 0, |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 357 | connectionId).sendToTarget(); |
| 358 | } |
| 359 | |
| 360 | @Override |
| 361 | public final void setStatusHints(String connectionId, StatusHints statusHints) { |
| 362 | SomeArgs args = SomeArgs.obtain(); |
| 363 | args.arg1 = connectionId; |
| 364 | args.arg2 = statusHints; |
| 365 | mHandler.obtainMessage(MSG_SET_STATUS_HINTS, args).sendToTarget(); |
| 366 | } |
| 367 | |
| 368 | @Override |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 369 | public final void setAddress(String connectionId, Uri address, int presentation) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 370 | SomeArgs args = SomeArgs.obtain(); |
| 371 | args.arg1 = connectionId; |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 372 | args.arg2 = address; |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 373 | args.argi1 = presentation; |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 374 | mHandler.obtainMessage(MSG_SET_ADDRESS, args).sendToTarget(); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 375 | } |
| 376 | |
| 377 | @Override |
| 378 | public final void setCallerDisplayName( |
| 379 | String connectionId, String callerDisplayName, int presentation) { |
| 380 | SomeArgs args = SomeArgs.obtain(); |
| 381 | args.arg1 = connectionId; |
| 382 | args.arg2 = callerDisplayName; |
| 383 | args.argi1 = presentation; |
| 384 | mHandler.obtainMessage(MSG_SET_CALLER_DISPLAY_NAME, args).sendToTarget(); |
| 385 | } |
| 386 | |
| 387 | @Override |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 388 | public final void setConferenceableConnections( |
| 389 | String connectionId, List<String> conferenceableConnectionIds) { |
| 390 | SomeArgs args = SomeArgs.obtain(); |
| 391 | args.arg1 = connectionId; |
| 392 | args.arg2 = conferenceableConnectionIds; |
| 393 | mHandler.obtainMessage(MSG_SET_CONFERENCEABLE_CONNECTIONS, args).sendToTarget(); |
| 394 | } |
Tyler Gunn | 4a57b9b | 2014-10-30 14:27:48 -0700 | [diff] [blame] | 395 | |
| 396 | @Override |
| 397 | public final void addExistingConnection( |
| 398 | String connectionId, ParcelableConnection connection) { |
| 399 | SomeArgs args = SomeArgs.obtain(); |
| 400 | args.arg1 = connectionId; |
| 401 | args.arg2 = connection; |
| 402 | mHandler.obtainMessage(MSG_ADD_EXISTING_CONNECTION, args).sendToTarget(); |
| 403 | } |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 404 | }; |
| 405 | |
| 406 | public ConnectionServiceAdapterServant(IConnectionServiceAdapter delegate) { |
| 407 | mDelegate = delegate; |
| 408 | } |
| 409 | |
| 410 | public IConnectionServiceAdapter getStub() { |
| 411 | return mStub; |
| 412 | } |
| 413 | } |