@ -36,7 +36,7 @@ abstract class BaseSuggestionsTask {
@@ -36,7 +36,7 @@ abstract class BaseSuggestionsTask {
static final int MAX_RESULTS = 5 ;
private static final long INTERVAL_DAY = TimeUnit . DAYS . toMillis ( 1 ) ;
private static final String DEFAULT_LANGUAGE = "en" ;
@NonNull private static final String DEFAULT_LANGUAGE = "en" ;
@Nullable private static String sLanguage ;
@NonNull private final SuggestionsResult mResultCallback ;
@NonNull private final Application mApplication ;
@ -46,7 +46,7 @@ abstract class BaseSuggestionsTask {
@@ -46,7 +46,7 @@ abstract class BaseSuggestionsTask {
@NonNull private String mQuery ;
@NonNull
protected abstract String get QueryUrl( @NonNull String query , @NonNull String language ) ;
protected abstract String create QueryUrl( @NonNull String query , @NonNull String language ) ;
protected abstract void parseResults ( @NonNull FileInputStream inputStream , @NonNull List < HistoryItem > results ) throws Exception ;
@ -113,7 +113,7 @@ abstract class BaseSuggestionsTask {
@@ -113,7 +113,7 @@ abstract class BaseSuggestionsTask {
* /
@NonNull
private File downloadSuggestionsForQuery ( @NonNull String query , String language , @NonNull Application app ) {
String queryUrl = get QueryUrl( query , language ) ;
String queryUrl = create QueryUrl( query , language ) ;
File cacheFile = new File ( app . getCacheDir ( ) , queryUrl . hashCode ( ) + SuggestionsAdapter . CACHE_FILE_TYPE ) ;
if ( System . currentTimeMillis ( ) - INTERVAL_DAY < cacheFile . lastModified ( ) ) {
return cacheFile ;