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