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

Commit 53ec9375 authored by Ravi Paluri's avatar Ravi Paluri Committed by Gerrit - the friendly Code Review server
Browse files

IMS-VT: Handle configuration changes on low battery Video call

If UE orientation changes with low battery dialog showing, then
low battery dialog is dismissed and <mAlert> is set to NULL.
This dialog is later shown to user when InCallActivity is
is recreated. At this time, onDimiss of AlertDialog is
getting called that is bringing down the dialog. Fix this
by not setting <mAlert> to NULL in onDismiss handler of
AlertDialog

Also remove code done with <onConfigurationChanging> API that
handles configuration changes on low battery dialog since this
is implicitly handled with <onDestroyInCallActivity> API.

Change-Id: I74c272b22dcb88e2e741690e2cf46af3ebf36f94
CRs-Fixed: 1024387
parent 5051b2c2
Loading
Loading
Loading
Loading
+0 −26
Original line number Diff line number Diff line
@@ -205,10 +205,6 @@ public class InCallLowBatteryListener implements CallList.Listener, InCallDetail
            return;
        }

        if (InCallPresenter.getInstance().isChangingConfigurations()) {
            onConfigurationChanging(call);
        }

        maybeProcessLowBatteryIndication(call);
    }

@@ -297,26 +293,6 @@ public class InCallLowBatteryListener implements CallList.Listener, InCallDetail
        }
    }

    /**
     * This API handles configuration changes done on low battery video call
     *
     * @param call The call on which configuration changes happened
     */
    private void onConfigurationChanging(Call call) {
        if (call == null || !mPrimaryCallTracker.isPrimaryCall(call)) {
           return;
        }

        Log.d(this, "onConfigurationChanging call = " + call);
        /* If UE orientation changes with low battery dialog showing, then we need to
           re-process the low battery indication to ensure that the low battery dialog
           will be shown to user when the InCallActivity is recreated */
        if (isLowBatteryDialogShowing()) {
            dismissPendingDialogs();
            mLowBatteryMap.replace(call, PROCESS_LOW_BATTERY);
        }
    }

    /**
     * Handles changes to the details of the call.
     *
@@ -421,8 +397,6 @@ public class InCallLowBatteryListener implements CallList.Listener, InCallDetail
        alertDialog.setOnDismissListener(new OnDismissListener() {
            @Override
            public void onDismiss(final DialogInterface dialog) {
                Log.i(this, "displayLowBatteryAlert onDismiss");
                mAlert = null;
            }
        });