diff options
Diffstat (limited to 'java/com/android/incallui/answer/impl/AnswerFragment.java')
-rw-r--r-- | java/com/android/incallui/answer/impl/AnswerFragment.java | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/java/com/android/incallui/answer/impl/AnswerFragment.java b/java/com/android/incallui/answer/impl/AnswerFragment.java index 6874daea3..c6304c0fa 100644 --- a/java/com/android/incallui/answer/impl/AnswerFragment.java +++ b/java/com/android/incallui/answer/impl/AnswerFragment.java @@ -106,6 +106,9 @@ public class AnswerFragment extends Fragment @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) static final String ARG_IS_VIDEO_UPGRADE_REQUEST = "is_video_upgrade_request"; + @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) + static final String ARG_IS_SELF_MANAGED_CAMERA = "is_self_managed_camera"; + private static final String STATE_HAS_ANIMATED_ENTRY = "hasAnimated"; private static final int HINT_SECONDARY_SHOW_DURATION_MILLIS = 5000; @@ -288,11 +291,15 @@ public class AnswerFragment extends Fragment } public static AnswerFragment newInstance( - String callId, boolean isVideoCall, boolean isVideoUpgradeRequest) { + String callId, + boolean isVideoCall, + boolean isVideoUpgradeRequest, + boolean isSelfManagedCamera) { Bundle bundle = new Bundle(); bundle.putString(ARG_CALL_ID, Assert.isNotNull(callId)); bundle.putBoolean(ARG_IS_VIDEO_CALL, isVideoCall); bundle.putBoolean(ARG_IS_VIDEO_UPGRADE_REQUEST, isVideoUpgradeRequest); + bundle.putBoolean(ARG_IS_SELF_MANAGED_CAMERA, isSelfManagedCamera); AnswerFragment instance = new AnswerFragment(); instance.setArguments(bundle); @@ -347,10 +354,10 @@ public class AnswerFragment extends Fragment secondaryButton.setFocusable(AccessibilityUtil.isAccessibilityEnabled(getContext())); secondaryButton.setAccessibilityDelegate(accessibilityDelegate); - if (isVideoCall()) { - secondaryButton.setVisibility(View.VISIBLE); - } else { + if (isVideoUpgradeRequest()) { secondaryButton.setVisibility(View.INVISIBLE); + } else if (isVideoCall()) { + secondaryButton.setVisibility(View.VISIBLE); } } @@ -620,7 +627,11 @@ public class AnswerFragment extends Fragment view.setSystemUiVisibility(flags); if (isVideoCall() || isVideoUpgradeRequest()) { if (VideoUtils.hasCameraPermissionAndAllowedByUser(getContext())) { - answerVideoCallScreen = new AnswerVideoCallScreen(getCallId(), this, view); + if (isSelfManagedCamera()) { + answerVideoCallScreen = new SelfManagedAnswerVideoCallScreen(getCallId(), this, view); + } else { + answerVideoCallScreen = new AnswerVideoCallScreen(getCallId(), this, view); + } } else { view.findViewById(R.id.videocall_video_off).setVisibility(View.VISIBLE); } @@ -718,6 +729,10 @@ public class AnswerFragment extends Fragment return getArguments().getBoolean(ARG_IS_VIDEO_CALL); } + public boolean isSelfManagedCamera() { + return getArguments().getBoolean(ARG_IS_SELF_MANAGED_CAMERA); + } + @Override public void onAnswerProgressUpdate(@FloatRange(from = -1f, to = 1f) float answerProgress) { // Don't fade the window background for call waiting or video upgrades. Fading the background |