2016-12-20 17:55:52 +00:00
|
|
|
package org.thoughtcrime.securesms.push;
|
|
|
|
|
|
|
|
import android.content.Context;
|
2017-01-11 23:37:51 +00:00
|
|
|
|
2016-12-20 17:55:52 +00:00
|
|
|
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
|
|
|
import org.whispersystems.signalservice.api.SignalServiceAccountManager;
|
|
|
|
|
2020-02-27 22:07:01 +00:00
|
|
|
import network.loki.messenger.BuildConfig;
|
|
|
|
|
2016-12-20 17:55:52 +00:00
|
|
|
public class AccountManagerFactory {
|
|
|
|
|
2018-12-06 20:14:20 +00:00
|
|
|
private static final String TAG = AccountManagerFactory.class.getSimpleName();
|
2017-01-11 23:37:51 +00:00
|
|
|
|
2016-12-20 17:55:52 +00:00
|
|
|
public static SignalServiceAccountManager createManager(Context context) {
|
2016-12-30 04:54:05 +00:00
|
|
|
return new SignalServiceAccountManager(new SignalServiceNetworkAccess(context).getConfiguration(context),
|
2016-12-20 17:55:52 +00:00
|
|
|
TextSecurePreferences.getLocalNumber(context),
|
|
|
|
TextSecurePreferences.getPushServerPassword(context),
|
|
|
|
BuildConfig.USER_AGENT);
|
|
|
|
}
|
|
|
|
|
2017-01-11 23:37:51 +00:00
|
|
|
public static SignalServiceAccountManager createManager(final Context context, String number, String password) {
|
2016-12-30 04:54:05 +00:00
|
|
|
return new SignalServiceAccountManager(new SignalServiceNetworkAccess(context).getConfiguration(number),
|
2016-12-20 17:55:52 +00:00
|
|
|
number, password, BuildConfig.USER_AGENT);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|