diff options
author | Yorke Lee <yorkelee@google.com> | 2015-04-08 17:59:58 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2015-04-09 11:24:48 -0700 |
commit | 55576e529a3fa7183a698669374b9c2dd28ad5c5 (patch) | |
tree | 857d5ce331703ad8e75e375fbd54bbc16a83330f /InCallUI | |
parent | c846fef0f0183115dff49ee753ee1990c532c03e (diff) |
Show progress spinner when upgrading to video
Show spinner when waiting for remote consent.
Also correctly propagate sessionModification state when
downgrading to audio.
Bug: 20090442
Change-Id: If733ce99683436c751a26a6511e6a41bac637c30
Diffstat (limited to 'InCallUI')
5 files changed, 26 insertions, 15 deletions
diff --git a/InCallUI/res/layout-land/call_card_fragment.xml b/InCallUI/res/layout-land/call_card_fragment.xml index 0bb45a244..fb880e311 100644 --- a/InCallUI/res/layout-land/call_card_fragment.xml +++ b/InCallUI/res/layout-land/call_card_fragment.xml @@ -71,13 +71,6 @@ android:layout_height="wrap_content" android:layout_alignTop="@id/photo" /> - <fragment android:name="com.android.incallui.VideoCallFragment" - android:layout_alignParentStart="true" - android:layout_gravity="start|center_vertical" - android:id="@+id/videoCallFragment" - android:layout_width="match_parent" - android:layout_height="match_parent" /> - <!-- Progress spinner, useful for indicating pending operations such as upgrade to video. --> <FrameLayout android:id="@+id/progressSpinner" @@ -98,6 +91,13 @@ android:indeterminate="true" /> </FrameLayout> + <fragment android:name="com.android.incallui.VideoCallFragment" + android:layout_alignParentStart="true" + android:layout_gravity="start|center_vertical" + android:id="@+id/videoCallFragment" + android:layout_width="match_parent" + android:layout_height="match_parent" /> + <!-- Placeholder for the dialpad which is replaced with the dialpad fragment when shown. --> <FrameLayout android:id="@+id/dialpadFragmentContainer" diff --git a/InCallUI/res/layout/call_card_fragment.xml b/InCallUI/res/layout/call_card_fragment.xml index a5fd8f72a..9f18906de 100644 --- a/InCallUI/res/layout/call_card_fragment.xml +++ b/InCallUI/res/layout/call_card_fragment.xml @@ -70,13 +70,6 @@ android:background="@android:color/white" android:src="@drawable/img_no_image_automirrored" /> - <fragment android:name="com.android.incallui.VideoCallFragment" - android:id="@+id/videoCallFragment" - android:layout_alignParentTop="true" - android:layout_gravity="top|center_horizontal" - android:layout_width="match_parent" - android:layout_height="match_parent" /> - <!-- Progress spinner, useful for indicating pending operations such as upgrade to video. --> <FrameLayout android:id="@+id/progressSpinner" @@ -97,6 +90,13 @@ android:indeterminate="true" /> </FrameLayout> + <fragment android:name="com.android.incallui.VideoCallFragment" + android:id="@+id/videoCallFragment" + android:layout_alignParentTop="true" + android:layout_gravity="top|center_horizontal" + android:layout_width="match_parent" + android:layout_height="match_parent" /> + <!-- Secondary "Call info" block, for the background ("on hold") call. --> <include layout="@layout/secondary_call_info" /> diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index 401187a83..b327ed64c 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -249,6 +249,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> } maybeShowManageConferenceCallButton(); + maybeShowProgressSpinner(); final boolean enableEndCallButton = Call.State.isConnectingOrConnected(callState) && callState != Call.State.INCOMING && mPrimary != null; @@ -309,6 +310,13 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> getUi().showManageConferenceCallButton(shouldShowManageConference()); } + private void maybeShowProgressSpinner() { + final boolean show = mPrimary != null && mPrimary.getSessionModificationState() + == Call.SessionModificationState.WAITING_FOR_RESPONSE + && mPrimary.getState() == Call.State.ACTIVE; + getUi().setProgressSpinnerVisible(show); + } + /** * Determines if the manage conference button should be visible, based on the current primary * call. diff --git a/InCallUI/src/com/android/incallui/InCallVideoCallListener.java b/InCallUI/src/com/android/incallui/InCallVideoCallListener.java index cf2b859e0..24c911949 100644 --- a/InCallUI/src/com/android/incallui/InCallVideoCallListener.java +++ b/InCallUI/src/com/android/incallui/InCallVideoCallListener.java @@ -87,8 +87,10 @@ public class InCallVideoCallListener extends VideoCall.Listener { boolean isVideoCall = VideoProfile.VideoState.isVideo(responseProfile.getVideoState()); if (modifySucceeded && isVideoCall) { InCallVideoCallListenerNotifier.getInstance().upgradeToVideoSuccess(mCall); - } else if (!modifySucceeded) { + } else if (!modifySucceeded && isVideoCall) { InCallVideoCallListenerNotifier.getInstance().upgradeToVideoFail(status, mCall); + } else if (modifySucceeded && !isVideoCall) { + InCallVideoCallListenerNotifier.getInstance().downgradeToAudio(mCall); } } else { Log.d(this, "onSessionModifyResponseReceived request and response Profiles are null"); diff --git a/InCallUI/src/com/android/incallui/VideoCallPresenter.java b/InCallUI/src/com/android/incallui/VideoCallPresenter.java index 3f8a827c3..8ee30f2b3 100644 --- a/InCallUI/src/com/android/incallui/VideoCallPresenter.java +++ b/InCallUI/src/com/android/incallui/VideoCallPresenter.java @@ -941,6 +941,7 @@ public class VideoCallPresenter extends Presenter<VideoCallPresenter.VideoCallUi @Override public void onDowngradeToAudio(Call call) { + call.setSessionModificationState(Call.SessionModificationState.NO_REQUEST); // exit video mode exitVideoMode(); } |