|
|
|
@ -24,7 +24,6 @@ import java.util.ArrayList;
@@ -24,7 +24,6 @@ import java.util.ArrayList;
|
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Locale; |
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
import java.util.regex.Pattern; |
|
|
|
|
import java.util.zip.GZIPInputStream; |
|
|
|
|
|
|
|
|
|
import javax.net.ssl.HttpsURLConnection; |
|
|
|
@ -53,7 +52,6 @@ public final class DuckSuggestionsTask {
@@ -53,7 +52,6 @@ public final class DuckSuggestionsTask {
|
|
|
|
|
|
|
|
|
|
private static final String TAG = RetrieveSuggestionsTask.class.getSimpleName(); |
|
|
|
|
|
|
|
|
|
private static final Pattern SPACE_PATTERN = Pattern.compile(" ", Pattern.LITERAL); |
|
|
|
|
private static final String ENCODING = "UTF-8"; |
|
|
|
|
private static final long INTERVAL_DAY = TimeUnit.DAYS.toMillis(1); |
|
|
|
|
private static final String DEFAULT_LANGUAGE = "en"; |
|
|
|
@ -91,7 +89,6 @@ public final class DuckSuggestionsTask {
@@ -91,7 +89,6 @@ public final class DuckSuggestionsTask {
|
|
|
|
|
void run() { |
|
|
|
|
List<HistoryItem> filter = new ArrayList<>(5); |
|
|
|
|
try { |
|
|
|
|
mQuery = SPACE_PATTERN.matcher(mQuery).replaceAll("+"); |
|
|
|
|
mQuery = URLEncoder.encode(mQuery, ENCODING); |
|
|
|
|
} catch (UnsupportedEncodingException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|