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