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

Commit 0738997d authored by Devci Telephony's avatar Devci Telephony Committed by Gerrit - the friendly Code Review server
Browse files

Merge "IMS-VT: Handle InCallActivity destroy when low battery dialog is...

Merge "IMS-VT: Handle InCallActivity destroy when low battery dialog is showing" into atel.lnx.2.0-dev
parents 407a8949 5128eddf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -366,6 +366,7 @@ public class InCallActivity extends TransactionSafeActivity implements FragmentD
    @Override
    protected void onDestroy() {
        Log.d(this, "onDestroy()...  this = " + this);
        InCallLowBatteryListener.getInstance().onDestroyInCallActivity();
        InCallPresenter.getInstance().unsetActivity(this);
        InCallPresenter.getInstance().updateIsChangingConfigurations();
        super.onDestroy();
+25 −1
Original line number Diff line number Diff line
@@ -170,6 +170,28 @@ public class InCallLowBatteryListener implements CallList.Listener, InCallDetail
        mLowBatteryMap.remove(call);
    }

    /**
      * This API handles InCallActivity destroy when low battery dialog is showing
      */
    public void onDestroyInCallActivity() {
        if (dismissPendingDialogs()) {
            Log.i(this, "onDestroyInCallActivity dismissed low battery dialog");

            /* Activity is destroyed when low battery dialog is showing, possibly
               by removing the activity from recent tasks list etc. Handle this by
               dismissing the existing low battery dialog and marking the entry
               against the call in low battery map that the low battery indication
               needs to be reprocessed for eg. when user brings back the call to
               foreground by pulling it from notification bar */
            Call call = mPrimaryCallTracker.getPrimaryCall();
            if (call == null) {
                Log.w(this, "onDestroyInCallActivity call is null");
                return;
            }
            mLowBatteryMap.replace(call, PROCESS_LOW_BATTERY);
        }
    }

    /**
     * This API conveys if incall experience is showing or not.
     *
@@ -512,10 +534,12 @@ public class InCallLowBatteryListener implements CallList.Listener, InCallDetail
     * This method dismisses the low battery dialog and
     * returns true if dialog is dimissed else false
     */
    public void dismissPendingDialogs() {
    public boolean dismissPendingDialogs() {
        if (isLowBatteryDialogShowing()) {
            mAlert.dismiss();
            mAlert = null;
            return true;
        }
        return false;
    }
}