mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-30 03:26:26 +00:00
Specify ConnectionSpecs for domain fronts
// FREEBIE
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
package org.thoughtcrime.securesms.push;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.AsyncTask;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
|
||||
import com.google.android.gms.common.GooglePlayServicesRepairableException;
|
||||
import com.google.android.gms.security.ProviderInstaller;
|
||||
|
||||
import org.thoughtcrime.securesms.BuildConfig;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
@@ -9,6 +16,8 @@ import org.whispersystems.signalservice.internal.push.SignalServiceUrl;
|
||||
|
||||
public class AccountManagerFactory {
|
||||
|
||||
private static final String TAG = AccountManagerFactory.class.getName();
|
||||
|
||||
public static SignalServiceAccountManager createManager(Context context) {
|
||||
return new SignalServiceAccountManager(new SignalServiceNetworkAccess(context).getConfiguration(context),
|
||||
TextSecurePreferences.getLocalNumber(context),
|
||||
@@ -16,7 +25,21 @@ public class AccountManagerFactory {
|
||||
BuildConfig.USER_AGENT);
|
||||
}
|
||||
|
||||
public static SignalServiceAccountManager createManager(Context context, String number, String password) {
|
||||
public static SignalServiceAccountManager createManager(final Context context, String number, String password) {
|
||||
if (new SignalServiceNetworkAccess(context).isCensored(number)) {
|
||||
new AsyncTask<Void, Void, Void>() {
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
try {
|
||||
ProviderInstaller.installIfNeeded(context);
|
||||
} catch (Throwable t) {
|
||||
Log.w(TAG, t);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
|
||||
return new SignalServiceAccountManager(new SignalServiceNetworkAccess(context).getConfiguration(number),
|
||||
number, password, BuildConfig.USER_AGENT);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user