summaryrefslogtreecommitdiff
path: root/InCallUI/src/com/android/incallui
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-07-22 18:20:51 -0700
committerAndrew Lee <anwlee@google.com>2014-07-25 08:59:18 -0700
commit71c2d74d4cf00b5e2fe72f1d8c318da5894f133f (patch)
treea9dbfdc03f63f5d97d27431640010f1d35040113 /InCallUI/src/com/android/incallui
parent6e1588189961c4aab0f036dd781ca0f218cbbe28 (diff)
Use VideoCall instead of RemoteCallVideoProvider in InCallUi.
Bug: 16494880 Bug: 16495203 Change-Id: I61d981d835a5a4b452c20c736af1eabd64da198c
Diffstat (limited to 'InCallUI/src/com/android/incallui')
-rw-r--r--InCallUI/src/com/android/incallui/Call.java22
-rw-r--r--InCallUI/src/com/android/incallui/CallButtonPresenter.java36
-rw-r--r--InCallUI/src/com/android/incallui/InCallVideoCallListener.java (renamed from InCallUI/src/com/android/incallui/InCallVideoClient.java)26
-rw-r--r--InCallUI/src/com/android/incallui/VideoCallPresenter.java59
4 files changed, 70 insertions, 73 deletions
diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java
index 3887eca5b..a11703a49 100644
--- a/InCallUI/src/com/android/incallui/Call.java
+++ b/InCallUI/src/com/android/incallui/Call.java
@@ -18,9 +18,9 @@ package com.android.incallui;
import android.net.Uri;
import android.telecomm.CallCapabilities;
-import android.telecomm.PhoneAccountHandle;
-import android.telecomm.RemoteCallVideoProvider;
import android.telecomm.GatewayInfo;
+import android.telecomm.InCallService.VideoCall;
+import android.telecomm.PhoneAccountHandle;
import android.telecomm.VideoCallProfile;
import android.telephony.DisconnectCause;
@@ -145,8 +145,8 @@ public final class Call {
}
@Override
- public void onCallVideoProviderChanged(android.telecomm.Call call,
- RemoteCallVideoProvider callVideoProvider) {
+ public void onVideoCallChanged(android.telecomm.Call call,
+ VideoCall videoCall) {
update();
}
@@ -163,7 +163,7 @@ public final class Call {
private String mParentCallId;
private final List<String> mChildCallIds = new ArrayList<>();
- private InCallVideoClient mCallVideoClient;
+ private InCallVideoCallListener mVideoCallListener;
public Call(android.telecomm.Call telecommCall) {
mTelecommCall = telecommCall;
@@ -200,11 +200,11 @@ public final class Call {
mTelecommCall.getParent()).getId();
}
- if (mTelecommCall.getCallVideoProvider() != null) {
- if (mCallVideoClient == null) {
- mCallVideoClient = new InCallVideoClient(this);
+ if (mTelecommCall.getVideoCall() != null) {
+ if (mVideoCallListener == null) {
+ mVideoCallListener = new InCallVideoCallListener(this);
}
- mTelecommCall.getCallVideoProvider().setCallVideoClient(mCallVideoClient);
+ mTelecommCall.getVideoCall().setVideoCallListener(mVideoCallListener);
}
mChildCallIds.clear();
@@ -315,8 +315,8 @@ public final class Call {
return mTelecommCall.getDetails().getAccountHandle();
}
- public RemoteCallVideoProvider getCallVideoProvider() {
- return mTelecommCall.getCallVideoProvider();
+ public VideoCall getVideoCall() {
+ return mTelecommCall.getVideoCall();
}
public List<String> getChildCallIds() {
diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java
index 622a74f39..c0e8cd555 100644
--- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java
@@ -21,7 +21,7 @@ import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CameraManager;
import android.telecomm.CallCapabilities;
-import android.telecomm.RemoteCallVideoProvider;
+import android.telecomm.InCallService.VideoCall;
import android.telecomm.VideoCallProfile;
import com.android.contacts.common.util.PhoneNumberHelper;
@@ -213,14 +213,14 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
}
public void changeToVoiceClicked() {
- RemoteCallVideoProvider callVideoProvider = mCall.getCallVideoProvider();
- if (callVideoProvider == null) {
+ VideoCall videoCall = mCall.getVideoCall();
+ if (videoCall == null) {
return;
}
VideoCallProfile videoCallProfile = new VideoCallProfile(
VideoCallProfile.VIDEO_STATE_AUDIO_ONLY, VideoCallProfile.QUALITY_DEFAULT);
- callVideoProvider.sendSessionModifyRequest(videoCallProfile);
+ videoCall.sendSessionModifyRequest(videoCallProfile);
}
public void swapClicked() {
@@ -234,14 +234,14 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
}
public void changeToVideoClicked() {
- RemoteCallVideoProvider callVideoProvider = mCall.getCallVideoProvider();
- if (callVideoProvider == null) {
+ VideoCall videoCall = mCall.getVideoCall();
+ if (videoCall == null) {
return;
}
VideoCallProfile videoCallProfile =
new VideoCallProfile(VideoCallProfile.VIDEO_STATE_BIDIRECTIONAL);
- callVideoProvider.sendSessionModifyRequest(videoCallProfile);
+ videoCall.sendSessionModifyRequest(videoCallProfile);
}
/**
@@ -252,14 +252,14 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
public void switchCameraClicked(boolean useFrontFacingCamera) {
mUseFrontFacingCamera = useFrontFacingCamera;
- RemoteCallVideoProvider callVideoProvider = mCall.getCallVideoProvider();
- if (callVideoProvider == null) {
+ VideoCall videoCall = mCall.getVideoCall();
+ if (videoCall == null) {
return;
}
String cameraId = getCameraId();
if (cameraId != null) {
- callVideoProvider.setCamera(cameraId);
+ videoCall.setCamera(cameraId);
}
getUi().setSwitchCameraButton(!useFrontFacingCamera);
}
@@ -270,21 +270,21 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
* video.
*/
public void pauseVideoClicked(boolean pause) {
- RemoteCallVideoProvider callVideoProvider = mCall.getCallVideoProvider();
- if (callVideoProvider == null) {
+ VideoCall videoCall = mCall.getVideoCall();
+ if (videoCall == null) {
return;
}
if (pause) {
- callVideoProvider.setCamera(null);
+ videoCall.setCamera(null);
VideoCallProfile videoCallProfile = new VideoCallProfile(
mCall.getVideoState() | VideoCallProfile.VIDEO_STATE_PAUSED);
- callVideoProvider.sendSessionModifyRequest(videoCallProfile);
+ videoCall.sendSessionModifyRequest(videoCallProfile);
} else {
- callVideoProvider.setCamera(getCameraId());
+ videoCall.setCamera(getCameraId());
VideoCallProfile videoCallProfile = new VideoCallProfile(
mCall.getVideoState() & ~VideoCallProfile.VIDEO_STATE_PAUSED);
- callVideoProvider.sendSessionModifyRequest(videoCallProfile);
+ videoCall.sendSessionModifyRequest(videoCallProfile);
}
getUi().setPauseVideoButton(pause);
}
@@ -306,7 +306,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
}
if (call.isVideoCall()) {
- updateVideoCallButtons(call);
+ updateVideoCallButtons();
} else {
updateVoiceCallButtons(call);
}
@@ -326,7 +326,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
updateExtraButtonRow();
}
- private void updateVideoCallButtons(Call call) {
+ private void updateVideoCallButtons() {
Log.v(this, "Showing buttons for video call.");
final CallButtonUi ui = getUi();
diff --git a/InCallUI/src/com/android/incallui/InCallVideoClient.java b/InCallUI/src/com/android/incallui/InCallVideoCallListener.java
index 792348b6a..e1fe60ab3 100644
--- a/InCallUI/src/com/android/incallui/InCallVideoClient.java
+++ b/InCallUI/src/com/android/incallui/InCallVideoCallListener.java
@@ -17,13 +17,13 @@
package com.android.incallui;
import android.telecomm.CallCameraCapabilities;
+import android.telecomm.InCallService.VideoCall;
import android.telecomm.VideoCallProfile;
-import android.telecomm.CallVideoClient;
/**
- * Implements the InCall-UI Call Video client.
+ * Implements the InCallUI Video Call Listener.
*/
-public class InCallVideoClient extends CallVideoClient {
+public class InCallVideoCallListener extends VideoCall.Listener {
/**
* The call associated with this {@link InCallVideoClient}.
@@ -35,7 +35,7 @@ public class InCallVideoClient extends CallVideoClient {
*
* @param call The call.
*/
- public InCallVideoClient(Call call) {
+ public InCallVideoCallListener(Call call) {
mCall = call;
}
@@ -45,7 +45,7 @@ public class InCallVideoClient extends CallVideoClient {
* @param videoCallProfile The requested video call profile.
*/
@Override
- public void onReceiveSessionModifyRequest(VideoCallProfile videoCallProfile) {
+ public void onSessionModifyRequestReceived(VideoCallProfile videoCallProfile) {
int previousVideoState = mCall.getVideoState();
int newVideoState = videoCallProfile.getVideoState();
@@ -76,14 +76,14 @@ public class InCallVideoClient extends CallVideoClient {
* Handles a session modification response.
*
* @param status Status of the session modify request. Valid values are
- * {@link CallVideoClient#SESSION_MODIFY_REQUEST_SUCCESS},
- * {@link CallVideoClient#SESSION_MODIFY_REQUEST_FAIL},
- * {@link CallVideoClient#SESSION_MODIFY_REQUEST_INVALID}
+ * {@link VideoCall#SESSION_MODIFY_REQUEST_SUCCESS},
+ * {@link VideoCall#SESSION_MODIFY_REQUEST_FAIL},
+ * {@link VideoCall#SESSION_MODIFY_REQUEST_INVALID}
* @param requestedProfile
* @param responseProfile The actual profile changes made by the peer device.
*/
@Override
- public void onReceiveSessionModifyResponse(int status, VideoCallProfile requestedProfile,
+ public void onSessionModifyResponseReceived(int status, VideoCallProfile requestedProfile,
VideoCallProfile responseProfile) {
}
@@ -93,7 +93,7 @@ public class InCallVideoClient extends CallVideoClient {
* @param event The event.
*/
@Override
- public void onHandleCallSessionEvent(int event) {
+ public void onCallSessionEvent(int event) {
}
/**
@@ -103,7 +103,7 @@ public class InCallVideoClient extends CallVideoClient {
* @param height The updated peer video height.
*/
@Override
- public void onUpdatePeerDimensions(int width, int height) {
+ public void onPeerDimensionsChanged(int width, int height) {
CallVideoClientNotifier.getInstance().peerDimensionsChanged(mCall, width, height);
}
@@ -114,7 +114,7 @@ public class InCallVideoClient extends CallVideoClient {
* @param dataUsage The updated data usage.
*/
@Override
- public void onUpdateCallDataUsage(int dataUsage) {
+ public void onCallDataUsageChanged(int dataUsage) {
}
/**
@@ -124,7 +124,7 @@ public class InCallVideoClient extends CallVideoClient {
* @param callCameraCapabilities The changed camera capabilities.
*/
@Override
- public void onHandleCameraCapabilitiesChange(CallCameraCapabilities callCameraCapabilities) {
+ public void onCameraCapabilitiesChanged(CallCameraCapabilities callCameraCapabilities) {
}
/**
diff --git a/InCallUI/src/com/android/incallui/VideoCallPresenter.java b/InCallUI/src/com/android/incallui/VideoCallPresenter.java
index 3f94995e0..cdfb5a202 100644
--- a/InCallUI/src/com/android/incallui/VideoCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/VideoCallPresenter.java
@@ -24,7 +24,7 @@ import com.android.incallui.InCallPresenter.IncomingCallListener;
import com.android.internal.util.Preconditions;
import android.content.Context;
-import android.telecomm.RemoteCallVideoProvider;
+import android.telecomm.InCallService.VideoCall;
import android.view.Surface;
import java.util.Objects;
@@ -49,10 +49,10 @@ public class VideoCallPresenter extends Presenter<VideoCallPresenter.VideoCallUi
private Call mCall;
/**
- * The {@link RemoteCallVideoProvider} used to inform the video telephony layer of changes
- * to the video surfaces.
+ * The {@link VideoCall} used to inform the video telephony layer of changes to the video
+ * surfaces.
*/
- private RemoteCallVideoProvider mCallVideoProvider;
+ private VideoCall mVideoCall;
/**
* Determines if the current UI state represents a video call.
@@ -103,10 +103,10 @@ public class VideoCallPresenter extends Presenter<VideoCallPresenter.VideoCallUi
}
/**
- * @return The {@link RemoteCallVideoProvider}.
+ * @return The {@link VideoCall}.
*/
- private RemoteCallVideoProvider getCallVideoProvider() {
- return mCallVideoProvider;
+ private VideoCall getVideoCall() {
+ return mVideoCall;
}
/**
@@ -116,16 +116,15 @@ public class VideoCallPresenter extends Presenter<VideoCallPresenter.VideoCallUi
*/
public void onSurfaceCreated(int surface) {
final VideoCallUi ui = getUi();
- final RemoteCallVideoProvider callVideoProvider = getCallVideoProvider();
- if (ui == null || callVideoProvider == null) {
+ if (ui == null || mVideoCall == null) {
return;
}
if (surface == VideoCallFragment.SURFACE_DISPLAY) {
- mCallVideoProvider.setDisplaySurface(ui.getDisplayVideoSurface());
+ mVideoCall.setDisplaySurface(ui.getDisplayVideoSurface());
} else if (surface == VideoCallFragment.SURFACE_PREVIEW) {
- mCallVideoProvider.setPreviewSurface(ui.getPreviewVideoSurface());
+ mVideoCall.setPreviewSurface(ui.getPreviewVideoSurface());
}
}
@@ -148,16 +147,15 @@ public class VideoCallPresenter extends Presenter<VideoCallPresenter.VideoCallUi
*/
public void onSurfaceDestroyed(int surface) {
final VideoCallUi ui = getUi();
- final RemoteCallVideoProvider callVideoProvider = getCallVideoProvider();
- if (ui == null || callVideoProvider == null) {
+ if (ui == null || mVideoCall == null) {
return;
}
if (surface == VideoCallFragment.SURFACE_DISPLAY) {
- mCallVideoProvider.setDisplaySurface(null);
+ mVideoCall.setDisplaySurface(null);
} else if (surface == VideoCallFragment.SURFACE_PREVIEW) {
- mCallVideoProvider.setPreviewSurface(null);
+ mVideoCall.setPreviewSurface(null);
}
}
@@ -228,10 +226,9 @@ public class VideoCallPresenter extends Presenter<VideoCallPresenter.VideoCallUi
* Checks for a change to the call video provider and changes it if required.
*/
private void checkForCallVideoProviderChange() {
- RemoteCallVideoProvider callVideoProvider =
- mCall.getTelecommCall().getCallVideoProvider();
- if (!Objects.equals(callVideoProvider, mCallVideoProvider)) {
- changeCallVideoProvider(callVideoProvider);
+ VideoCall videoCall = mCall.getTelecommCall().getVideoCall();
+ if (!Objects.equals(videoCall, mVideoCall)) {
+ changeVideoCall(videoCall);
}
}
@@ -254,21 +251,21 @@ public class VideoCallPresenter extends Presenter<VideoCallPresenter.VideoCallUi
}
/**
- * Handles a change to the call video provider. Sets the surfaces on the previous provider
- * to null and sets the surfaces on the new provider accordingly.
+ * Handles a change to the video call. Sets the surfaces on the previous call to null and sets
+ * the surfaces on the new provider accordingly.
*
- * @param callVideoProvider The new call video provider.
+ * @param videoCall The new video call.
*/
- private void changeCallVideoProvider(RemoteCallVideoProvider callVideoProvider) {
+ private void changeVideoCall(VideoCall videoCall) {
Log.d(this, "changeCallVideoProvider");
// Null out the surfaces on the previous provider
- if (mCallVideoProvider != null) {
- mCallVideoProvider.setDisplaySurface(null);
- mCallVideoProvider.setPreviewSurface(null);
+ if (mVideoCall != null) {
+ mVideoCall.setDisplaySurface(null);
+ mVideoCall.setPreviewSurface(null);
}
- mCallVideoProvider = callVideoProvider;
+ mVideoCall = videoCall;
setSurfaces();
}
@@ -288,21 +285,21 @@ public class VideoCallPresenter extends Presenter<VideoCallPresenter.VideoCallUi
}
/**
- * Sets the surfaces on the specified {@link RemoteCallVideoProvider}.
+ * Sets the surfaces on the specified {@link Call.VideoCall}.
*/
private void setSurfaces() {
Log.d(this, "setSurfaces");
VideoCallUi ui = getUi();
- if (ui == null || mCallVideoProvider == null) {
+ if (ui == null || mVideoCall == null) {
return;
}
if (getUi().isDisplayVideoSurfaceCreated()) {
- mCallVideoProvider.setDisplaySurface(ui.getDisplayVideoSurface());
+ mVideoCall.setDisplaySurface(ui.getDisplayVideoSurface());
}
if (getUi().isPreviewVideoSurfaceCreated()) {
- mCallVideoProvider.setPreviewSurface(ui.getPreviewVideoSurface());
+ mVideoCall.setPreviewSurface(ui.getPreviewVideoSurface());
}
}