From c298ec9c33d105971dbe612cd7798f5e9af34f71 Mon Sep 17 00:00:00 2001 From: calderwoodra Date: Mon, 16 Apr 2018 12:35:09 -0700 Subject: Don't close search if the user leaves with the dialpad open. Bug: 77736276 Test: MainActivityOldPeerSearchIntegrationTest PiperOrigin-RevId: 193081987 Change-Id: I466b6094f4d7851033be3bf68f170485a2ec733d --- java/com/android/dialer/main/impl/MainSearchController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/java/com/android/dialer/main/impl/MainSearchController.java b/java/com/android/dialer/main/impl/MainSearchController.java index dbeed0d69..b9a6654b6 100644 --- a/java/com/android/dialer/main/impl/MainSearchController.java +++ b/java/com/android/dialer/main/impl/MainSearchController.java @@ -95,6 +95,8 @@ public class MainSearchController implements SearchBarListener { * want to wait until onPause is called otherwise the transition will look extremely janky. */ private boolean closeSearchOnPause; + + private boolean callPlacedFromSearch; private boolean requestingPermission; public MainSearchController( @@ -472,10 +474,11 @@ public class MainSearchController implements SearchBarListener { closeKeyboard(); if (closeSearchOnPause) { - closeSearchOnPause = false; - if (isInSearch()) { + if (isInSearch() && (callPlacedFromSearch || !isDialpadVisible())) { closeSearch(false); } + closeSearchOnPause = false; + callPlacedFromSearch = false; } } @@ -494,6 +497,7 @@ public class MainSearchController implements SearchBarListener { @Override public void onCallPlacedFromSearch() { closeSearchOnPause = true; + callPlacedFromSearch = true; } @Override -- cgit v1.2.3