Bug 1269481 - Update suggestClient if suggestTemplate changes r=mkaply a=ritu

MozReview-Commit-ID: LmsgSFda6Nv
This commit is contained in:
Andrzej Hunt 2016-05-04 11:25:59 -07:00
parent 984154ed5a
commit 80f16b2a9b
2 changed files with 6 additions and 1 deletions

View File

@ -57,6 +57,10 @@ public class SuggestClient {
mCheckNetwork = checkNetwork;
}
public String getSuggestTemplate() {
return mSuggestTemplate;
}
/**
* Queries for a given search term and returns an ArrayList of suggestions.
*/

View File

@ -736,7 +736,8 @@ public class BrowserSearch extends HomeFragment
}
private void ensureSuggestClientIsSet(final String suggestTemplate) {
if (mSuggestClient != null) {
// Don't update the suggestClient if we already have a client with the correct template
if (mSuggestClient != null && suggestTemplate.equals(mSuggestClient.getSuggestTemplate())) {
return;
}