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