summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcalderwoodra <calderwoodra@google.com>2018-04-04 18:25:32 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-04-04 18:25:32 -0700
commita284eff5f14c178a36983518fefdb193413a09e5 (patch)
treeb27d66c1d3b649031ad52a8f87449ec0d582497e
parenta0fc98b466fb3ebd662dcf092162c8778c0c119c (diff)
parent98b2955ab09e552760f8b0e7fada4c57ca7ab43b (diff)
Merge "Added some logging for mysterious bugs." am: 4131ebda57
am: 98b2955ab0 Change-Id: I54b0c1c0dac70f268a8287fbb8f362b711bba672
-rw-r--r--java/com/android/dialer/main/impl/MainSearchController.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/java/com/android/dialer/main/impl/MainSearchController.java b/java/com/android/dialer/main/impl/MainSearchController.java
index 7b4bc3569..2279d56a7 100644
--- a/java/com/android/dialer/main/impl/MainSearchController.java
+++ b/java/com/android/dialer/main/impl/MainSearchController.java
@@ -184,7 +184,7 @@ public class MainSearchController implements SearchBarListener {
*/
private void hideDialpad(boolean animate) {
LogUtil.enterBlock("MainSearchController.hideDialpad");
- Assert.checkArgument(isDialpadVisible());
+ assertDialpadVisible();
fab.show();
toolbar.slideDown(animate, fragmentContainer);
@@ -291,7 +291,7 @@ public class MainSearchController implements SearchBarListener {
/** Calls {@link #hideDialpad(boolean)}, removes the search fragment and clears the dialpad. */
private void closeSearch(boolean animate) {
LogUtil.enterBlock("MainSearchController.closeSearch");
- Assert.checkArgument(isSearchVisible());
+ assertSearchIsVisible();
if (isDialpadVisible()) {
hideDialpad(animate);
} else if (!fab.isShown()) {
@@ -337,11 +337,26 @@ public class MainSearchController implements SearchBarListener {
&& fragment.isDialpadSlideUp();
}
+ private void assertDialpadVisible() {
+ DialpadFragment fragment = getDialpadFragment();
+ Assert.checkArgument(fragment != null, "Dialpad Fragment is null");
+ Assert.checkArgument(fragment.isAdded(), "Dialpad Fragment is no added");
+ Assert.checkArgument(!fragment.isHidden(), "Dialpad Fragment is hidden");
+ Assert.checkArgument(fragment.isDialpadSlideUp(), "Dialpad Fragment is slide down");
+ }
+
private boolean isSearchVisible() {
NewSearchFragment fragment = getSearchFragment();
return fragment != null && fragment.isAdded() && !fragment.isHidden();
}
+ private void assertSearchIsVisible() {
+ NewSearchFragment fragment = getSearchFragment();
+ Assert.checkArgument(fragment != null, "Search Fragment is null");
+ Assert.checkArgument(fragment.isAdded(), "Search Fragment is not added");
+ Assert.checkArgument(!fragment.isHidden(), "Search Fragment is hidden.");
+ }
+
/** Returns true if the search UI is visible. */
public boolean isInSearch() {
return isSearchVisible();