From 8f5f0cba1d5970f305ee7263cdd6d739f13967ea Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Thu, 21 Jan 2016 09:58:16 -0800 Subject: Add downgrade to audio button for video calls. - Add downgrade to audio button for video calls where the call capabilities indicates that it is supported. - Requires N SDK or higher. Bug: 22728624 Change-Id: I92aaf1d1e77da82c2ad982a57bb2eae599cff4da --- InCallUI/res/drawable/btn_change_to_voice.xml | 31 ++++++++++++++++++++++ InCallUI/res/layout/call_button_fragment.xml | 7 +++++ .../com/android/incallui/CallButtonFragment.java | 22 +++++++++++---- .../com/android/incallui/CallButtonPresenter.java | 19 ++++++++++--- 4 files changed, 71 insertions(+), 8 deletions(-) create mode 100644 InCallUI/res/drawable/btn_change_to_voice.xml (limited to 'InCallUI') diff --git a/InCallUI/res/drawable/btn_change_to_voice.xml b/InCallUI/res/drawable/btn_change_to_voice.xml new file mode 100644 index 000000000..86a7f21d5 --- /dev/null +++ b/InCallUI/res/drawable/btn_change_to_voice.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/InCallUI/res/layout/call_button_fragment.xml b/InCallUI/res/layout/call_button_fragment.xml index 0cdaf23f7..db7576404 100644 --- a/InCallUI/res/layout/call_button_fragment.xml +++ b/InCallUI/res/layout/call_button_fragment.xml @@ -129,6 +129,13 @@ android:contentDescription="@string/onscreenPauseVideoText" android:visibility="gone" /> + + + = N and the call should NOT have the + * {@link android.telecom.Call.Details#CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO}. + * @param call The call. + * @return {@code true} if downgrading to an audio-only call from a video call is supported. + */ + private boolean isDowngradeToAudioSupported(Call call) { + return !call.can(CallSdkCompat.Details.CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO); + } + public void refreshMuteState() { // Restore the previous mute state if (mAutomaticallyMuted && -- cgit v1.2.3