mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-01-30 16:35:00 +01:00
changed Dns to TwidereDns
This commit is contained in:
parent
ddc94a718d
commit
eb4474ade6
@ -129,6 +129,7 @@ import org.mariotaku.twidere.util.Utils;
|
|||||||
import org.mariotaku.twidere.util.collection.CompactHashSet;
|
import org.mariotaku.twidere.util.collection.CompactHashSet;
|
||||||
import org.mariotaku.twidere.util.dagger.GeneralComponentHelper;
|
import org.mariotaku.twidere.util.dagger.GeneralComponentHelper;
|
||||||
import org.mariotaku.twidere.util.message.UnreadCountUpdatedEvent;
|
import org.mariotaku.twidere.util.message.UnreadCountUpdatedEvent;
|
||||||
|
import org.mariotaku.twidere.util.net.TwidereDns;
|
||||||
import org.oshkimaadziig.george.androidutils.SpanFormatter;
|
import org.oshkimaadziig.george.androidutils.SpanFormatter;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -147,8 +148,6 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import okhttp3.Dns;
|
|
||||||
|
|
||||||
public final class TwidereDataProvider extends ContentProvider implements Constants, OnSharedPreferenceChangeListener,
|
public final class TwidereDataProvider extends ContentProvider implements Constants, OnSharedPreferenceChangeListener,
|
||||||
LazyLoadCallback {
|
LazyLoadCallback {
|
||||||
|
|
||||||
@ -165,7 +164,7 @@ public final class TwidereDataProvider extends ContentProvider implements Consta
|
|||||||
@Inject
|
@Inject
|
||||||
SharedPreferencesWrapper mPreferences;
|
SharedPreferencesWrapper mPreferences;
|
||||||
@Inject
|
@Inject
|
||||||
Dns mDns;
|
TwidereDns mDns;
|
||||||
@Inject
|
@Inject
|
||||||
Bus mBus;
|
Bus mBus;
|
||||||
@Inject
|
@Inject
|
||||||
|
@ -72,7 +72,6 @@ import javax.inject.Singleton;
|
|||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
import dagger.Provides;
|
import dagger.Provides;
|
||||||
import edu.tsinghua.hotmobi.HotMobiLogger;
|
import edu.tsinghua.hotmobi.HotMobiLogger;
|
||||||
import okhttp3.Dns;
|
|
||||||
|
|
||||||
import static org.mariotaku.twidere.util.Utils.getInternalCacheDir;
|
import static org.mariotaku.twidere.util.Utils.getInternalCacheDir;
|
||||||
|
|
||||||
@ -134,7 +133,7 @@ public class ApplicationModule implements Constants {
|
|||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
public RestHttpClient restHttpClient(SharedPreferencesWrapper prefs, Dns dns) {
|
public RestHttpClient restHttpClient(SharedPreferencesWrapper prefs, TwidereDns dns) {
|
||||||
return HttpClientFactory.createRestHttpClient(application, prefs, dns);
|
return HttpClientFactory.createRestHttpClient(application, prefs, dns);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,7 +195,7 @@ public class ApplicationModule implements Constants {
|
|||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
public Dns dns(SharedPreferencesWrapper preferences) {
|
public TwidereDns dns(SharedPreferencesWrapper preferences) {
|
||||||
return new TwidereDns(application, preferences);
|
return new TwidereDns(application, preferences);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
package org.mariotaku.twidere.util.dagger;
|
package org.mariotaku.twidere.util.dagger;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
|
||||||
|
|
||||||
import org.mariotaku.restfu.http.RestHttpClient;
|
import org.mariotaku.restfu.http.RestHttpClient;
|
||||||
import org.mariotaku.twidere.util.ActivityTracker;
|
import org.mariotaku.twidere.util.ActivityTracker;
|
||||||
@ -28,11 +27,11 @@ import org.mariotaku.twidere.util.ExternalThemeManager;
|
|||||||
import org.mariotaku.twidere.util.ReadStateManager;
|
import org.mariotaku.twidere.util.ReadStateManager;
|
||||||
import org.mariotaku.twidere.util.SharedPreferencesWrapper;
|
import org.mariotaku.twidere.util.SharedPreferencesWrapper;
|
||||||
import org.mariotaku.twidere.util.TwidereValidator;
|
import org.mariotaku.twidere.util.TwidereValidator;
|
||||||
|
import org.mariotaku.twidere.util.net.TwidereDns;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import edu.tsinghua.hotmobi.HotMobiLogger;
|
import edu.tsinghua.hotmobi.HotMobiLogger;
|
||||||
import okhttp3.Dns;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by mariotaku on 15/12/31.
|
* Created by mariotaku on 15/12/31.
|
||||||
@ -51,7 +50,7 @@ public class DependencyHolder {
|
|||||||
@Inject
|
@Inject
|
||||||
ActivityTracker mActivityTracker;
|
ActivityTracker mActivityTracker;
|
||||||
@Inject
|
@Inject
|
||||||
Dns mDns;
|
TwidereDns mDns;
|
||||||
@Inject
|
@Inject
|
||||||
TwidereValidator mValidator;
|
TwidereValidator mValidator;
|
||||||
@Inject
|
@Inject
|
||||||
@ -86,7 +85,7 @@ public class DependencyHolder {
|
|||||||
return mActivityTracker;
|
return mActivityTracker;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Dns getDns() {
|
public TwidereDns getDns() {
|
||||||
return mDns;
|
return mDns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,14 +39,12 @@ import java.util.List;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import okhttp3.Dns;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by mariotaku on 15/12/31.
|
* Created by mariotaku on 15/12/31.
|
||||||
*/
|
*/
|
||||||
public class TwidereProxySelector extends ProxySelector {
|
public class TwidereProxySelector extends ProxySelector {
|
||||||
@Inject
|
@Inject
|
||||||
Dns dns;
|
TwidereDns dns;
|
||||||
private final Proxy.Type type;
|
private final Proxy.Type type;
|
||||||
@NonNull
|
@NonNull
|
||||||
private final String host;
|
private final String host;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user