Proactively set mVisible attribute in startSearch and stopSearch (not just in message handler).
This way someone can call searchManger.startSearch() and immediately have searchManger.isVisible() reflect the correct value. Fixes failing tests and bug 1993675
This commit is contained in:
@@ -190,6 +190,9 @@ implements DialogInterface.OnCancelListener, DialogInterface.OnDismissListener {
|
||||
msgData.putBundle(KEY_APP_SEARCH_DATA, appSearchData);
|
||||
msgData.putInt(KEY_IDENT, ident);
|
||||
mSearchUiThread.sendMessage(msg);
|
||||
// be a little more eager in setting this so isVisible will return the correct value if
|
||||
// called immediately after startSearch
|
||||
mVisible = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -199,6 +202,9 @@ implements DialogInterface.OnCancelListener, DialogInterface.OnDismissListener {
|
||||
public void stopSearch() {
|
||||
if (DBG) debug("stopSearch()");
|
||||
mSearchUiThread.sendEmptyMessage(MSG_STOP_SEARCH);
|
||||
// be a little more eager in setting this so isVisible will return the correct value if
|
||||
// called immediately after stopSearch
|
||||
mVisible = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user