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; |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 20 | import android.os.Bundle; |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 21 | import android.os.Handler; |
| 22 | import android.os.Message; |
| 23 | import android.os.RemoteException; |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 24 | import android.telecom.Logging.Session; |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 25 | |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 26 | import com.android.internal.os.SomeArgs; |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 27 | import com.android.internal.telecom.IConnectionServiceAdapter; |
| 28 | import com.android.internal.telecom.IVideoProvider; |
| 29 | import com.android.internal.telecom.RemoteServiceCallback; |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 30 | |
| 31 | import java.util.List; |
| 32 | |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 33 | /** |
| 34 | * A component that provides an RPC servant implementation of {@link IConnectionServiceAdapter}, |
| 35 | * posting incoming messages on the main thread on a client-supplied delegate object. |
| 36 | * |
| 37 | * TODO: Generate this and similar classes using a compiler starting from AIDL interfaces. |
| 38 | * |
| 39 | * @hide |
| 40 | */ |
| 41 | final class ConnectionServiceAdapterServant { |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 42 | private static final int MSG_HANDLE_CREATE_CONNECTION_COMPLETE = 1; |
| 43 | private static final int MSG_SET_ACTIVE = 2; |
| 44 | private static final int MSG_SET_RINGING = 3; |
| 45 | private static final int MSG_SET_DIALING = 4; |
| 46 | private static final int MSG_SET_DISCONNECTED = 5; |
| 47 | private static final int MSG_SET_ON_HOLD = 6; |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 48 | private static final int MSG_SET_RINGBACK_REQUESTED = 7; |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 49 | private static final int MSG_SET_CONNECTION_CAPABILITIES = 8; |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 50 | private static final int MSG_SET_IS_CONFERENCED = 9; |
| 51 | private static final int MSG_ADD_CONFERENCE_CALL = 10; |
| 52 | private static final int MSG_REMOVE_CALL = 11; |
| 53 | private static final int MSG_ON_POST_DIAL_WAIT = 12; |
| 54 | private static final int MSG_QUERY_REMOTE_CALL_SERVICES = 13; |
| 55 | private static final int MSG_SET_VIDEO_STATE = 14; |
| 56 | private static final int MSG_SET_VIDEO_CALL_PROVIDER = 15; |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 57 | private static final int MSG_SET_IS_VOIP_AUDIO_MODE = 16; |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 58 | private static final int MSG_SET_STATUS_HINTS = 17; |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 59 | private static final int MSG_SET_ADDRESS = 18; |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 60 | private static final int MSG_SET_CALLER_DISPLAY_NAME = 19; |
Evan Charlton | 23dc241 | 2014-09-03 10:07:03 -0700 | [diff] [blame] | 61 | private static final int MSG_SET_CONFERENCEABLE_CONNECTIONS = 20; |
Tyler Gunn | 4a57b9b | 2014-10-30 14:27:48 -0700 | [diff] [blame] | 62 | private static final int MSG_ADD_EXISTING_CONNECTION = 21; |
Nancy Chen | 27d1c2d | 2014-12-15 16:12:50 -0800 | [diff] [blame] | 63 | private static final int MSG_ON_POST_DIAL_CHAR = 22; |
Anthony Lee | 17455a3 | 2015-04-24 15:25:29 -0700 | [diff] [blame] | 64 | private static final int MSG_SET_CONFERENCE_MERGE_FAILED = 23; |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 65 | private static final int MSG_PUT_EXTRAS = 24; |
| 66 | private static final int MSG_REMOVE_EXTRAS = 25; |
| 67 | private static final int MSG_ON_CONNECTION_EVENT = 26; |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 68 | private static final int MSG_SET_CONNECTION_PROPERTIES = 27; |
Tyler Gunn | c96b5e0 | 2016-07-07 22:53:57 -0700 | [diff] [blame] | 69 | private static final int MSG_SET_PULLING = 28; |
Tyler Gunn | f503543 | 2017-01-09 09:43:12 -0800 | [diff] [blame] | 70 | private static final int MSG_SET_AUDIO_ROUTE = 29; |
Hall Liu | 57006aa | 2017-02-06 10:49:48 -0800 | [diff] [blame] | 71 | private static final int MSG_ON_RTT_INITIATION_SUCCESS = 30; |
| 72 | private static final int MSG_ON_RTT_INITIATION_FAILURE = 31; |
| 73 | private static final int MSG_ON_RTT_REMOTELY_TERMINATED = 32; |
| 74 | private static final int MSG_ON_RTT_UPGRADE_REQUEST = 33; |
Srikanth Chintala | fcb1501 | 2017-05-04 20:58:34 +0530 | [diff] [blame] | 75 | private static final int MSG_SET_PHONE_ACCOUNT_CHANGED = 34; |
Pengquan Meng | 63d25a5 | 2017-11-21 18:01:13 -0800 | [diff] [blame] | 76 | private static final int MSG_CONNECTION_SERVICE_FOCUS_RELEASED = 35; |
Tyler Gunn | 68a73a4 | 2018-10-03 15:38:57 -0700 | [diff] [blame] | 77 | private static final int MSG_SET_CONFERENCE_STATE = 36; |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 78 | |
| 79 | private final IConnectionServiceAdapter mDelegate; |
| 80 | |
| 81 | private final Handler mHandler = new Handler() { |
| 82 | @Override |
| 83 | public void handleMessage(Message msg) { |
| 84 | try { |
| 85 | internalHandleMessage(msg); |
| 86 | } catch (RemoteException e) { |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | // Internal method defined to centralize handling of RemoteException |
| 91 | private void internalHandleMessage(Message msg) throws RemoteException { |
| 92 | switch (msg.what) { |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 93 | case MSG_HANDLE_CREATE_CONNECTION_COMPLETE: { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 94 | SomeArgs args = (SomeArgs) msg.obj; |
| 95 | try { |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 96 | mDelegate.handleCreateConnectionComplete( |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 97 | (String) args.arg1, |
| 98 | (ConnectionRequest) args.arg2, |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 99 | (ParcelableConnection) args.arg3, |
| 100 | null /*Session.Info*/); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 101 | } finally { |
| 102 | args.recycle(); |
| 103 | } |
| 104 | break; |
| 105 | } |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 106 | case MSG_SET_ACTIVE: |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 107 | mDelegate.setActive((String) msg.obj, null /*Session.Info*/); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 108 | break; |
| 109 | case MSG_SET_RINGING: |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 110 | mDelegate.setRinging((String) msg.obj, null /*Session.Info*/); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 111 | break; |
| 112 | case MSG_SET_DIALING: |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 113 | mDelegate.setDialing((String) msg.obj, null /*Session.Info*/); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 114 | break; |
Tyler Gunn | c96b5e0 | 2016-07-07 22:53:57 -0700 | [diff] [blame] | 115 | case MSG_SET_PULLING: |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 116 | mDelegate.setPulling((String) msg.obj, null /*Session.Info*/); |
Tyler Gunn | c96b5e0 | 2016-07-07 22:53:57 -0700 | [diff] [blame] | 117 | break; |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 118 | case MSG_SET_DISCONNECTED: { |
| 119 | SomeArgs args = (SomeArgs) msg.obj; |
| 120 | try { |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 121 | mDelegate.setDisconnected((String) args.arg1, (DisconnectCause) args.arg2, |
| 122 | null /*Session.Info*/); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 123 | } finally { |
| 124 | args.recycle(); |
| 125 | } |
| 126 | break; |
| 127 | } |
| 128 | case MSG_SET_ON_HOLD: |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 129 | mDelegate.setOnHold((String) msg.obj, null /*Session.Info*/); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 130 | break; |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 131 | case MSG_SET_RINGBACK_REQUESTED: |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 132 | mDelegate.setRingbackRequested((String) msg.obj, msg.arg1 == 1, |
| 133 | null /*Session.Info*/); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 134 | break; |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 135 | case MSG_SET_CONNECTION_CAPABILITIES: |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 136 | mDelegate.setConnectionCapabilities((String) msg.obj, msg.arg1, |
| 137 | null /*Session.Info*/); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 138 | break; |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 139 | case MSG_SET_CONNECTION_PROPERTIES: |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 140 | mDelegate.setConnectionProperties((String) msg.obj, msg.arg1, |
| 141 | null /*Session.Info*/); |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 142 | break; |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 143 | case MSG_SET_IS_CONFERENCED: { |
| 144 | SomeArgs args = (SomeArgs) msg.obj; |
| 145 | try { |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 146 | mDelegate.setIsConferenced((String) args.arg1, (String) args.arg2, |
| 147 | null /*Session.Info*/); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 148 | } finally { |
| 149 | args.recycle(); |
| 150 | } |
| 151 | break; |
| 152 | } |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 153 | case MSG_ADD_CONFERENCE_CALL: { |
| 154 | SomeArgs args = (SomeArgs) msg.obj; |
| 155 | try { |
| 156 | mDelegate.addConferenceCall( |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 157 | (String) args.arg1, (ParcelableConference) args.arg2, |
| 158 | null /*Session.Info*/); |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 159 | } finally { |
| 160 | args.recycle(); |
| 161 | } |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 162 | break; |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 163 | } |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 164 | case MSG_REMOVE_CALL: |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 165 | mDelegate.removeCall((String) msg.obj, |
| 166 | null /*Session.Info*/); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 167 | break; |
| 168 | case MSG_ON_POST_DIAL_WAIT: { |
| 169 | SomeArgs args = (SomeArgs) msg.obj; |
| 170 | try { |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 171 | mDelegate.onPostDialWait((String) args.arg1, (String) args.arg2, |
| 172 | null /*Session.Info*/); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 173 | } finally { |
| 174 | args.recycle(); |
| 175 | } |
| 176 | break; |
| 177 | } |
Nancy Chen | 27d1c2d | 2014-12-15 16:12:50 -0800 | [diff] [blame] | 178 | case MSG_ON_POST_DIAL_CHAR: { |
| 179 | SomeArgs args = (SomeArgs) msg.obj; |
| 180 | try { |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 181 | mDelegate.onPostDialChar((String) args.arg1, (char) args.argi1, |
| 182 | null /*Session.Info*/); |
Nancy Chen | 27d1c2d | 2014-12-15 16:12:50 -0800 | [diff] [blame] | 183 | } finally { |
| 184 | args.recycle(); |
| 185 | } |
| 186 | break; |
| 187 | } |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 188 | case MSG_QUERY_REMOTE_CALL_SERVICES: |
Tyler Gunn | 4c69fb3 | 2019-05-17 10:49:16 -0700 | [diff] [blame] | 189 | SomeArgs args2 = (SomeArgs) msg.obj; |
| 190 | try { |
| 191 | mDelegate.queryRemoteConnectionServices((RemoteServiceCallback) args2.arg1, |
| 192 | (String) args2.arg2, null /*Session.Info*/); |
| 193 | } finally { |
| 194 | args2.recycle(); |
| 195 | } |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 196 | break; |
| 197 | case MSG_SET_VIDEO_STATE: |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 198 | mDelegate.setVideoState((String) msg.obj, msg.arg1, null /*Session.Info*/); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 199 | break; |
| 200 | case MSG_SET_VIDEO_CALL_PROVIDER: { |
| 201 | SomeArgs args = (SomeArgs) msg.obj; |
| 202 | try { |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 203 | mDelegate.setVideoProvider((String) args.arg1, |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 204 | (IVideoProvider) args.arg2, null /*Session.Info*/); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 205 | } finally { |
| 206 | args.recycle(); |
| 207 | } |
| 208 | break; |
| 209 | } |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 210 | case MSG_SET_IS_VOIP_AUDIO_MODE: |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 211 | mDelegate.setIsVoipAudioMode((String) msg.obj, msg.arg1 == 1, |
| 212 | null /*Session.Info*/); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 213 | break; |
| 214 | case MSG_SET_STATUS_HINTS: { |
| 215 | SomeArgs args = (SomeArgs) msg.obj; |
| 216 | try { |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 217 | mDelegate.setStatusHints((String) args.arg1, (StatusHints) args.arg2, |
| 218 | null /*Session.Info*/); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 219 | } finally { |
| 220 | args.recycle(); |
| 221 | } |
| 222 | break; |
| 223 | } |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 224 | case MSG_SET_ADDRESS: { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 225 | SomeArgs args = (SomeArgs) msg.obj; |
| 226 | try { |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 227 | mDelegate.setAddress((String) args.arg1, (Uri) args.arg2, args.argi1, |
| 228 | null /*Session.Info*/); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 229 | } finally { |
| 230 | args.recycle(); |
| 231 | } |
| 232 | break; |
| 233 | } |
| 234 | case MSG_SET_CALLER_DISPLAY_NAME: { |
| 235 | SomeArgs args = (SomeArgs) msg.obj; |
| 236 | try { |
| 237 | mDelegate.setCallerDisplayName( |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 238 | (String) args.arg1, (String) args.arg2, args.argi1, |
| 239 | null /*Session.Info*/); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 240 | } finally { |
| 241 | args.recycle(); |
| 242 | } |
| 243 | break; |
| 244 | } |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 245 | case MSG_SET_CONFERENCEABLE_CONNECTIONS: { |
| 246 | SomeArgs args = (SomeArgs) msg.obj; |
| 247 | try { |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 248 | mDelegate.setConferenceableConnections((String) args.arg1, |
| 249 | (List<String>) args.arg2, null /*Session.Info*/); |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 250 | } finally { |
| 251 | args.recycle(); |
| 252 | } |
| 253 | break; |
| 254 | } |
Tyler Gunn | 4a57b9b | 2014-10-30 14:27:48 -0700 | [diff] [blame] | 255 | case MSG_ADD_EXISTING_CONNECTION: { |
| 256 | SomeArgs args = (SomeArgs) msg.obj; |
| 257 | try { |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 258 | mDelegate.addExistingConnection((String) args.arg1, |
| 259 | (ParcelableConnection) args.arg2, null /*Session.Info*/); |
Tyler Gunn | 4a57b9b | 2014-10-30 14:27:48 -0700 | [diff] [blame] | 260 | } finally { |
| 261 | args.recycle(); |
| 262 | } |
| 263 | break; |
| 264 | } |
Anthony Lee | 17455a3 | 2015-04-24 15:25:29 -0700 | [diff] [blame] | 265 | case MSG_SET_CONFERENCE_MERGE_FAILED: { |
| 266 | SomeArgs args = (SomeArgs) msg.obj; |
| 267 | try { |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 268 | mDelegate.setConferenceMergeFailed((String) args.arg1, |
| 269 | null /*Session.Info*/); |
Anthony Lee | 17455a3 | 2015-04-24 15:25:29 -0700 | [diff] [blame] | 270 | } finally { |
| 271 | args.recycle(); |
| 272 | } |
| 273 | break; |
| 274 | } |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 275 | case MSG_PUT_EXTRAS: { |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 276 | SomeArgs args = (SomeArgs) msg.obj; |
| 277 | try { |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 278 | mDelegate.putExtras((String) args.arg1, (Bundle) args.arg2, |
| 279 | null /*Session.Info*/); |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 280 | } finally { |
| 281 | args.recycle(); |
| 282 | } |
| 283 | break; |
| 284 | } |
| 285 | case MSG_REMOVE_EXTRAS: { |
| 286 | SomeArgs args = (SomeArgs) msg.obj; |
| 287 | try { |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 288 | mDelegate.removeExtras((String) args.arg1, (List<String>) args.arg2, |
| 289 | null /*Session.Info*/); |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 290 | } finally { |
| 291 | args.recycle(); |
| 292 | } |
Tyler Gunn | 86c9fb4 | 2016-02-24 13:17:21 -0800 | [diff] [blame] | 293 | break; |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 294 | } |
Tyler Gunn | bd1eb1f | 2016-02-16 14:36:20 -0800 | [diff] [blame] | 295 | case MSG_ON_CONNECTION_EVENT: { |
| 296 | SomeArgs args = (SomeArgs) msg.obj; |
| 297 | try { |
Tyler Gunn | 876dbfb | 2016-03-14 15:18:07 -0700 | [diff] [blame] | 298 | mDelegate.onConnectionEvent((String) args.arg1, (String) args.arg2, |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 299 | (Bundle) args.arg3, null /*Session.Info*/); |
Tyler Gunn | bd1eb1f | 2016-02-16 14:36:20 -0800 | [diff] [blame] | 300 | } finally { |
| 301 | args.recycle(); |
| 302 | } |
Tyler Gunn | 86c9fb4 | 2016-02-24 13:17:21 -0800 | [diff] [blame] | 303 | break; |
Tyler Gunn | bd1eb1f | 2016-02-16 14:36:20 -0800 | [diff] [blame] | 304 | } |
Tyler Gunn | f503543 | 2017-01-09 09:43:12 -0800 | [diff] [blame] | 305 | case MSG_SET_AUDIO_ROUTE: { |
| 306 | SomeArgs args = (SomeArgs) msg.obj; |
| 307 | try { |
Hall Liu | a98f58b5 | 2017-11-07 17:59:28 -0800 | [diff] [blame] | 308 | mDelegate.setAudioRoute((String) args.arg1, args.argi1, (String) args.arg2, |
| 309 | (Session.Info) args.arg3); |
Tyler Gunn | f503543 | 2017-01-09 09:43:12 -0800 | [diff] [blame] | 310 | } finally { |
| 311 | args.recycle(); |
| 312 | } |
| 313 | break; |
| 314 | } |
Hall Liu | 57006aa | 2017-02-06 10:49:48 -0800 | [diff] [blame] | 315 | case MSG_ON_RTT_INITIATION_SUCCESS: |
| 316 | mDelegate.onRttInitiationSuccess((String) msg.obj, null /*Session.Info*/); |
| 317 | break; |
| 318 | case MSG_ON_RTT_INITIATION_FAILURE: |
| 319 | mDelegate.onRttInitiationFailure((String) msg.obj, msg.arg1, |
| 320 | null /*Session.Info*/); |
| 321 | break; |
| 322 | case MSG_ON_RTT_REMOTELY_TERMINATED: |
| 323 | mDelegate.onRttSessionRemotelyTerminated((String) msg.obj, |
| 324 | null /*Session.Info*/); |
| 325 | break; |
| 326 | case MSG_ON_RTT_UPGRADE_REQUEST: |
| 327 | mDelegate.onRemoteRttRequest((String) msg.obj, null /*Session.Info*/); |
| 328 | break; |
Srikanth Chintala | fcb1501 | 2017-05-04 20:58:34 +0530 | [diff] [blame] | 329 | case MSG_SET_PHONE_ACCOUNT_CHANGED: { |
| 330 | SomeArgs args = (SomeArgs) msg.obj; |
| 331 | try { |
| 332 | mDelegate.onPhoneAccountChanged((String) args.arg1, |
| 333 | (PhoneAccountHandle) args.arg2, null /*Session.Info*/); |
| 334 | } finally { |
| 335 | args.recycle(); |
| 336 | } |
| 337 | break; |
| 338 | } |
Pengquan Meng | 63d25a5 | 2017-11-21 18:01:13 -0800 | [diff] [blame] | 339 | case MSG_CONNECTION_SERVICE_FOCUS_RELEASED: |
| 340 | mDelegate.onConnectionServiceFocusReleased(null /*Session.Info*/); |
| 341 | break; |
Tyler Gunn | 68a73a4 | 2018-10-03 15:38:57 -0700 | [diff] [blame] | 342 | case MSG_SET_CONFERENCE_STATE: |
| 343 | SomeArgs args = (SomeArgs) msg.obj; |
| 344 | try { |
| 345 | mDelegate.setConferenceState((String) args.arg1, (Boolean) args.arg2, |
| 346 | (Session.Info) args.arg3); |
| 347 | } finally { |
| 348 | args.recycle(); |
| 349 | } |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 350 | } |
| 351 | } |
| 352 | }; |
| 353 | |
| 354 | private final IConnectionServiceAdapter mStub = new IConnectionServiceAdapter.Stub() { |
| 355 | @Override |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 356 | public void handleCreateConnectionComplete( |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 357 | String id, |
| 358 | ConnectionRequest request, |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 359 | ParcelableConnection connection, |
| 360 | Session.Info sessionInfo) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 361 | SomeArgs args = SomeArgs.obtain(); |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 362 | args.arg1 = id; |
| 363 | args.arg2 = request; |
| 364 | args.arg3 = connection; |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 365 | mHandler.obtainMessage(MSG_HANDLE_CREATE_CONNECTION_COMPLETE, args).sendToTarget(); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 366 | } |
| 367 | |
| 368 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 369 | public void setActive(String connectionId, Session.Info sessionInfo) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 370 | mHandler.obtainMessage(MSG_SET_ACTIVE, connectionId).sendToTarget(); |
| 371 | } |
| 372 | |
| 373 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 374 | public void setRinging(String connectionId, Session.Info sessionInfo) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 375 | mHandler.obtainMessage(MSG_SET_RINGING, connectionId).sendToTarget(); |
| 376 | } |
| 377 | |
| 378 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 379 | public void setDialing(String connectionId, Session.Info sessionInfo) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 380 | mHandler.obtainMessage(MSG_SET_DIALING, connectionId).sendToTarget(); |
| 381 | } |
| 382 | |
| 383 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 384 | public void setPulling(String connectionId, Session.Info sessionInfo) { |
Tyler Gunn | c96b5e0 | 2016-07-07 22:53:57 -0700 | [diff] [blame] | 385 | mHandler.obtainMessage(MSG_SET_PULLING, connectionId).sendToTarget(); |
| 386 | } |
| 387 | |
| 388 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 389 | public void setDisconnected(String connectionId, DisconnectCause disconnectCause, |
| 390 | Session.Info sessionInfo) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 391 | SomeArgs args = SomeArgs.obtain(); |
| 392 | args.arg1 = connectionId; |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 393 | args.arg2 = disconnectCause; |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 394 | mHandler.obtainMessage(MSG_SET_DISCONNECTED, args).sendToTarget(); |
| 395 | } |
| 396 | |
| 397 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 398 | public void setOnHold(String connectionId, Session.Info sessionInfo) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 399 | mHandler.obtainMessage(MSG_SET_ON_HOLD, connectionId).sendToTarget(); |
| 400 | } |
| 401 | |
| 402 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 403 | public void setRingbackRequested(String connectionId, boolean ringback, |
| 404 | Session.Info sessionInfo) { |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 405 | mHandler.obtainMessage(MSG_SET_RINGBACK_REQUESTED, ringback ? 1 : 0, 0, connectionId) |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 406 | .sendToTarget(); |
| 407 | } |
| 408 | |
| 409 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 410 | public void setConnectionCapabilities(String connectionId, int connectionCapabilities, |
| 411 | Session.Info sessionInfo) { |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 412 | mHandler.obtainMessage( |
| 413 | MSG_SET_CONNECTION_CAPABILITIES, connectionCapabilities, 0, connectionId) |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 414 | .sendToTarget(); |
| 415 | } |
| 416 | |
| 417 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 418 | public void setConnectionProperties(String connectionId, int connectionProperties, |
| 419 | Session.Info sessionInfo) { |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 420 | mHandler.obtainMessage( |
| 421 | MSG_SET_CONNECTION_PROPERTIES, connectionProperties, 0, connectionId) |
| 422 | .sendToTarget(); |
| 423 | } |
| 424 | |
| 425 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 426 | public void setConferenceMergeFailed(String callId, Session.Info sessionInfo) { |
Anthony Lee | 17455a3 | 2015-04-24 15:25:29 -0700 | [diff] [blame] | 427 | SomeArgs args = SomeArgs.obtain(); |
| 428 | args.arg1 = callId; |
| 429 | mHandler.obtainMessage(MSG_SET_CONFERENCE_MERGE_FAILED, args).sendToTarget(); |
| 430 | } |
| 431 | |
| 432 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 433 | public void setIsConferenced(String callId, String conferenceCallId, |
| 434 | Session.Info sessionInfo) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 435 | SomeArgs args = SomeArgs.obtain(); |
| 436 | args.arg1 = callId; |
| 437 | args.arg2 = conferenceCallId; |
| 438 | mHandler.obtainMessage(MSG_SET_IS_CONFERENCED, args).sendToTarget(); |
| 439 | } |
| 440 | |
| 441 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 442 | public void addConferenceCall(String callId, ParcelableConference parcelableConference, |
| 443 | Session.Info sessionInfo) { |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 444 | SomeArgs args = SomeArgs.obtain(); |
| 445 | args.arg1 = callId; |
| 446 | args.arg2 = parcelableConference; |
| 447 | mHandler.obtainMessage(MSG_ADD_CONFERENCE_CALL, args).sendToTarget(); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 448 | } |
| 449 | |
| 450 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 451 | public void removeCall(String connectionId, |
| 452 | Session.Info sessionInfo) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 453 | mHandler.obtainMessage(MSG_REMOVE_CALL, connectionId).sendToTarget(); |
| 454 | } |
| 455 | |
| 456 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 457 | public void onPostDialWait(String connectionId, String remainingDigits, |
| 458 | Session.Info sessionInfo) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 459 | SomeArgs args = SomeArgs.obtain(); |
| 460 | args.arg1 = connectionId; |
| 461 | args.arg2 = remainingDigits; |
| 462 | mHandler.obtainMessage(MSG_ON_POST_DIAL_WAIT, args).sendToTarget(); |
| 463 | } |
| 464 | |
| 465 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 466 | public void onPostDialChar(String connectionId, char nextChar, |
| 467 | Session.Info sessionInfo) { |
Nancy Chen | 27d1c2d | 2014-12-15 16:12:50 -0800 | [diff] [blame] | 468 | SomeArgs args = SomeArgs.obtain(); |
| 469 | args.arg1 = connectionId; |
| 470 | args.argi1 = nextChar; |
| 471 | mHandler.obtainMessage(MSG_ON_POST_DIAL_CHAR, args).sendToTarget(); |
| 472 | } |
| 473 | |
| 474 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 475 | public void queryRemoteConnectionServices(RemoteServiceCallback callback, |
Tyler Gunn | 4c69fb3 | 2019-05-17 10:49:16 -0700 | [diff] [blame] | 476 | String callingPackage, Session.Info sessionInfo) { |
| 477 | SomeArgs args = SomeArgs.obtain(); |
| 478 | args.arg1 = callback; |
| 479 | args.arg2 = callingPackage; |
Tyler Gunn | 156a33b | 2019-05-30 16:52:28 -0700 | [diff] [blame] | 480 | mHandler.obtainMessage(MSG_QUERY_REMOTE_CALL_SERVICES, args).sendToTarget(); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 481 | } |
| 482 | |
| 483 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 484 | public void setVideoState(String connectionId, int videoState, |
| 485 | Session.Info sessionInfo) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 486 | mHandler.obtainMessage(MSG_SET_VIDEO_STATE, videoState, 0, connectionId).sendToTarget(); |
| 487 | } |
| 488 | |
| 489 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 490 | public void setVideoProvider(String connectionId, IVideoProvider videoProvider, |
| 491 | Session.Info sessionInfo) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 492 | SomeArgs args = SomeArgs.obtain(); |
| 493 | args.arg1 = connectionId; |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 494 | args.arg2 = videoProvider; |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 495 | mHandler.obtainMessage(MSG_SET_VIDEO_CALL_PROVIDER, args).sendToTarget(); |
| 496 | } |
| 497 | |
| 498 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 499 | public final void setIsVoipAudioMode(String connectionId, boolean isVoip, |
| 500 | Session.Info sessionInfo) { |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 501 | mHandler.obtainMessage(MSG_SET_IS_VOIP_AUDIO_MODE, isVoip ? 1 : 0, 0, |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 502 | connectionId).sendToTarget(); |
| 503 | } |
| 504 | |
| 505 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 506 | public final void setStatusHints(String connectionId, StatusHints statusHints, |
| 507 | Session.Info sessionInfo) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 508 | SomeArgs args = SomeArgs.obtain(); |
| 509 | args.arg1 = connectionId; |
| 510 | args.arg2 = statusHints; |
| 511 | mHandler.obtainMessage(MSG_SET_STATUS_HINTS, args).sendToTarget(); |
| 512 | } |
| 513 | |
| 514 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 515 | public final void setAddress(String connectionId, Uri address, int presentation, |
| 516 | Session.Info sessionInfo) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 517 | SomeArgs args = SomeArgs.obtain(); |
| 518 | args.arg1 = connectionId; |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 519 | args.arg2 = address; |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 520 | args.argi1 = presentation; |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 521 | mHandler.obtainMessage(MSG_SET_ADDRESS, args).sendToTarget(); |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 522 | } |
| 523 | |
| 524 | @Override |
| 525 | public final void setCallerDisplayName( |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 526 | String connectionId, String callerDisplayName, int presentation, |
| 527 | Session.Info sessionInfo) { |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 528 | SomeArgs args = SomeArgs.obtain(); |
| 529 | args.arg1 = connectionId; |
| 530 | args.arg2 = callerDisplayName; |
| 531 | args.argi1 = presentation; |
| 532 | mHandler.obtainMessage(MSG_SET_CALLER_DISPLAY_NAME, args).sendToTarget(); |
| 533 | } |
| 534 | |
| 535 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 536 | public final void setConferenceableConnections(String connectionId, |
| 537 | List<String> conferenceableConnectionIds, Session.Info sessionInfo) { |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 538 | SomeArgs args = SomeArgs.obtain(); |
| 539 | args.arg1 = connectionId; |
| 540 | args.arg2 = conferenceableConnectionIds; |
| 541 | mHandler.obtainMessage(MSG_SET_CONFERENCEABLE_CONNECTIONS, args).sendToTarget(); |
| 542 | } |
Tyler Gunn | 4a57b9b | 2014-10-30 14:27:48 -0700 | [diff] [blame] | 543 | |
| 544 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 545 | public final void addExistingConnection(String connectionId, |
| 546 | ParcelableConnection connection, Session.Info sessionInfo) { |
Tyler Gunn | 4a57b9b | 2014-10-30 14:27:48 -0700 | [diff] [blame] | 547 | SomeArgs args = SomeArgs.obtain(); |
| 548 | args.arg1 = connectionId; |
| 549 | args.arg2 = connection; |
| 550 | mHandler.obtainMessage(MSG_ADD_EXISTING_CONNECTION, args).sendToTarget(); |
| 551 | } |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 552 | |
| 553 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 554 | public final void putExtras(String connectionId, Bundle extras, Session.Info sessionInfo) { |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 555 | SomeArgs args = SomeArgs.obtain(); |
| 556 | args.arg1 = connectionId; |
| 557 | args.arg2 = extras; |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 558 | mHandler.obtainMessage(MSG_PUT_EXTRAS, args).sendToTarget(); |
| 559 | } |
| 560 | |
| 561 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 562 | public final void removeExtras(String connectionId, List<String> keys, |
| 563 | Session.Info sessionInfo) { |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 564 | SomeArgs args = SomeArgs.obtain(); |
| 565 | args.arg1 = connectionId; |
| 566 | args.arg2 = keys; |
| 567 | mHandler.obtainMessage(MSG_REMOVE_EXTRAS, args).sendToTarget(); |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 568 | } |
Tyler Gunn | bd1eb1f | 2016-02-16 14:36:20 -0800 | [diff] [blame] | 569 | |
| 570 | @Override |
Tyler Gunn | f503543 | 2017-01-09 09:43:12 -0800 | [diff] [blame] | 571 | public final void setAudioRoute(String connectionId, int audioRoute, |
Hall Liu | a98f58b5 | 2017-11-07 17:59:28 -0800 | [diff] [blame] | 572 | String bluetoothAddress, Session.Info sessionInfo) { |
Tyler Gunn | f503543 | 2017-01-09 09:43:12 -0800 | [diff] [blame] | 573 | SomeArgs args = SomeArgs.obtain(); |
| 574 | args.arg1 = connectionId; |
| 575 | args.argi1 = audioRoute; |
Hall Liu | a98f58b5 | 2017-11-07 17:59:28 -0800 | [diff] [blame] | 576 | args.arg2 = bluetoothAddress; |
| 577 | args.arg3 = sessionInfo; |
Tyler Gunn | f503543 | 2017-01-09 09:43:12 -0800 | [diff] [blame] | 578 | mHandler.obtainMessage(MSG_SET_AUDIO_ROUTE, args).sendToTarget(); |
| 579 | } |
| 580 | |
| 581 | @Override |
Brad Ebinger | 4d75bee | 2016-10-28 12:29:55 -0700 | [diff] [blame] | 582 | public final void onConnectionEvent(String connectionId, String event, Bundle extras, |
| 583 | Session.Info sessionInfo) { |
Tyler Gunn | bd1eb1f | 2016-02-16 14:36:20 -0800 | [diff] [blame] | 584 | SomeArgs args = SomeArgs.obtain(); |
| 585 | args.arg1 = connectionId; |
| 586 | args.arg2 = event; |
Tyler Gunn | 876dbfb | 2016-03-14 15:18:07 -0700 | [diff] [blame] | 587 | args.arg3 = extras; |
Tyler Gunn | bd1eb1f | 2016-02-16 14:36:20 -0800 | [diff] [blame] | 588 | mHandler.obtainMessage(MSG_ON_CONNECTION_EVENT, args).sendToTarget(); |
| 589 | } |
Hall Liu | 57006aa | 2017-02-06 10:49:48 -0800 | [diff] [blame] | 590 | |
| 591 | @Override |
| 592 | public void onRttInitiationSuccess(String connectionId, Session.Info sessionInfo) |
| 593 | throws RemoteException { |
| 594 | mHandler.obtainMessage(MSG_ON_RTT_INITIATION_SUCCESS, connectionId).sendToTarget(); |
| 595 | } |
| 596 | |
| 597 | @Override |
| 598 | public void onRttInitiationFailure(String connectionId, int reason, |
| 599 | Session.Info sessionInfo) |
| 600 | throws RemoteException { |
| 601 | mHandler.obtainMessage(MSG_ON_RTT_INITIATION_FAILURE, reason, 0, connectionId) |
| 602 | .sendToTarget(); |
| 603 | } |
| 604 | |
| 605 | @Override |
| 606 | public void onRttSessionRemotelyTerminated(String connectionId, Session.Info sessionInfo) |
| 607 | throws RemoteException { |
| 608 | mHandler.obtainMessage(MSG_ON_RTT_REMOTELY_TERMINATED, connectionId).sendToTarget(); |
| 609 | } |
| 610 | |
| 611 | @Override |
| 612 | public void onRemoteRttRequest(String connectionId, Session.Info sessionInfo) |
| 613 | throws RemoteException { |
| 614 | mHandler.obtainMessage(MSG_ON_RTT_UPGRADE_REQUEST, connectionId).sendToTarget(); |
| 615 | } |
Srikanth Chintala | fcb1501 | 2017-05-04 20:58:34 +0530 | [diff] [blame] | 616 | |
| 617 | @Override |
| 618 | public void onPhoneAccountChanged(String callId, PhoneAccountHandle pHandle, |
| 619 | Session.Info sessionInfo) { |
| 620 | SomeArgs args = SomeArgs.obtain(); |
| 621 | args.arg1 = callId; |
| 622 | args.arg2 = pHandle; |
| 623 | mHandler.obtainMessage(MSG_SET_PHONE_ACCOUNT_CHANGED, args).sendToTarget(); |
| 624 | } |
Pengquan Meng | 63d25a5 | 2017-11-21 18:01:13 -0800 | [diff] [blame] | 625 | |
| 626 | @Override |
| 627 | public void onConnectionServiceFocusReleased(Session.Info sessionInfo) { |
| 628 | mHandler.obtainMessage(MSG_CONNECTION_SERVICE_FOCUS_RELEASED).sendToTarget(); |
| 629 | } |
Mengjun Leng | 2570774 | 2017-07-04 11:10:37 +0800 | [diff] [blame] | 630 | |
| 631 | @Override |
| 632 | public void resetConnectionTime(String callId, Session.Info sessionInfo) { |
| 633 | // Do nothing |
| 634 | } |
Tyler Gunn | 68a73a4 | 2018-10-03 15:38:57 -0700 | [diff] [blame] | 635 | |
| 636 | @Override |
| 637 | public void setConferenceState(String callId, boolean isConference, |
| 638 | Session.Info sessionInfo) { |
| 639 | SomeArgs args = SomeArgs.obtain(); |
| 640 | args.arg1 = callId; |
| 641 | args.arg2 = isConference; |
| 642 | args.arg3 = sessionInfo; |
| 643 | mHandler.obtainMessage(MSG_SET_CONFERENCE_STATE, args).sendToTarget(); |
| 644 | } |
Ihab Awad | 5d0410f | 2014-07-30 10:07:40 -0700 | [diff] [blame] | 645 | }; |
| 646 | |
| 647 | public ConnectionServiceAdapterServant(IConnectionServiceAdapter delegate) { |
| 648 | mDelegate = delegate; |
| 649 | } |
| 650 | |
| 651 | public IConnectionServiceAdapter getStub() { |
| 652 | return mStub; |
| 653 | } |
| 654 | } |