Extract Manager interface

This commit is contained in:
AsamK 2021-09-15 21:40:47 +02:00
parent 1a81bbecbb
commit b91c162159
4 changed files with 1324 additions and 1060 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -126,9 +126,9 @@ public class ProvisioningManager {
profileKey, profileKey,
TrustNewIdentity.ON_FIRST_USE); TrustNewIdentity.ON_FIRST_USE);
Manager m = null; ManagerImpl m = null;
try { try {
m = new Manager(account, pathConfig, serviceEnvironmentConfig, userAgent); m = new ManagerImpl(account, pathConfig, serviceEnvironmentConfig, userAgent);
logger.debug("Refreshing pre keys"); logger.debug("Refreshing pre keys");
try { try {
@ -178,7 +178,7 @@ public class ProvisioningManager {
return false; return false;
} }
final var m = new Manager(signalAccount, pathConfig, serviceEnvironmentConfig, userAgent); final var m = new ManagerImpl(signalAccount, pathConfig, serviceEnvironmentConfig, userAgent);
try (m) { try (m) {
m.checkAccountState(); m.checkAccountState();
} catch (AuthorizationFailedException ignored) { } catch (AuthorizationFailedException ignored) {

View file

@ -177,9 +177,9 @@ public class RegistrationManager implements Closeable {
//accountManager.setGcmId(Optional.of(GoogleCloudMessaging.getInstance(this).register(REGISTRATION_ID))); //accountManager.setGcmId(Optional.of(GoogleCloudMessaging.getInstance(this).register(REGISTRATION_ID)));
account.finishRegistration(UuidUtil.parseOrNull(response.getUuid()), masterKey, pin); account.finishRegistration(UuidUtil.parseOrNull(response.getUuid()), masterKey, pin);
Manager m = null; ManagerImpl m = null;
try { try {
m = new Manager(account, pathConfig, serviceEnvironmentConfig, userAgent); m = new ManagerImpl(account, pathConfig, serviceEnvironmentConfig, userAgent);
account = null; account = null;
m.refreshPreKeys(); m.refreshPreKeys();