fixed R8 weirdness

This commit is contained in:
Daniel Gultsch 2019-09-18 11:04:36 +02:00
parent 02351dc0fb
commit af74c3604c
3 changed files with 8 additions and 5 deletions

3
proguard-rules.pro vendored
View file

@ -21,6 +21,9 @@
-dontwarn java.lang.** -dontwarn java.lang.**
-dontwarn javax.lang.** -dontwarn javax.lang.**
-keepclassmembers class eu.siacs.conversations.http.services.** {
!transient <fields>;
}
# Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and # Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and
# EnclosingMethod is required to use InnerClasses. # EnclosingMethod is required to use InnerClasses.

View file

@ -4,7 +4,6 @@ import com.google.common.base.Objects;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set; import java.util.Set;
import eu.siacs.conversations.services.AvatarService; import eu.siacs.conversations.services.AvatarService;
@ -83,7 +82,7 @@ public interface MuclumbusService {
class SearchRequest { class SearchRequest {
public Set<String> keywords; public final Set<String> keywords;
public SearchRequest(String keyword) { public SearchRequest(String keyword) {
this.keywords = Collections.singleton(keyword); this.keywords = Collections.singleton(keyword);

View file

@ -38,7 +38,8 @@ public class ChannelDiscoveryService {
} }
void initializeMuclumbusService() { void initializeMuclumbusService() {
OkHttpClient.Builder builder = new OkHttpClient.Builder(); final OkHttpClient.Builder builder = new OkHttpClient.Builder();
if (service.useTorToConnect()) { if (service.useTorToConnect()) {
try { try {
builder.proxy(HttpConnectionManager.getProxy()); builder.proxy(HttpConnectionManager.getProxy());
@ -57,7 +58,6 @@ public class ChannelDiscoveryService {
void discover(String query, OnChannelSearchResultsFound onChannelSearchResultsFound) { void discover(String query, OnChannelSearchResultsFound onChannelSearchResultsFound) {
final boolean all = query == null || query.trim().isEmpty(); final boolean all = query == null || query.trim().isEmpty();
Log.d(Config.LOGTAG, "discover channels. query=" + query);
List<MuclumbusService.Room> result = cache.getIfPresent(all ? "" : query); List<MuclumbusService.Room> result = cache.getIfPresent(all ? "" : query);
if (result != null) { if (result != null) {
onChannelSearchResultsFound.onChannelSearchResultsFound(result); onChannelSearchResultsFound.onChannelSearchResultsFound(result);
@ -98,7 +98,8 @@ public class ChannelDiscoveryService {
} }
private void discoverChannels(final String query, OnChannelSearchResultsFound listener) { private void discoverChannels(final String query, OnChannelSearchResultsFound listener) {
Call<MuclumbusService.SearchResult> searchResultCall = muclumbusService.search(new MuclumbusService.SearchRequest(query)); MuclumbusService.SearchRequest searchRequest = new MuclumbusService.SearchRequest(query);
Call<MuclumbusService.SearchResult> searchResultCall = muclumbusService.search(searchRequest);
searchResultCall.enqueue(new Callback<MuclumbusService.SearchResult>() { searchResultCall.enqueue(new Callback<MuclumbusService.SearchResult>() {
@Override @Override