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

Commit 8e5c8b11 authored by Yorke Lee's avatar Yorke Lee
Browse files

Fix brief flash when making a call from search

Perform the fragment transaction to hide search in onPause.
This prevents the brief flash that shows up in the time between
pausing the activity and starting the in-call UI, but also
ensures that we execute the transaction before onSaveInstance is called
to prevent b/10953115.

Bug: 10780429
Change-Id: I85b4c7e6719acede845d604087344401edc9ef3d
parent 05aaae3b
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -147,6 +147,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O

    private boolean mInDialpadSearch;
    private boolean mInRegularSearch;
    private boolean mClearSearchOnPause;

    /**
     * True if the dialpad is only temporarily showing due to being in call
@@ -192,14 +193,14 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
                    // CallLog screen (search UI will be automatically exited).
                    PhoneNumberInteraction.startInteractionForPhoneCall(
                        DialtactsActivity.this, dataUri, getCallOrigin());
                    hideDialpadAndSearchUi();
                    mClearSearchOnPause = true;
                }

                @Override
                public void onCallNumberDirectly(String phoneNumber) {
                    Intent intent = CallUtil.getCallIntent(phoneNumber, getCallOrigin());
                    startActivity(intent);
                    hideDialpadAndSearchUi();
                    mClearSearchOnPause = true;
                }

                @Override
@@ -328,6 +329,15 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
        mDialerDatabaseHelper.startSmartDialUpdateThread();
    }

    @Override
    protected void onPause() {
        if (mClearSearchOnPause) {
            hideDialpadAndSearchUi();
            mClearSearchOnPause = false;
        }
        super.onPause();
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);