From f759b5bb0bd41fc33df8b43ee9608fd421792353 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 27 Jun 2014 10:54:44 -0700 Subject: [PATCH] Add wrapper to provide method calls for binder to InCallUI. Bug: 15893156 Change-Id: I6b12c0e8c915e184bb469b5934865242f9fde00d --- api/current.txt | 5 ++ .../telecomm/CallVideoProviderWrapper.java | 46 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 telecomm/java/android/telecomm/CallVideoProviderWrapper.java diff --git a/api/current.txt b/api/current.txt index c6fbca3d7848a..09d894077cf23 100644 --- a/api/current.txt +++ b/api/current.txt @@ -27677,6 +27677,11 @@ package android.telecomm { enum_constant public static final android.telecomm.CallState RINGING; } + public class CallVideoProviderWrapper implements android.os.IBinder.DeathRecipient { + method public void binderDied(); + method public void setCamera(java.lang.String) throws android.os.RemoteException; + } + public abstract class Connection { ctor protected Connection(); method public final android.telecomm.CallAudioState getCallAudioState(); diff --git a/telecomm/java/android/telecomm/CallVideoProviderWrapper.java b/telecomm/java/android/telecomm/CallVideoProviderWrapper.java new file mode 100644 index 0000000000000..862adff8bb098 --- /dev/null +++ b/telecomm/java/android/telecomm/CallVideoProviderWrapper.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +package android.telecomm; + +import android.os.IBinder; +import android.os.RemoteException; + +import com.android.internal.telecomm.ICallVideoProvider; + + +public class CallVideoProviderWrapper implements IBinder.DeathRecipient { + private final ICallVideoProvider mCallVideoProvider; + + CallVideoProviderWrapper(ICallVideoProvider callVideoProvider) throws RemoteException { + mCallVideoProvider = callVideoProvider; + mCallVideoProvider.asBinder().linkToDeath(this, 0); + } + + @Override + public void binderDied() { + mCallVideoProvider.asBinder().unlinkToDeath(this, 0); + } + + /** + * Sets the camera to be used for video recording in a video call, using the binder. + * + * @param cameraId The id of the camera. + */ + public void setCamera(String cameraId) throws RemoteException { + mCallVideoProvider.setCamera(cameraId); + }; +} \ No newline at end of file