mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 16:19:33 +01:00
Rewrite the AppDependencies system.
This commit is contained in:
committed by
Cody Henthorne
parent
a0131bf39b
commit
b6a4e1f145
@@ -3,7 +3,7 @@ package org.thoughtcrime.securesms.net;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.dependencies.AppDependencies;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -50,11 +50,11 @@ public final class DeviceTransferBlockingInterceptor implements Interceptor {
|
||||
|
||||
public void blockNetwork() {
|
||||
blockNetworking = true;
|
||||
ApplicationDependencies.closeConnections();
|
||||
AppDependencies.resetNetwork();
|
||||
}
|
||||
|
||||
public void unblockNetwork() {
|
||||
blockNetworking = false;
|
||||
ApplicationDependencies.getIncomingMessageObserver();
|
||||
AppDependencies.getIncomingMessageObserver();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.thoughtcrime.securesms.net;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.dependencies.AppDependencies;
|
||||
import org.thoughtcrime.securesms.util.NetworkUtil;
|
||||
|
||||
import java.net.InetAddress;
|
||||
@@ -38,10 +38,10 @@ public class SequentialDns implements Dns {
|
||||
Log.w(TAG, String.format(Locale.ENGLISH, "Didn't find any addresses for %s using %s. Continuing.", hostname, dns.getClass().getSimpleName()));
|
||||
}
|
||||
} catch (UnknownHostException e) {
|
||||
Log.w(TAG, String.format(Locale.ENGLISH, "Failed to resolve %s using %s. Continuing. Network Type: %s", hostname, dns.getClass().getSimpleName(), NetworkUtil.getNetworkTypeDescriptor(ApplicationDependencies.getApplication())));
|
||||
Log.w(TAG, String.format(Locale.ENGLISH, "Failed to resolve %s using %s. Continuing. Network Type: %s", hostname, dns.getClass().getSimpleName(), NetworkUtil.getNetworkTypeDescriptor(AppDependencies.getApplication())));
|
||||
}
|
||||
}
|
||||
Log.w(TAG, "Failed to resolve using any DNS. Network Type: " + NetworkUtil.getNetworkTypeDescriptor(ApplicationDependencies.getApplication()));
|
||||
Log.w(TAG, "Failed to resolve using any DNS. Network Type: " + NetworkUtil.getNetworkTypeDescriptor(AppDependencies.getApplication()));
|
||||
throw new UnknownHostException(hostname);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user