Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55576e52 authored by Yorke Lee's avatar Yorke Lee
Browse files

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
parent c846fef0
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -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"
+7 −7
Original line number Diff line number Diff line
@@ -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" />

+8 −0
Original line number Diff line number Diff line
@@ -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.
+3 −1
Original line number Diff line number Diff line
@@ -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");
+1 −0
Original line number Diff line number Diff line
@@ -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();
    }