From 8e5c8b11eb9516fa9b8407e0aa16c0405b5e717e Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Tue, 1 Oct 2013 14:37:55 -0700 Subject: 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 --- src/com/android/dialer/DialtactsActivity.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 12a0f2bd9..42cbbf4c1 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -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); -- cgit v1.2.3