summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-06-13 16:53:54 -0700
committerAndrew Lee <anwlee@google.com>2014-06-13 17:20:12 -0700
commita851542c69872ffa6c5615fd8cdd1381f1b13b93 (patch)
treeec011ec018362da1938377a0f211d5914dbbe2ff /src
parent00a3d5d576d53b43a46849bf40c43bccde44a9b2 (diff)
Clear fragments properly when search term is erased.
Specifically, in the scenario in the bug the dialpad was not shown but we actually wanted to clear the speed dial fragment, not the regular search fragment. Change this to affect the visible fragment, rather than whether or not the dialpad is shown. This onClick pathway is no longer used too, so deleting. Bug: 15516704 Change-Id: Icd4419e0746ce0e2bcb9c9437dbac77d64bb8c98
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/DialtactsActivity.java11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index 19af4ef91..f5a2d3ed5 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -310,9 +310,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
}
}
- if (mIsDialpadShown && mSmartDialSearchFragment != null) {
+ if (mSmartDialSearchFragment != null && mSmartDialSearchFragment.isVisible()) {
mSmartDialSearchFragment.setQueryString(mSearchQuery, false /* delaySelection */);
- } else if (mRegularSearchFragment != null) {
+ } else if (mRegularSearchFragment != null && mRegularSearchFragment.isVisible()) {
mRegularSearchFragment.setQueryString(mSearchQuery, false /* delaySelection */);
}
}
@@ -550,13 +550,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
mDialpadFragment.dialButtonPressed();
}
break;
- case R.id.search_close_button:
- // Clear the search field
- if (!TextUtils.isEmpty(mSearchView.getText())) {
- mDialpadFragment.clearDialpad();
- mSearchView.setText(null);
- }
- break;
case R.id.voice_search_button:
try {
startActivityForResult(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH),