summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/videotech/rcs
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-03-24 09:31:16 -0700
committerEric Erfanian <erfanian@google.com>2017-03-27 08:56:19 -0700
commit9050823ccf6f512e06ad65c8a741cb17cbc4a833 (patch)
treee454c9e0fa20b8384fa87d4e6309bb8b9e3aa2a4 /java/com/android/incallui/videotech/rcs
parentdd9d50805f1b49dff1fe3787740393d726124cdb (diff)
Update AOSP Dialer source from internal google3 repository at
cl/151128062 Test: make, treehugger This CL updates the AOSP Dialer source with all the changes that have gone into the private google3 repository. This includes all the changes from cl/150756069 (3/21/2017) to cl/151128062 (3/24/2017). Notable this release: - Explicitly enumerate host and target dependencies. - Update proguard flag references. This goal of these drops is to keep the AOSP source in sync with the internal google3 repository. Currently these sync are done by hand with very minor modifications to the internal source code. See the Android.mk file for list of modifications. Our current goal is to do frequent drops (daily if possible) and eventually switched to an automated process. Bug: 33210202 36511925 Addresses 33210202 - Proguard support 36511925 - Compiler warnings when building against platform sdk Change-Id: I448ec3b3f2358886859cf7a4ef76a8fcef3244ae
Diffstat (limited to 'java/com/android/incallui/videotech/rcs')
-rw-r--r--java/com/android/incallui/videotech/rcs/RcsVideoShare.java200
1 files changed, 0 insertions, 200 deletions
diff --git a/java/com/android/incallui/videotech/rcs/RcsVideoShare.java b/java/com/android/incallui/videotech/rcs/RcsVideoShare.java
deleted file mode 100644
index 1e951408c..000000000
--- a/java/com/android/incallui/videotech/rcs/RcsVideoShare.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (C) 2017 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 com.android.incallui.videotech.rcs;
-
-import android.support.annotation.NonNull;
-import android.telecom.Call;
-import com.android.dialer.common.Assert;
-import com.android.dialer.common.LogUtil;
-import com.android.dialer.enrichedcall.EnrichedCallCapabilities;
-import com.android.dialer.enrichedcall.EnrichedCallManager;
-import com.android.dialer.enrichedcall.EnrichedCallManager.CapabilitiesListener;
-import com.android.dialer.enrichedcall.Session;
-import com.android.dialer.enrichedcall.videoshare.VideoShareListener;
-import com.android.incallui.videotech.VideoTech;
-
-/** Allows the in-call UI to make video calls over RCS. */
-public class RcsVideoShare implements VideoTech, CapabilitiesListener, VideoShareListener {
- private final EnrichedCallManager enrichedCallManager;
- private final VideoTechListener listener;
- private final String callingNumber;
- private int previousCallState = Call.STATE_NEW;
- private long inviteSessionId = Session.NO_SESSION_ID;
- private long transmittingSessionId = Session.NO_SESSION_ID;
- private long receivingSessionId = Session.NO_SESSION_ID;
-
- private @SessionModificationState int sessionModificationState =
- VideoTech.SESSION_MODIFICATION_STATE_NO_REQUEST;
-
- public RcsVideoShare(
- @NonNull EnrichedCallManager enrichedCallManager,
- @NonNull VideoTechListener listener,
- @NonNull String callingNumber) {
- this.enrichedCallManager = Assert.isNotNull(enrichedCallManager);
- this.listener = Assert.isNotNull(listener);
- this.callingNumber = Assert.isNotNull(callingNumber);
-
- enrichedCallManager.registerCapabilitiesListener(this);
- enrichedCallManager.registerVideoShareListener(this);
- }
-
- @Override
- public boolean isAvailable() {
- EnrichedCallCapabilities capabilities = enrichedCallManager.getCapabilities(callingNumber);
- return capabilities != null && capabilities.supportsVideoShare();
- }
-
- @Override
- public boolean isTransmittingOrReceiving() {
- return transmittingSessionId != Session.NO_SESSION_ID
- || receivingSessionId != Session.NO_SESSION_ID;
- }
-
- @Override
- public boolean isSelfManagedCamera() {
- return true;
- }
-
- @Override
- public void onCallStateChanged(int newState) {
- if (newState == Call.STATE_DISCONNECTING) {
- enrichedCallManager.unregisterVideoShareListener(this);
- enrichedCallManager.unregisterCapabilitiesListener(this);
- }
-
- if (newState != previousCallState && newState == Call.STATE_ACTIVE) {
- // Per spec, request capabilities when the call becomes active
- enrichedCallManager.requestCapabilities(callingNumber);
- }
-
- previousCallState = newState;
- }
-
- @Override
- public int getSessionModificationState() {
- return sessionModificationState;
- }
-
- private void setSessionModificationState(@SessionModificationState int state) {
- if (state != sessionModificationState) {
- LogUtil.i(
- "RcsVideoShare.setSessionModificationState", "%d -> %d", sessionModificationState, state);
- sessionModificationState = state;
- listener.onSessionModificationStateChanged();
- }
- }
-
- @Override
- public void upgradeToVideo() {
- LogUtil.enterBlock("RcsVideoShare.upgradeToVideo");
- transmittingSessionId = enrichedCallManager.startVideoShareSession(callingNumber);
- if (transmittingSessionId != Session.NO_SESSION_ID) {
- setSessionModificationState(
- VideoTech.SESSION_MODIFICATION_STATE_WAITING_FOR_UPGRADE_TO_VIDEO_RESPONSE);
- }
- }
-
- @Override
- public void acceptVideoRequest() {
- LogUtil.enterBlock("RcsVideoShare.acceptVideoRequest");
- if (enrichedCallManager.acceptVideoShareSession(inviteSessionId)) {
- receivingSessionId = inviteSessionId;
- }
- inviteSessionId = Session.NO_SESSION_ID;
- setSessionModificationState(VideoTech.SESSION_MODIFICATION_STATE_NO_REQUEST);
- }
-
- @Override
- public void acceptVideoRequestAsAudio() {
- throw Assert.createUnsupportedOperationFailException();
- }
-
- @Override
- public void declineVideoRequest() {
- LogUtil.enterBlock("RcsVideoTech.declineUpgradeRequest");
- enrichedCallManager.endVideoShareSession(
- enrichedCallManager.getVideoShareInviteSessionId(callingNumber));
- inviteSessionId = Session.NO_SESSION_ID;
- setSessionModificationState(VideoTech.SESSION_MODIFICATION_STATE_NO_REQUEST);
- }
-
- @Override
- public boolean isTransmitting() {
- return transmittingSessionId != Session.NO_SESSION_ID;
- }
-
- @Override
- public void stopTransmission() {
- LogUtil.enterBlock("RcsVideoTech.stopTransmission");
- }
-
- @Override
- public void resumeTransmission() {
- LogUtil.enterBlock("RcsVideoTech.resumeTransmission");
- }
-
- @Override
- public void pause() {}
-
- @Override
- public void unpause() {}
-
- @Override
- public void setCamera(String cameraId) {}
-
- @Override
- public void setDeviceOrientation(int rotation) {}
-
- @Override
- public void onCapabilitiesUpdated() {
- listener.onVideoTechStateChanged();
- }
-
- @Override
- public void onVideoShareChanged() {
- long existingInviteSessionId = inviteSessionId;
-
- inviteSessionId = enrichedCallManager.getVideoShareInviteSessionId(callingNumber);
- if (inviteSessionId != Session.NO_SESSION_ID) {
- if (existingInviteSessionId == Session.NO_SESSION_ID) {
- // This is a new invite
- setSessionModificationState(
- VideoTech.SESSION_MODIFICATION_STATE_RECEIVED_UPGRADE_TO_VIDEO_REQUEST);
- listener.onVideoUpgradeRequestReceived();
- }
- } else {
- setSessionModificationState(VideoTech.SESSION_MODIFICATION_STATE_NO_REQUEST);
- }
-
- if (sessionIsClosed(transmittingSessionId)) {
- LogUtil.i("RcsVideoShare.onSessionClosed", "transmitting session closed");
- transmittingSessionId = Session.NO_SESSION_ID;
- }
-
- if (sessionIsClosed(receivingSessionId)) {
- LogUtil.i("RcsVideoShare.onSessionClosed", "receiving session closed");
- receivingSessionId = Session.NO_SESSION_ID;
- }
-
- listener.onVideoTechStateChanged();
- }
-
- private boolean sessionIsClosed(long sessionId) {
- return sessionId != Session.NO_SESSION_ID
- && enrichedCallManager.getVideoShareSession(sessionId) == null;
- }
-}