Revert AppReadiness singleton.

pull/1/head
Matthew Chen 7 years ago
parent 27700ef78f
commit 9323e411fc

@ -9,7 +9,6 @@
#import <SignalMessaging/OWSDatabaseMigration.h>
#import <SignalMessaging/OWSProfileManager.h>
#import <SignalMessaging/SignalMessaging-Swift.h>
#import <SignalServiceKit/AppReadiness.h>
#import <SignalServiceKit/ContactDiscoveryService.h>
#import <SignalServiceKit/OWS2FAManager.h>
#import <SignalServiceKit/OWSBackgroundTask.h>
@ -70,7 +69,6 @@ NS_ASSUME_NONNULL_BEGIN
TSSocketManager *socketManager = [[TSSocketManager alloc] init];
TSAccountManager *tsAccountManager = [[TSAccountManager alloc] initWithPrimaryStorage:primaryStorage];
OWS2FAManager *ows2FAManager = [[OWS2FAManager alloc] initWithPrimaryStorage:primaryStorage];
AppReadiness *appReadiness = [[AppReadiness alloc] initDefault];
OWSDisappearingMessagesJob *disappearingMessagesJob =
[[OWSDisappearingMessagesJob alloc] initWithPrimaryStorage:primaryStorage];
ContactDiscoveryService *contactDiscoveryService = [[ContactDiscoveryService alloc] initDefault];
@ -93,7 +91,6 @@ NS_ASSUME_NONNULL_BEGIN
socketManager:socketManager
tsAccountManager:tsAccountManager
ows2FAManager:ows2FAManager
appReadiness:appReadiness
disappearingMessagesJob:disappearingMessagesJob
contactDiscoveryService:contactDiscoveryService]];

@ -4,7 +4,6 @@
NS_ASSUME_NONNULL_BEGIN
@class AppReadiness;
@class ContactDiscoveryService;
@class ContactsUpdater;
@class OWS2FAManager;
@ -46,7 +45,6 @@ NS_ASSUME_NONNULL_BEGIN
socketManager:(TSSocketManager *)socketManager
tsAccountManager:(TSAccountManager *)tsAccountManager
ows2FAManager:(OWS2FAManager *)ows2FAManager
appReadiness:(AppReadiness *)appReadiness
disappearingMessagesJob:(OWSDisappearingMessagesJob *)disappearingMessagesJob
contactDiscoveryService:(ContactDiscoveryService *)contactDiscoveryService NS_DESIGNATED_INITIALIZER;
@ -77,7 +75,6 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, readonly) TSSocketManager *socketManager;
@property (nonatomic, readonly) TSAccountManager *tsAccountManager;
@property (nonatomic, readonly) OWS2FAManager *ows2FAManager;
@property (nonatomic, readonly) AppReadiness *appReadiness;
@property (nonatomic, readonly) OWSDisappearingMessagesJob *disappearingMessagesJob;
@property (nonatomic, readonly) ContactDiscoveryService *contactDiscoveryService;

@ -28,7 +28,6 @@ static SSKEnvironment *sharedSSKEnvironment;
@property (nonatomic) TSSocketManager *socketManager;
@property (nonatomic) TSAccountManager *tsAccountManager;
@property (nonatomic) OWS2FAManager *ows2FAManager;
@property (nonatomic) AppReadiness *appReadiness;
@property (nonatomic) OWSDisappearingMessagesJob *disappearingMessagesJob;
@property (nonatomic) ContactDiscoveryService *contactDiscoveryService;
@ -58,7 +57,6 @@ static SSKEnvironment *sharedSSKEnvironment;
socketManager:(TSSocketManager *)socketManager
tsAccountManager:(TSAccountManager *)tsAccountManager
ows2FAManager:(OWS2FAManager *)ows2FAManager
appReadiness:(AppReadiness *)appReadiness
disappearingMessagesJob:(OWSDisappearingMessagesJob *)disappearingMessagesJob
contactDiscoveryService:(ContactDiscoveryService *)contactDiscoveryService {
self = [super init];
@ -82,7 +80,6 @@ static SSKEnvironment *sharedSSKEnvironment;
OWSAssertDebug(socketManager);
OWSAssertDebug(tsAccountManager);
OWSAssertDebug(ows2FAManager);
OWSAssertDebug(appReadiness);
OWSAssertDebug(disappearingMessagesJob);
OWSAssertDebug(contactDiscoveryService);
@ -102,7 +99,6 @@ static SSKEnvironment *sharedSSKEnvironment;
_socketManager = socketManager;
_tsAccountManager = tsAccountManager;
_ows2FAManager = ows2FAManager;
_appReadiness = appReadiness;
_disappearingMessagesJob = disappearingMessagesJob;
_contactDiscoveryService = contactDiscoveryService;

@ -3,7 +3,6 @@
//
#import "MockSSKEnvironment.h"
#import "AppReadiness.h"
#import "ContactDiscoveryService.h"
#import "OWS2FAManager.h"
#import "OWSBatchMessageProcessor.h"
@ -65,7 +64,6 @@ NS_ASSUME_NONNULL_BEGIN
TSSocketManager *socketManager = [[TSSocketManager alloc] init];
TSAccountManager *tsAccountManager = [[TSAccountManager alloc] initWithPrimaryStorage:primaryStorage];
OWS2FAManager *ows2FAManager = [[OWS2FAManager alloc] initWithPrimaryStorage:primaryStorage];
AppReadiness *appReadiness = [[AppReadiness alloc] initDefault];
OWSDisappearingMessagesJob *disappearingMessagesJob =
[[OWSDisappearingMessagesJob alloc] initWithPrimaryStorage:primaryStorage];
ContactDiscoveryService *contactDiscoveryService = [[ContactDiscoveryService alloc] initDefault];
@ -86,7 +84,6 @@ NS_ASSUME_NONNULL_BEGIN
socketManager:socketManager
tsAccountManager:tsAccountManager
ows2FAManager:ows2FAManager
appReadiness:appReadiness
disappearingMessagesJob:disappearingMessagesJob
contactDiscoveryService:contactDiscoveryService];
if (!self) {

@ -10,8 +10,6 @@ typedef void (^AppReadyBlock)(void);
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initDefault NS_DESIGNATED_INITIALIZER;
// This method can be called on any thread.
+ (BOOL)isAppReady;

@ -3,7 +3,6 @@
//
#import "AppReadiness.h"
#import "SSKEnvironment.h"
#import <SignalCoreKit/Threading.h>
NS_ASSUME_NONNULL_BEGIN
@ -22,9 +21,12 @@ NS_ASSUME_NONNULL_BEGIN
+ (instancetype)sharedManager
{
OWSAssertDebug(SSKEnvironment.shared.appReadiness);
return SSKEnvironment.shared.appReadiness;
static AppReadiness *sharedMyManager = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedMyManager = [[self alloc] initDefault];
});
return sharedMyManager;
}
- (instancetype)initDefault

Loading…
Cancel
Save