summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcalderwoodra <calderwoodra@google.com>2018-04-04 18:20:30 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-04-04 18:20:30 -0700
commit98b2955ab09e552760f8b0e7fada4c57ca7ab43b (patch)
treee7fa0a7230e221a823fbe868c5bdbb41b1d05e5f
parent7f1a323d15c6baac247bce44636ceb185df14bc0 (diff)
parent4131ebda57420cb08e033dfbfbfdc880f3688a2f (diff)
Merge "Added some logging for mysterious bugs."
am: 4131ebda57 Change-Id: Id214b332deca29ef67f9baaf86edb9c8f030b613
-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();