summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--java/com/android/dialer/main/impl/MainSearchController.java19
1 files changed, 4 insertions, 15 deletions
diff --git a/java/com/android/dialer/main/impl/MainSearchController.java b/java/com/android/dialer/main/impl/MainSearchController.java
index e0d42abe6..9b734f40c 100644
--- a/java/com/android/dialer/main/impl/MainSearchController.java
+++ b/java/com/android/dialer/main/impl/MainSearchController.java
@@ -269,15 +269,12 @@ public class MainSearchController implements SearchBarListener {
mainActivity.getFragmentManager().beginTransaction().remove(getSearchFragment()).commit();
// Clear the dialpad so the phone number isn't persisted between search sessions.
- getDialpadFragment().clearDialpad();
+ if (getDialpadFragment() != null) {
+ getDialpadFragment().clearDialpad();
+ }
}
- /**
- * Returns {@link DialpadFragment}.
- *
- * <p>Unless this method is being called for the first time in {@link #openSearch(Optional)} or
- * {@link #showDialpad(boolean)}, it should never return null.
- */
+ @Nullable
protected DialpadFragment getDialpadFragment() {
return (DialpadFragment)
mainActivity.getFragmentManager().findFragmentByTag(DIALPAD_FRAGMENT_TAG);
@@ -334,14 +331,6 @@ public class MainSearchController implements SearchBarListener {
transaction.show(getSearchFragment());
}
- // Add the dialpad fragment but keep it hidden
- if (getDialpadFragment() == null) {
- DialpadFragment dialpadFragment = new DialpadFragment();
- transaction
- .add(R.id.dialpad_fragment_container, dialpadFragment, DIALPAD_FRAGMENT_TAG)
- .hide(dialpadFragment);
- }
-
transaction.commit();
}