Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -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 | * limitations under the License |
| 15 | */ |
| 16 | |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 17 | package android.telecom; |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 18 | |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame] | 19 | import android.net.Uri; |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 20 | import android.os.Handler; |
| 21 | import android.os.IBinder; |
| 22 | import android.os.Looper; |
| 23 | import android.os.Message; |
| 24 | import android.os.RemoteException; |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 25 | import android.telecom.InCallService.VideoCall; |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 26 | import android.view.Surface; |
| 27 | |
| 28 | import com.android.internal.os.SomeArgs; |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 29 | import com.android.internal.telecom.IVideoCallback; |
| 30 | import com.android.internal.telecom.IVideoProvider; |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 31 | |
| 32 | /** |
| 33 | * Implementation of a Video Call, which allows InCallUi to communicate commands to the underlying |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 34 | * {@link Connection.VideoProvider}, and direct callbacks from the |
| 35 | * {@link Connection.VideoProvider} to the appropriate {@link VideoCall.Listener}. |
| 36 | * |
| 37 | * {@hide} |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 38 | */ |
| 39 | public class VideoCallImpl extends VideoCall { |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 40 | |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 41 | private final IVideoProvider mVideoProvider; |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 42 | private final VideoCallListenerBinder mBinder; |
Andrew Lee | da80c87 | 2015-04-15 14:09:50 -0700 | [diff] [blame] | 43 | private VideoCall.Callback mCallback; |
Tyler Gunn | 4538216 | 2015-05-06 08:52:27 -0700 | [diff] [blame] | 44 | private int mVideoQuality = VideoProfile.QUALITY_UNKNOWN; |
Tyler Gunn | 584ba6c | 2015-12-08 10:53:41 -0800 | [diff] [blame] | 45 | private int mVideoState = VideoProfile.STATE_AUDIO_ONLY; |
Tyler Gunn | bf9c6fd | 2016-11-09 10:19:23 -0800 | [diff] [blame] | 46 | private final String mCallingPackageName; |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 47 | |
| 48 | private IBinder.DeathRecipient mDeathRecipient = new IBinder.DeathRecipient() { |
| 49 | @Override |
| 50 | public void binderDied() { |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 51 | mVideoProvider.asBinder().unlinkToDeath(this, 0); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 52 | } |
| 53 | }; |
| 54 | |
| 55 | /** |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 56 | * IVideoCallback stub implementation. |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 57 | */ |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 58 | private final class VideoCallListenerBinder extends IVideoCallback.Stub { |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 59 | @Override |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 60 | public void receiveSessionModifyRequest(VideoProfile videoProfile) { |
Tyler Gunn | e988cf7 | 2015-05-28 15:47:06 -0700 | [diff] [blame] | 61 | if (mHandler == null) { |
| 62 | return; |
| 63 | } |
Andrew Lee | 011728f | 2015-04-23 15:47:06 -0700 | [diff] [blame] | 64 | mHandler.obtainMessage(MessageHandler.MSG_RECEIVE_SESSION_MODIFY_REQUEST, |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 65 | videoProfile).sendToTarget(); |
Tyler Gunn | e988cf7 | 2015-05-28 15:47:06 -0700 | [diff] [blame] | 66 | |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | @Override |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 70 | public void receiveSessionModifyResponse(int status, VideoProfile requestProfile, |
| 71 | VideoProfile responseProfile) { |
Tyler Gunn | e988cf7 | 2015-05-28 15:47:06 -0700 | [diff] [blame] | 72 | if (mHandler == null) { |
| 73 | return; |
| 74 | } |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 75 | SomeArgs args = SomeArgs.obtain(); |
| 76 | args.arg1 = status; |
| 77 | args.arg2 = requestProfile; |
| 78 | args.arg3 = responseProfile; |
Andrew Lee | 011728f | 2015-04-23 15:47:06 -0700 | [diff] [blame] | 79 | mHandler.obtainMessage(MessageHandler.MSG_RECEIVE_SESSION_MODIFY_RESPONSE, args) |
| 80 | .sendToTarget(); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | @Override |
| 84 | public void handleCallSessionEvent(int event) { |
Tyler Gunn | e988cf7 | 2015-05-28 15:47:06 -0700 | [diff] [blame] | 85 | if (mHandler == null) { |
| 86 | return; |
| 87 | } |
Andrew Lee | 011728f | 2015-04-23 15:47:06 -0700 | [diff] [blame] | 88 | mHandler.obtainMessage(MessageHandler.MSG_HANDLE_CALL_SESSION_EVENT, event) |
| 89 | .sendToTarget(); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | @Override |
| 93 | public void changePeerDimensions(int width, int height) { |
Tyler Gunn | e988cf7 | 2015-05-28 15:47:06 -0700 | [diff] [blame] | 94 | if (mHandler == null) { |
| 95 | return; |
| 96 | } |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 97 | SomeArgs args = SomeArgs.obtain(); |
| 98 | args.arg1 = width; |
| 99 | args.arg2 = height; |
Andrew Lee | 011728f | 2015-04-23 15:47:06 -0700 | [diff] [blame] | 100 | mHandler.obtainMessage(MessageHandler.MSG_CHANGE_PEER_DIMENSIONS, args).sendToTarget(); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 101 | } |
| 102 | |
| 103 | @Override |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 104 | public void changeVideoQuality(int videoQuality) { |
Tyler Gunn | e988cf7 | 2015-05-28 15:47:06 -0700 | [diff] [blame] | 105 | if (mHandler == null) { |
| 106 | return; |
| 107 | } |
Andrew Lee | 011728f | 2015-04-23 15:47:06 -0700 | [diff] [blame] | 108 | mHandler.obtainMessage(MessageHandler.MSG_CHANGE_VIDEO_QUALITY, videoQuality, 0) |
| 109 | .sendToTarget(); |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | @Override |
| 113 | public void changeCallDataUsage(long dataUsage) { |
Tyler Gunn | e988cf7 | 2015-05-28 15:47:06 -0700 | [diff] [blame] | 114 | if (mHandler == null) { |
| 115 | return; |
| 116 | } |
Andrew Lee | 011728f | 2015-04-23 15:47:06 -0700 | [diff] [blame] | 117 | mHandler.obtainMessage(MessageHandler.MSG_CHANGE_CALL_DATA_USAGE, dataUsage) |
| 118 | .sendToTarget(); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | @Override |
Yorke Lee | 400470f | 2015-05-12 13:31:25 -0700 | [diff] [blame] | 122 | public void changeCameraCapabilities(VideoProfile.CameraCapabilities cameraCapabilities) { |
Tyler Gunn | e988cf7 | 2015-05-28 15:47:06 -0700 | [diff] [blame] | 123 | if (mHandler == null) { |
| 124 | return; |
| 125 | } |
Andrew Lee | 011728f | 2015-04-23 15:47:06 -0700 | [diff] [blame] | 126 | mHandler.obtainMessage(MessageHandler.MSG_CHANGE_CAMERA_CAPABILITIES, |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 127 | cameraCapabilities).sendToTarget(); |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | /** Default handler used to consolidate binder method calls onto a single thread. */ |
Andrew Lee | 011728f | 2015-04-23 15:47:06 -0700 | [diff] [blame] | 132 | private final class MessageHandler extends Handler { |
| 133 | private static final int MSG_RECEIVE_SESSION_MODIFY_REQUEST = 1; |
| 134 | private static final int MSG_RECEIVE_SESSION_MODIFY_RESPONSE = 2; |
| 135 | private static final int MSG_HANDLE_CALL_SESSION_EVENT = 3; |
| 136 | private static final int MSG_CHANGE_PEER_DIMENSIONS = 4; |
| 137 | private static final int MSG_CHANGE_CALL_DATA_USAGE = 5; |
| 138 | private static final int MSG_CHANGE_CAMERA_CAPABILITIES = 6; |
| 139 | private static final int MSG_CHANGE_VIDEO_QUALITY = 7; |
| 140 | |
| 141 | public MessageHandler(Looper looper) { |
| 142 | super(looper); |
| 143 | } |
| 144 | |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 145 | @Override |
| 146 | public void handleMessage(Message msg) { |
Andrew Lee | da80c87 | 2015-04-15 14:09:50 -0700 | [diff] [blame] | 147 | if (mCallback == null) { |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 148 | return; |
| 149 | } |
| 150 | |
| 151 | SomeArgs args; |
| 152 | switch (msg.what) { |
| 153 | case MSG_RECEIVE_SESSION_MODIFY_REQUEST: |
Andrew Lee | da80c87 | 2015-04-15 14:09:50 -0700 | [diff] [blame] | 154 | mCallback.onSessionModifyRequestReceived((VideoProfile) msg.obj); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 155 | break; |
| 156 | case MSG_RECEIVE_SESSION_MODIFY_RESPONSE: |
| 157 | args = (SomeArgs) msg.obj; |
| 158 | try { |
| 159 | int status = (int) args.arg1; |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 160 | VideoProfile requestProfile = (VideoProfile) args.arg2; |
| 161 | VideoProfile responseProfile = (VideoProfile) args.arg3; |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 162 | |
Andrew Lee | da80c87 | 2015-04-15 14:09:50 -0700 | [diff] [blame] | 163 | mCallback.onSessionModifyResponseReceived( |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 164 | status, requestProfile, responseProfile); |
| 165 | } finally { |
| 166 | args.recycle(); |
| 167 | } |
| 168 | break; |
| 169 | case MSG_HANDLE_CALL_SESSION_EVENT: |
Andrew Lee | da80c87 | 2015-04-15 14:09:50 -0700 | [diff] [blame] | 170 | mCallback.onCallSessionEvent((int) msg.obj); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 171 | break; |
| 172 | case MSG_CHANGE_PEER_DIMENSIONS: |
| 173 | args = (SomeArgs) msg.obj; |
| 174 | try { |
| 175 | int width = (int) args.arg1; |
| 176 | int height = (int) args.arg2; |
Andrew Lee | da80c87 | 2015-04-15 14:09:50 -0700 | [diff] [blame] | 177 | mCallback.onPeerDimensionsChanged(width, height); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 178 | } finally { |
| 179 | args.recycle(); |
| 180 | } |
| 181 | break; |
| 182 | case MSG_CHANGE_CALL_DATA_USAGE: |
Andrew Lee | da80c87 | 2015-04-15 14:09:50 -0700 | [diff] [blame] | 183 | mCallback.onCallDataUsageChanged((long) msg.obj); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 184 | break; |
| 185 | case MSG_CHANGE_CAMERA_CAPABILITIES: |
Andrew Lee | da80c87 | 2015-04-15 14:09:50 -0700 | [diff] [blame] | 186 | mCallback.onCameraCapabilitiesChanged( |
Yorke Lee | 400470f | 2015-05-12 13:31:25 -0700 | [diff] [blame] | 187 | (VideoProfile.CameraCapabilities) msg.obj); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 188 | break; |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 189 | case MSG_CHANGE_VIDEO_QUALITY: |
Tyler Gunn | 4538216 | 2015-05-06 08:52:27 -0700 | [diff] [blame] | 190 | mVideoQuality = msg.arg1; |
Andrew Lee | da80c87 | 2015-04-15 14:09:50 -0700 | [diff] [blame] | 191 | mCallback.onVideoQualityChanged(msg.arg1); |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 192 | break; |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 193 | default: |
| 194 | break; |
| 195 | } |
| 196 | } |
| 197 | }; |
| 198 | |
Andrew Lee | 011728f | 2015-04-23 15:47:06 -0700 | [diff] [blame] | 199 | private Handler mHandler; |
| 200 | |
Tyler Gunn | bf9c6fd | 2016-11-09 10:19:23 -0800 | [diff] [blame] | 201 | VideoCallImpl(IVideoProvider videoProvider, String callingPackageName) throws RemoteException { |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 202 | mVideoProvider = videoProvider; |
| 203 | mVideoProvider.asBinder().linkToDeath(mDeathRecipient, 0); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 204 | |
| 205 | mBinder = new VideoCallListenerBinder(); |
Tyler Gunn | 7595842 | 2015-04-15 14:23:42 -0700 | [diff] [blame] | 206 | mVideoProvider.addVideoCallback(mBinder); |
Tyler Gunn | bf9c6fd | 2016-11-09 10:19:23 -0800 | [diff] [blame] | 207 | mCallingPackageName = callingPackageName; |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 208 | } |
| 209 | |
Andrew Lee | 011728f | 2015-04-23 15:47:06 -0700 | [diff] [blame] | 210 | public void destroy() { |
| 211 | unregisterCallback(mCallback); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 212 | } |
| 213 | |
| 214 | /** {@inheritDoc} */ |
Andrew Lee | 011728f | 2015-04-23 15:47:06 -0700 | [diff] [blame] | 215 | public void registerCallback(VideoCall.Callback callback) { |
| 216 | registerCallback(callback, null); |
| 217 | } |
| 218 | |
| 219 | /** {@inheritDoc} */ |
| 220 | public void registerCallback(VideoCall.Callback callback, Handler handler) { |
| 221 | mCallback = callback; |
| 222 | if (handler == null) { |
| 223 | mHandler = new MessageHandler(Looper.getMainLooper()); |
| 224 | } else { |
| 225 | mHandler = new MessageHandler(handler.getLooper()); |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | /** {@inheritDoc} */ |
| 230 | public void unregisterCallback(VideoCall.Callback callback) { |
| 231 | if (callback != mCallback) { |
| 232 | return; |
| 233 | } |
| 234 | |
Etan Cohen | 8942724 | 2015-04-23 12:26:37 -0700 | [diff] [blame] | 235 | mCallback = null; |
Tyler Gunn | 7595842 | 2015-04-15 14:23:42 -0700 | [diff] [blame] | 236 | try { |
| 237 | mVideoProvider.removeVideoCallback(mBinder); |
| 238 | } catch (RemoteException e) { |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | /** {@inheritDoc} */ |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 243 | public void setCamera(String cameraId) { |
| 244 | try { |
Tyler Gunn | bf9c6fd | 2016-11-09 10:19:23 -0800 | [diff] [blame] | 245 | Log.w(this, "setCamera: cameraId=%s, calling=%s", cameraId, mCallingPackageName); |
| 246 | mVideoProvider.setCamera(cameraId, mCallingPackageName); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 247 | } catch (RemoteException e) { |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | /** {@inheritDoc} */ |
| 252 | public void setPreviewSurface(Surface surface) { |
| 253 | try { |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 254 | mVideoProvider.setPreviewSurface(surface); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 255 | } catch (RemoteException e) { |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | /** {@inheritDoc} */ |
| 260 | public void setDisplaySurface(Surface surface) { |
| 261 | try { |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 262 | mVideoProvider.setDisplaySurface(surface); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 263 | } catch (RemoteException e) { |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | /** {@inheritDoc} */ |
| 268 | public void setDeviceOrientation(int rotation) { |
| 269 | try { |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 270 | mVideoProvider.setDeviceOrientation(rotation); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 271 | } catch (RemoteException e) { |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | /** {@inheritDoc} */ |
| 276 | public void setZoom(float value) { |
| 277 | try { |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 278 | mVideoProvider.setZoom(value); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 279 | } catch (RemoteException e) { |
| 280 | } |
| 281 | } |
| 282 | |
Tyler Gunn | 4538216 | 2015-05-06 08:52:27 -0700 | [diff] [blame] | 283 | /** |
| 284 | * Sends a session modification request to the video provider. |
| 285 | * <p> |
| 286 | * The {@link InCallService} will create the {@code requestProfile} based on the current |
| 287 | * video state (i.e. {@link Call.Details#getVideoState()}). It is, however, possible that the |
| 288 | * video state maintained by the {@link InCallService} could get out of sync with what is known |
| 289 | * by the {@link android.telecom.Connection.VideoProvider}. To remove ambiguity, the |
| 290 | * {@link VideoCallImpl} passes along the pre-modify video profile to the {@code VideoProvider} |
| 291 | * to ensure it has full context of the requested change. |
| 292 | * |
| 293 | * @param requestProfile The requested video profile. |
| 294 | */ |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 295 | public void sendSessionModifyRequest(VideoProfile requestProfile) { |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 296 | try { |
Tyler Gunn | 584ba6c | 2015-12-08 10:53:41 -0800 | [diff] [blame] | 297 | VideoProfile originalProfile = new VideoProfile(mVideoState, mVideoQuality); |
Tyler Gunn | 4538216 | 2015-05-06 08:52:27 -0700 | [diff] [blame] | 298 | |
| 299 | mVideoProvider.sendSessionModifyRequest(originalProfile, requestProfile); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 300 | } catch (RemoteException e) { |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | /** {@inheritDoc} */ |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 305 | public void sendSessionModifyResponse(VideoProfile responseProfile) { |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 306 | try { |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 307 | mVideoProvider.sendSessionModifyResponse(responseProfile); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 308 | } catch (RemoteException e) { |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | /** {@inheritDoc} */ |
| 313 | public void requestCameraCapabilities() { |
| 314 | try { |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 315 | mVideoProvider.requestCameraCapabilities(); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 316 | } catch (RemoteException e) { |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | /** {@inheritDoc} */ |
| 321 | public void requestCallDataUsage() { |
| 322 | try { |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 323 | mVideoProvider.requestCallDataUsage(); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 324 | } catch (RemoteException e) { |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | /** {@inheritDoc} */ |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame] | 329 | public void setPauseImage(Uri uri) { |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 330 | try { |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 331 | mVideoProvider.setPauseImage(uri); |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 332 | } catch (RemoteException e) { |
| 333 | } |
| 334 | } |
Tyler Gunn | 584ba6c | 2015-12-08 10:53:41 -0800 | [diff] [blame] | 335 | |
| 336 | /** |
| 337 | * Sets the video state for the current video call. |
| 338 | * @param videoState the new video state. |
| 339 | */ |
| 340 | public void setVideoState(int videoState) { |
| 341 | mVideoState = videoState; |
| 342 | } |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 343 | } |