Merge branch 'charlesmchen/singletonAssert'

This commit is contained in:
Matthew Chen 2017-04-03 14:53:55 -04:00
commit eb68746b6d
9 changed files with 29 additions and 3 deletions

View file

@ -132,7 +132,7 @@ CHECKOUT OPTIONS:
:commit: cbf2f47d59dd54d6d720fe787f835bd767443bb6
:git: https://github.com/WhisperSystems/SignalProtocolKit.git
SignalServiceKit:
:commit: 8b5f82eb6d8393074987697cea6986b55fec800e
:commit: e4ec7298441e82c8c5cd0678ea165dc3e12b2986
:git: https://github.com/WhisperSystems/SignalServiceKit.git
SocketRocket:
:commit: 877ac7438be3ad0b45ef5ca3969574e4b97112bf

View file

@ -21,7 +21,7 @@ class CallNotificationsAdapter: NSObject {
// if #available(iOS 10.0, *) {
// adaptee = UserNotificationsAdaptee()
// } else {
adaptee = NotificationsManager()
adaptee = Environment.getCurrent().notificationsManager
// }
}

View file

@ -41,6 +41,8 @@ NSString *const OWSContactsManagerSignalRecipientsDidChangeNotification =
_latestContactsById = @{};
_avatarCache = [NSCache new];
OWSSingletonAssert();
return self;
}

View file

@ -52,6 +52,8 @@ static Environment *environment = nil;
_networkManager = networkManager;
_messageSender = messageSender;
OWSSingletonAssert();
return self;
}

View file

@ -17,12 +17,14 @@
@interface NotificationsManager ()
@property SystemSoundID newMessageSound;
@property (nonatomic) SystemSoundID newMessageSound;
@property (nonatomic, readonly) NSMutableDictionary<NSString *, UILocalNotification *> *currentNotifications;
@property (nonatomic, readonly) NotificationType notificationPreviewType;
@end
#pragma mark -
@implementation NotificationsManager
- (instancetype)init
@ -37,6 +39,8 @@
NSURL *newMessageURL = [[NSBundle mainBundle] URLForResource:@"NewMessage" withExtension:@"aifc"];
AudioServicesCreateSystemSoundID((__bridge CFURLRef)newMessageURL, &_newMessageSound);
OWSSingletonAssert();
return self;
}

View file

@ -29,6 +29,18 @@ NSString *const PropertyListPreferencesKeyHasDeclinedNoContactsView = @"hasDecli
@implementation PropertyListPreferences
- (instancetype)init
{
self = [super init];
if (!self) {
return self;
}
OWSSingletonAssert();
return self;
}
#pragma mark - Helpers
- (void)clear {

View file

@ -39,6 +39,8 @@ typedef void (^pushTokensSuccessBlock)(NSString *pushToken, NSString *voipToken)
@interface PushManager : NSObject <PKPushRegistryDelegate>
- (instancetype)init NS_UNAVAILABLE;
+ (PushManager *)sharedManager;
/**

View file

@ -77,6 +77,8 @@
_callBackgroundTask = UIBackgroundTaskInvalid;
_currentNotifications = [NSMutableArray array];
OWSSingletonAssert();
return self;
}

View file

@ -103,6 +103,8 @@
-(instancetype)init {
if (self = [super init]) {
self.responseData = [NSMutableData data];
OWSSingletonAssert();
}
return self;
}