From 80e5f281c69feac1e3e0e83fed57b2db536264d4 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 14 Sep 2017 15:45:04 -0400 Subject: [PATCH] Rename app preferences class. // FREEBIE --- Signal.xcodeproj/project.pbxproj | 24 +- Signal/src/AppDelegate.m | 4 +- Signal/src/Models/AccountManager.swift | 4 +- Signal/src/Models/SyncPushTokensJob.swift | 8 +- Signal/src/Signal-Bridging-Header.h | 2 +- .../AdvancedSettingsTableViewController.m | 10 +- .../AppSettingsViewController.m | 1 - .../ConversationViewController.m | 1 - .../src/ViewControllers/HomeViewController.m | 1 - ...otificationSettingsOptionsViewController.m | 3 +- .../NotificationSettingsViewController.m | 4 +- .../PrivacySettingsTableViewController.m | 2 +- Signal/src/environment/Environment.h | 8 +- Signal/src/environment/Environment.m | 6 +- ...WS102MoveLoggingPreferenceToUserDefaults.m | 8 +- Signal/src/environment/NotificationsManager.h | 2 +- Signal/src/environment/NotificationsManager.m | 4 +- ...ertyListPreferences.h => OWSPreferences.h} | 6 +- Signal/src/environment/OWSPreferences.m | 306 +++++++++++++++++ .../src/environment/PropertyListPreferences.m | 309 ------------------ Signal/src/environment/VersionMigrations.m | 1 - Signal/src/network/PushManager.m | 1 - Signal/test/Models/AccountManagerTest.swift | 2 +- 23 files changed, 354 insertions(+), 363 deletions(-) rename Signal/src/environment/{PropertyListPreferences.h => OWSPreferences.h} (92%) create mode 100644 Signal/src/environment/OWSPreferences.m delete mode 100644 Signal/src/environment/PropertyListPreferences.m diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index ddb3ce4e9..071723d34 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -254,7 +254,7 @@ 76EB054018170B33006006FC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB03C318170B33006006FC /* AppDelegate.m */; }; 76EB057A18170B33006006FC /* OWSContactsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB040918170B33006006FC /* OWSContactsManager.m */; }; 76EB058218170B33006006FC /* Environment.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041318170B33006006FC /* Environment.m */; }; - 76EB058818170B33006006FC /* PropertyListPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041918170B33006006FC /* PropertyListPreferences.m */; }; + 76EB058818170B33006006FC /* OWSPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041918170B33006006FC /* OWSPreferences.m */; }; 76EB058A18170B33006006FC /* Release.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041B18170B33006006FC /* Release.m */; }; 76EB062618170B33006006FC /* Queue.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04D518170B33006006FC /* Queue.m */; }; 76EB063A18170B33006006FC /* FunctionalUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04EB18170B33006006FC /* FunctionalUtil.m */; }; @@ -316,7 +316,7 @@ B660F7181C29988E00687D6E /* CryptoTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 7038632418F70C0700D4A43F /* CryptoTools.m */; }; B660F71B1C29988E00687D6E /* Environment.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041318170B33006006FC /* Environment.m */; }; B660F71C1C29988E00687D6E /* DebugLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = B6C93C4D199567AD00EDF894 /* DebugLogger.m */; }; - B660F71F1C29988E00687D6E /* PropertyListPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041918170B33006006FC /* PropertyListPreferences.m */; }; + B660F71F1C29988E00687D6E /* OWSPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041918170B33006006FC /* OWSPreferences.m */; }; B660F7201C29988E00687D6E /* Release.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041B18170B33006006FC /* Release.m */; }; B660F7211C29988E00687D6E /* SignalKeyingStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B1013B196D213F007E3930 /* SignalKeyingStorage.m */; }; B660F7221C29988E00687D6E /* VersionMigrations.m in Sources */ = {isa = PBXBuildFile; fileRef = B60C16641988999D00E97A6C /* VersionMigrations.m */; }; @@ -722,8 +722,8 @@ 76EB040918170B33006006FC /* OWSContactsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSContactsManager.m; sourceTree = ""; }; 76EB041218170B33006006FC /* Environment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Environment.h; sourceTree = ""; }; 76EB041318170B33006006FC /* Environment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Environment.m; sourceTree = ""; }; - 76EB041818170B33006006FC /* PropertyListPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PropertyListPreferences.h; sourceTree = ""; }; - 76EB041918170B33006006FC /* PropertyListPreferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PropertyListPreferences.m; sourceTree = ""; }; + 76EB041818170B33006006FC /* OWSPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSPreferences.h; sourceTree = ""; }; + 76EB041918170B33006006FC /* OWSPreferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSPreferences.m; sourceTree = ""; }; 76EB041A18170B33006006FC /* Release.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Release.h; sourceTree = ""; }; 76EB041B18170B33006006FC /* Release.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Release.m; sourceTree = ""; }; 76EB04D418170B33006006FC /* Queue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Queue.h; sourceTree = ""; }; @@ -1390,16 +1390,16 @@ 76EB041118170B33006006FC /* environment */ = { isa = PBXGroup; children = ( + B6C93C4C199567AD00EDF894 /* DebugLogger.h */, + B6C93C4D199567AD00EDF894 /* DebugLogger.m */, + 76EB041218170B33006006FC /* Environment.h */, + 76EB041318170B33006006FC /* Environment.m */, 4505C2BD1E648E6E00CEBF41 /* ExperienceUpgrades */, 45666F731D9BFDB9008FE134 /* Migrations */, B6258B311C29E2E60014138E /* NotificationsManager.h */, B6258B321C29E2E60014138E /* NotificationsManager.m */, - 76EB041218170B33006006FC /* Environment.h */, - 76EB041318170B33006006FC /* Environment.m */, - B6C93C4C199567AD00EDF894 /* DebugLogger.h */, - B6C93C4D199567AD00EDF894 /* DebugLogger.m */, - 76EB041818170B33006006FC /* PropertyListPreferences.h */, - 76EB041918170B33006006FC /* PropertyListPreferences.m */, + 76EB041818170B33006006FC /* OWSPreferences.h */, + 76EB041918170B33006006FC /* OWSPreferences.m */, 76EB041A18170B33006006FC /* Release.h */, 76EB041B18170B33006006FC /* Release.m */, B6B1013A196D213F007E3930 /* SignalKeyingStorage.h */, @@ -2405,7 +2405,7 @@ 34B3F8941E8DF1710035BE1A /* HomeViewController.m in Sources */, 34E8BF381EE9E2FD00F5F4CA /* FingerprintViewScanController.m in Sources */, 346B66311F4E29B200E5122F /* CropScaleImageViewController.swift in Sources */, - 76EB058818170B33006006FC /* PropertyListPreferences.m in Sources */, + 76EB058818170B33006006FC /* OWSPreferences.m in Sources */, 34330A611E788EA900DF2FB9 /* AttachmentUploadView.m in Sources */, 45E5A6991F61E6DE001E4A8A /* MarqueeLabel.swift in Sources */, 34B3F87D1E8DF1700035BE1A /* FullImageViewController.m in Sources */, @@ -2435,7 +2435,7 @@ B660F7181C29988E00687D6E /* CryptoTools.m in Sources */, B660F71B1C29988E00687D6E /* Environment.m in Sources */, B660F71C1C29988E00687D6E /* DebugLogger.m in Sources */, - B660F71F1C29988E00687D6E /* PropertyListPreferences.m in Sources */, + B660F71F1C29988E00687D6E /* OWSPreferences.m in Sources */, 451DA3CA1F148A9F008E2423 /* DeviceSleepManager.swift in Sources */, B660F7201C29988E00687D6E /* Release.m in Sources */, 45BB93391E688E14001E3939 /* UIDevice+featureSupport.swift in Sources */, diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 247be1651..475f94f77 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -12,10 +12,10 @@ #import "OWSContactsManager.h" #import "OWSContactsSyncing.h" #import "OWSNavigationController.h" +#import "OWSPreferences.h" #import "OWSProfileManager.h" #import "OWSStaleNotificationObserver.h" #import "Pastelog.h" -#import "PropertyListPreferences.h" #import "PushManager.h" #import "RegistrationViewController.h" #import "Release.h" @@ -95,7 +95,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify"; loggingIsEnabled = TRUE; [DebugLogger.sharedLogger enableTTYLogging]; #elif RELEASE - loggingIsEnabled = PropertyListPreferences.loggingIsEnabled; + loggingIsEnabled = OWSPreferences.loggingIsEnabled; #endif if (loggingIsEnabled) { [DebugLogger.sharedLogger enableFileLogging]; diff --git a/Signal/src/Models/AccountManager.swift b/Signal/src/Models/AccountManager.swift index 5adccb88b..42bc66b70 100644 --- a/Signal/src/Models/AccountManager.swift +++ b/Signal/src/Models/AccountManager.swift @@ -13,14 +13,14 @@ class AccountManager: NSObject { let TAG = "[AccountManager]" let textSecureAccountManager: TSAccountManager let networkManager: TSNetworkManager - let preferences: PropertyListPreferences + let preferences: OWSPreferences var pushManager: PushManager { // dependency injection hack since PushManager has *alot* of dependencies, and would induce a cycle. return PushManager.shared() } - required init(textSecureAccountManager: TSAccountManager, preferences: PropertyListPreferences) { + required init(textSecureAccountManager: TSAccountManager, preferences: OWSPreferences) { self.networkManager = textSecureAccountManager.networkManager self.textSecureAccountManager = textSecureAccountManager self.preferences = preferences diff --git a/Signal/src/Models/SyncPushTokensJob.swift b/Signal/src/Models/SyncPushTokensJob.swift index 60a8816eb..dbba29646 100644 --- a/Signal/src/Models/SyncPushTokensJob.swift +++ b/Signal/src/Models/SyncPushTokensJob.swift @@ -10,16 +10,16 @@ class SyncPushTokensJob: NSObject { let TAG = "[SyncPushTokensJob]" let pushManager: PushManager let accountManager: AccountManager - let preferences: PropertyListPreferences + let preferences: OWSPreferences var uploadOnlyIfStale = true - required init(pushManager: PushManager, accountManager: AccountManager, preferences: PropertyListPreferences) { + required init(pushManager: PushManager, accountManager: AccountManager, preferences: OWSPreferences) { self.pushManager = pushManager self.accountManager = accountManager self.preferences = preferences } - class func run(pushManager: PushManager, accountManager: AccountManager, preferences: PropertyListPreferences) -> Promise { + class func run(pushManager: PushManager, accountManager: AccountManager, preferences: OWSPreferences) -> Promise { let job = self.init(pushManager: pushManager, accountManager: accountManager, preferences: preferences) return job.run() } @@ -73,7 +73,7 @@ class SyncPushTokensJob: NSObject { // MARK - objc wrappers, since objc can't use swift parameterized types - @objc class func run(pushManager: PushManager, accountManager: AccountManager, preferences: PropertyListPreferences) -> AnyPromise { + @objc class func run(pushManager: PushManager, accountManager: AccountManager, preferences: OWSPreferences) -> AnyPromise { let promise: Promise = self.run(pushManager: pushManager, accountManager: accountManager, preferences: preferences) return AnyPromise(promise) } diff --git a/Signal/src/Signal-Bridging-Header.h b/Signal/src/Signal-Bridging-Header.h index 7b2e1228c..021dc8858 100644 --- a/Signal/src/Signal-Bridging-Header.h +++ b/Signal/src/Signal-Bridging-Header.h @@ -22,13 +22,13 @@ #import "OWSLogger.h" #import "OWSMessageEditing.h" #import "OWSNavigationController.h" +#import "OWSPreferences.h" #import "OWSProfileManager.h" #import "OWSProgressView.h" #import "OWSViewController.h" #import "OWSWebRTCDataProtos.pb.h" #import "PrivacySettingsTableViewController.h" #import "ProfileViewController.h" -#import "PropertyListPreferences.h" #import "PushManager.h" #import "Release.h" #import "TSMessageAdapter.h" diff --git a/Signal/src/ViewControllers/AdvancedSettingsTableViewController.m b/Signal/src/ViewControllers/AdvancedSettingsTableViewController.m index c5c9d9dcb..1975d6d40 100644 --- a/Signal/src/ViewControllers/AdvancedSettingsTableViewController.m +++ b/Signal/src/ViewControllers/AdvancedSettingsTableViewController.m @@ -7,8 +7,8 @@ #import "DomainFrontingCountryViewController.h" #import "Environment.h" #import "OWSCountryMetadata.h" +#import "OWSPreferences.h" #import "Pastelog.h" -#import "PropertyListPreferences.h" #import "PushManager.h" #import "Signal-Swift.h" #import "TSAccountManager.h" @@ -90,12 +90,12 @@ NS_ASSUME_NONNULL_BEGIN OWSTableSection *loggingSection = [OWSTableSection new]; loggingSection.headerTitle = NSLocalizedString(@"LOGGING_SECTION", nil); [loggingSection addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_DEBUGLOG", @"") - isOn:[PropertyListPreferences loggingIsEnabled] + isOn:[OWSPreferences loggingIsEnabled] target:weakSelf selector:@selector(didToggleEnableLogSwitch:)]]; - if ([PropertyListPreferences loggingIsEnabled]) { + if ([OWSPreferences loggingIsEnabled]) { [loggingSection addItem:[OWSTableItem actionItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_SUBMIT_DEBUGLOG", @"") actionBlock:^{ @@ -263,8 +263,8 @@ NS_ASSUME_NONNULL_BEGIN } else { [[DebugLogger sharedLogger] enableFileLogging]; } - - [PropertyListPreferences setLoggingEnabled:sender.isOn]; + + [OWSPreferences setLoggingEnabled:sender.isOn]; [self updateTableContents]; } diff --git a/Signal/src/ViewControllers/AppSettingsViewController.m b/Signal/src/ViewControllers/AppSettingsViewController.m index b6024d8dd..9bce001ca 100644 --- a/Signal/src/ViewControllers/AppSettingsViewController.m +++ b/Signal/src/ViewControllers/AppSettingsViewController.m @@ -13,7 +13,6 @@ #import "OWSNavigationController.h" #import "PrivacySettingsTableViewController.h" #import "ProfileViewController.h" -#import "PropertyListPreferences.h" #import "PushManager.h" #import "Signal-Swift.h" #import "UIUtil.h" diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 97d7ef9ed..92abc6a46 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -32,7 +32,6 @@ #import "OWSOutgoingMessageCollectionViewCell.h" #import "OWSSystemMessageCell.h" #import "OWSUnreadIndicatorCell.h" -#import "PropertyListPreferences.h" #import "Signal-Swift.h" #import "SignalKeyingStorage.h" #import "TSAttachmentPointer.h" diff --git a/Signal/src/ViewControllers/HomeViewController.m b/Signal/src/ViewControllers/HomeViewController.m index 7555d1d0b..11752ea08 100644 --- a/Signal/src/ViewControllers/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeViewController.m @@ -13,7 +13,6 @@ #import "OWSNavigationController.h" #import "OWSProfileManager.h" #import "ProfileViewController.h" -#import "PropertyListPreferences.h" #import "PushManager.h" #import "Signal-Swift.h" #import "TSAccountManager.h" diff --git a/Signal/src/ViewControllers/NotificationSettingsOptionsViewController.m b/Signal/src/ViewControllers/NotificationSettingsOptionsViewController.m index 1af83d625..0e13bc786 100644 --- a/Signal/src/ViewControllers/NotificationSettingsOptionsViewController.m +++ b/Signal/src/ViewControllers/NotificationSettingsOptionsViewController.m @@ -4,7 +4,6 @@ #import "NotificationSettingsOptionsViewController.h" #import "Environment.h" -#import "PropertyListPreferences.h" @implementation NotificationSettingsOptionsViewController @@ -23,7 +22,7 @@ OWSTableSection *section = [OWSTableSection new]; section.footerTitle = NSLocalizedString(@"NOTIFICATIONS_FOOTER_WARNING", nil); - PropertyListPreferences *prefs = [Environment preferences]; + OWSPreferences *prefs = [Environment preferences]; NotificationType selectedNotifType = [prefs notificationPreviewType]; for (NSNumber *option in @[ @(NotificationNamePreview), @(NotificationNameNoPreview), @(NotificationNoNameNoPreview) ]) { diff --git a/Signal/src/ViewControllers/NotificationSettingsViewController.m b/Signal/src/ViewControllers/NotificationSettingsViewController.m index 008689e6c..a00e3e894 100644 --- a/Signal/src/ViewControllers/NotificationSettingsViewController.m +++ b/Signal/src/ViewControllers/NotificationSettingsViewController.m @@ -5,7 +5,7 @@ #import "NotificationSettingsViewController.h" #import "Environment.h" #import "NotificationSettingsOptionsViewController.h" -#import "PropertyListPreferences.h" +#import "OWSPreferences.h" @implementation NotificationSettingsViewController @@ -29,7 +29,7 @@ __weak NotificationSettingsViewController *weakSelf = self; - PropertyListPreferences *prefs = [Environment preferences]; + OWSPreferences *prefs = [Environment preferences]; OWSTableSection *backgroundSection = [OWSTableSection new]; backgroundSection.headerTitle = NSLocalizedString(@"NOTIFICATIONS_SECTION_BACKGROUND", nil); diff --git a/Signal/src/ViewControllers/PrivacySettingsTableViewController.m b/Signal/src/ViewControllers/PrivacySettingsTableViewController.m index 2186ada46..67c60d67d 100644 --- a/Signal/src/ViewControllers/PrivacySettingsTableViewController.m +++ b/Signal/src/ViewControllers/PrivacySettingsTableViewController.m @@ -3,9 +3,9 @@ // #import "PrivacySettingsTableViewController.h" +#import "OWSPreferences.h" #import "BlockListViewController.h" #import "Environment.h" -#import "PropertyListPreferences.h" #import "Signal-Swift.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Signal/src/environment/Environment.h b/Signal/src/environment/Environment.h index edb0006c1..f36cf24fc 100644 --- a/Signal/src/environment/Environment.h +++ b/Signal/src/environment/Environment.h @@ -2,10 +2,10 @@ // Copyright (c) 2017 Open Whisper Systems. All rights reserved. // -#import -#import "PropertyListPreferences.h" +#import "OWSPreferences.h" #import "TSGroupModel.h" #import "TSStorageHeaders.h" +#import /** * @@ -46,7 +46,7 @@ @property (nonatomic, readonly) TSNetworkManager *networkManager; @property (nonatomic, readonly) NotificationsManager *notificationsManager; @property (nonatomic, readonly) OWSMessageSender *messageSender; -@property (nonatomic, readonly) PropertyListPreferences *preferences; +@property (nonatomic, readonly) OWSPreferences *preferences; @property (nonatomic, readonly) HomeViewController *homeViewController; @@ -55,7 +55,7 @@ + (Environment *)getCurrent; + (void)setCurrent:(Environment *)curEnvironment; -+ (PropertyListPreferences *)preferences; ++ (OWSPreferences *)preferences; + (void)resetAppData; diff --git a/Signal/src/environment/Environment.m b/Signal/src/environment/Environment.m index 164352e21..41c4f71c7 100644 --- a/Signal/src/environment/Environment.m +++ b/Signal/src/environment/Environment.m @@ -154,18 +154,18 @@ static Environment *environment = nil; return _notificationsManager; } -+ (PropertyListPreferences *)preferences ++ (OWSPreferences *)preferences { OWSAssert([Environment getCurrent] != nil); OWSAssert([Environment getCurrent].preferences != nil); return [Environment getCurrent].preferences; } -- (PropertyListPreferences *)preferences +- (OWSPreferences *)preferences { @synchronized (self) { if (!_preferences) { - _preferences = [PropertyListPreferences new]; + _preferences = [OWSPreferences new]; } } diff --git a/Signal/src/environment/Migrations/OWS102MoveLoggingPreferenceToUserDefaults.m b/Signal/src/environment/Migrations/OWS102MoveLoggingPreferenceToUserDefaults.m index d80c2e70a..dd9a907bc 100644 --- a/Signal/src/environment/Migrations/OWS102MoveLoggingPreferenceToUserDefaults.m +++ b/Signal/src/environment/Migrations/OWS102MoveLoggingPreferenceToUserDefaults.m @@ -5,7 +5,7 @@ #import "OWS102MoveLoggingPreferenceToUserDefaults.h" #import "DebugLogger.h" #import "Environment.h" -#import "PropertyListPreferences.h" +#import "OWSPreferences.h" // Increment a similar constant for every future DBMigration static NSString *const OWS102MoveLoggingPreferenceToUserDefaultsMigrationId = @"102"; @@ -22,12 +22,12 @@ static NSString *const OWS102MoveLoggingPreferenceToUserDefaultsMigrationId = @" DDLogWarn(@"[OWS102MoveLoggingPreferenceToUserDefaultsMigrationId] copying existing logging preference to " @"NSUserDefaults"); - NSNumber *existingValue = [transaction objectForKey:PropertyListPreferencesKeyEnableDebugLog - inCollection:PropertyListPreferencesSignalDatabaseCollection]; + NSNumber *existingValue = + [transaction objectForKey:OWSPreferencesKeyEnableDebugLog inCollection:OWSPreferencesSignalDatabaseCollection]; if (existingValue) { DDLogInfo(@"%@ assigning existing value: %@", self.tag, existingValue); - [PropertyListPreferences setLoggingEnabled:[existingValue boolValue]]; + [OWSPreferences setLoggingEnabled:[existingValue boolValue]]; if (![existingValue boolValue]) { DDLogInfo(@"%@ Disabling file logger after one-time log settings migration.", self.tag); diff --git a/Signal/src/environment/NotificationsManager.h b/Signal/src/environment/NotificationsManager.h index 4c1c324ef..b017f51b6 100644 --- a/Signal/src/environment/NotificationsManager.h +++ b/Signal/src/environment/NotificationsManager.h @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN @class TSContactThread; @class OWSContactsManager; @class SignalCall; -@class PropertyListPreferences; +@class OWSPreferences; @interface NotificationsManager : NSObject diff --git a/Signal/src/environment/NotificationsManager.m b/Signal/src/environment/NotificationsManager.m index 228de0ca3..87f6f6fa1 100644 --- a/Signal/src/environment/NotificationsManager.m +++ b/Signal/src/environment/NotificationsManager.m @@ -5,7 +5,7 @@ #import "NotificationsManager.h" #import "Environment.h" #import "OWSContactsManager.h" -#import "PropertyListPreferences.h" +#import "OWSPreferences.h" #import "PushManager.h" #import "Signal-Swift.h" #import @@ -373,7 +373,7 @@ NSString *const kNotificationsManagerNewMesssageSoundName = @"NewMessage.aifc"; - (NotificationType)notificationPreviewType { - PropertyListPreferences *prefs = [Environment getCurrent].preferences; + OWSPreferences *prefs = [Environment getCurrent].preferences; return prefs.notificationPreviewType; } diff --git a/Signal/src/environment/PropertyListPreferences.h b/Signal/src/environment/OWSPreferences.h similarity index 92% rename from Signal/src/environment/PropertyListPreferences.h rename to Signal/src/environment/OWSPreferences.h index eab323079..1493bd1cd 100644 --- a/Signal/src/environment/PropertyListPreferences.h +++ b/Signal/src/environment/OWSPreferences.h @@ -14,10 +14,10 @@ typedef NS_ENUM(NSUInteger, NotificationType) { }; // Used when migrating logging to NSUserDefaults. -extern NSString *const PropertyListPreferencesSignalDatabaseCollection; -extern NSString *const PropertyListPreferencesKeyEnableDebugLog; +extern NSString *const OWSPreferencesSignalDatabaseCollection; +extern NSString *const OWSPreferencesKeyEnableDebugLog; -@interface PropertyListPreferences : NSObject +@interface OWSPreferences : NSObject #pragma mark - Helpers diff --git a/Signal/src/environment/OWSPreferences.m b/Signal/src/environment/OWSPreferences.m new file mode 100644 index 000000000..c1f0f5bbe --- /dev/null +++ b/Signal/src/environment/OWSPreferences.m @@ -0,0 +1,306 @@ +// +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// + +#import "OWSPreferences.h" +#import "TSStorageHeaders.h" + +NS_ASSUME_NONNULL_BEGIN + +double const OWSPreferencesDefaultCallStreamDESBufferLevel = 0.5; +NSString *const OWSPreferencesSignalDatabaseCollection = @"SignalPreferences"; + +NSString *const OWSPreferencesKeyCallStreamDESBufferLevel = @"CallStreamDesiredBufferLevel"; +NSString *const OWSPreferencesKeyScreenSecurity = @"Screen Security Key"; +NSString *const OWSPreferencesKeyEnableDebugLog = @"Debugging Log Enabled Key"; +NSString *const OWSPreferencesKeyNotificationPreviewType = @"Notification Preview Type Key"; +NSString *const OWSPreferencesKeyHasSentAMessage = @"User has sent a message"; +NSString *const OWSPreferencesKeyHasArchivedAMessage = @"User archived a message"; +NSString *const OWSPreferencesKeyPlaySoundInForeground = @"NotificationSoundInForeground"; +NSString *const OWSPreferencesKeyHasRegisteredVoipPush = @"VOIPPushEnabled"; +NSString *const OWSPreferencesKeyLastRecordedPushToken = @"LastRecordedPushToken"; +NSString *const OWSPreferencesKeyLastRecordedVoipToken = @"LastRecordedVoipToken"; +NSString *const OWSPreferencesKeyCallKitEnabled = @"CallKitEnabled"; +NSString *const OWSPreferencesKeyCallKitPrivacyEnabled = @"CallKitPrivacyEnabled"; +NSString *const OWSPreferencesKeyCallsHideIPAddress = @"CallsHideIPAddress"; +NSString *const OWSPreferencesKeyHasDeclinedNoContactsView = @"hasDeclinedNoContactsView"; +NSString *const OWSPreferencesKeyIOSUpgradeNagVersion = @"iOSUpgradeNagVersion"; + +@implementation OWSPreferences + +- (instancetype)init +{ + self = [super init]; + if (!self) { + return self; + } + + OWSSingletonAssert(); + + return self; +} + +#pragma mark - Helpers + +- (void)clear { + @synchronized(self) { + NSString *appDomain = NSBundle.mainBundle.bundleIdentifier; + [NSUserDefaults.standardUserDefaults removePersistentDomainForName:appDomain]; + } +} + +- (nullable id)tryGetValueForKey:(NSString *)key +{ + ows_require(key != nil); + return [TSStorageManager.sharedManager objectForKey:key inCollection:OWSPreferencesSignalDatabaseCollection]; +} + +- (void)setValueForKey:(NSString *)key toValue:(nullable id)value +{ + ows_require(key != nil); + + [TSStorageManager.sharedManager setObject:value forKey:key inCollection:OWSPreferencesSignalDatabaseCollection]; +} + +#pragma mark - Specific Preferences + +- (NSTimeInterval)getCachedOrDefaultDesiredBufferDepth +{ + id v = [self tryGetValueForKey:OWSPreferencesKeyCallStreamDESBufferLevel]; + if (v == nil) + return OWSPreferencesDefaultCallStreamDESBufferLevel; + return [v doubleValue]; +} + +- (void)setCachedDesiredBufferDepth:(double)value +{ + ows_require(value >= 0); + [self setValueForKey:OWSPreferencesKeyCallStreamDESBufferLevel toValue:@(value)]; +} + +- (BOOL)screenSecurityIsEnabled +{ + NSNumber *preference = [self tryGetValueForKey:OWSPreferencesKeyScreenSecurity]; + return preference ? [preference boolValue] : YES; +} + +- (BOOL)getHasSentAMessage +{ + NSNumber *preference = [self tryGetValueForKey:OWSPreferencesKeyHasSentAMessage]; + if (preference) { + return [preference boolValue]; + } else { + return NO; + } +} + +- (BOOL)getHasArchivedAMessage +{ + NSNumber *preference = [self tryGetValueForKey:OWSPreferencesKeyHasArchivedAMessage]; + if (preference) { + return [preference boolValue]; + } else { + return NO; + } +} + +- (BOOL)hasRegisteredVOIPPush +{ + NSNumber *preference = [self tryGetValueForKey:OWSPreferencesKeyHasRegisteredVoipPush]; + if (preference) { + return [preference boolValue]; + } else { + return YES; + } +} + +- (void)setScreenSecurity:(BOOL)flag +{ + [self setValueForKey:OWSPreferencesKeyScreenSecurity toValue:@(flag)]; +} + + +- (void)setHasRegisteredVOIPPush:(BOOL)enabled +{ + [self setValueForKey:OWSPreferencesKeyHasRegisteredVoipPush toValue:@(enabled)]; +} + ++ (BOOL)loggingIsEnabled +{ + NSNumber *preference = [NSUserDefaults.standardUserDefaults objectForKey:OWSPreferencesKeyEnableDebugLog]; + + if (preference) { + return [preference boolValue]; + } else { + return YES; + } +} + ++ (void)setLoggingEnabled:(BOOL)flag +{ + // Logging preferences are stored in UserDefaults instead of the database, so that we can (optionally) start + // logging before the database is initialized. This is important because sometimes there are problems *with* the + // database initialization, and without logging it would be hard to track down. + [NSUserDefaults.standardUserDefaults setObject:@(flag) forKey:OWSPreferencesKeyEnableDebugLog]; + [NSUserDefaults.standardUserDefaults synchronize]; +} + +- (void)setHasSentAMessage:(BOOL)enabled +{ + [self setValueForKey:OWSPreferencesKeyHasSentAMessage toValue:@(enabled)]; +} + +- (void)setHasArchivedAMessage:(BOOL)enabled +{ + [self setValueForKey:OWSPreferencesKeyHasArchivedAMessage toValue:@(enabled)]; +} + + +- (BOOL)hasDeclinedNoContactsView +{ + NSNumber *preference = [self tryGetValueForKey:OWSPreferencesKeyHasDeclinedNoContactsView]; + // Default to NO. + return preference ? [preference boolValue] : NO; +} + +- (void)setHasDeclinedNoContactsView:(BOOL)value +{ + [self setValueForKey:OWSPreferencesKeyHasDeclinedNoContactsView toValue:@(value)]; +} + +- (void)setIOSUpgradeNagVersion:(NSString *)value +{ + [self setValueForKey:OWSPreferencesKeyIOSUpgradeNagVersion toValue:value]; +} + +- (nullable NSString *)iOSUpgradeNagVersion +{ + return [self tryGetValueForKey:OWSPreferencesKeyIOSUpgradeNagVersion]; +} + +#pragma mark - Calling + +#pragma mark CallKit + +- (BOOL)isCallKitEnabled +{ + NSNumber *preference = [self tryGetValueForKey:OWSPreferencesKeyCallKitEnabled]; + return preference ? [preference boolValue] : YES; +} + +- (void)setIsCallKitEnabled:(BOOL)flag +{ + [self setValueForKey:OWSPreferencesKeyCallKitEnabled toValue:@(flag)]; +} + +- (BOOL)isCallKitEnabledSet +{ + NSNumber *preference = [self tryGetValueForKey:OWSPreferencesKeyCallKitEnabled]; + return preference != nil; +} + +- (BOOL)isCallKitPrivacyEnabled +{ + NSNumber *preference = [self tryGetValueForKey:OWSPreferencesKeyCallKitPrivacyEnabled]; + return preference ? [preference boolValue] : YES; +} + +- (void)setIsCallKitPrivacyEnabled:(BOOL)flag +{ + [self setValueForKey:OWSPreferencesKeyCallKitPrivacyEnabled toValue:@(flag)]; +} + +- (BOOL)isCallKitPrivacySet +{ + NSNumber *preference = [self tryGetValueForKey:OWSPreferencesKeyCallKitPrivacyEnabled]; + return preference != nil; +} + +#pragma mark direct call connectivity (non-TURN) + +// Allow callers to connect directly, when desirable, vs. enforcing TURN only proxy connectivity + +- (BOOL)doCallsHideIPAddress +{ + NSNumber *preference = [self tryGetValueForKey:OWSPreferencesKeyCallsHideIPAddress]; + return preference ? [preference boolValue] : NO; +} + +- (void)setDoCallsHideIPAddress:(BOOL)flag +{ + [self setValueForKey:OWSPreferencesKeyCallsHideIPAddress toValue:@(flag)]; +} + +#pragma mark Notification Preferences + +- (BOOL)soundInForeground +{ + NSNumber *preference = [self tryGetValueForKey:OWSPreferencesKeyPlaySoundInForeground]; + if (preference) { + return [preference boolValue]; + } else { + return YES; + } +} + +- (void)setSoundInForeground:(BOOL)enabled +{ + [self setValueForKey:OWSPreferencesKeyPlaySoundInForeground toValue:@(enabled)]; +} + +- (void)setNotificationPreviewType:(NotificationType)type +{ + [self setValueForKey:OWSPreferencesKeyNotificationPreviewType toValue:@(type)]; +} + +- (NotificationType)notificationPreviewType +{ + NSNumber *preference = [self tryGetValueForKey:OWSPreferencesKeyNotificationPreviewType]; + + if (preference) { + return [preference unsignedIntegerValue]; + } else { + return NotificationNamePreview; + } +} + +- (NSString *)nameForNotificationPreviewType:(NotificationType)notificationType +{ + switch (notificationType) { + case NotificationNamePreview: + return NSLocalizedString(@"NOTIFICATIONS_SENDER_AND_MESSAGE", nil); + case NotificationNameNoPreview: + return NSLocalizedString(@"NOTIFICATIONS_SENDER_ONLY", nil); + case NotificationNoNameNoPreview: + return NSLocalizedString(@"NOTIFICATIONS_NONE", nil); + default: + DDLogWarn(@"Undefined NotificationType in Settings"); + return @""; + } +} + +#pragma mark - Push Tokens + +- (void)setPushToken:(NSString *)value +{ + [self setValueForKey:OWSPreferencesKeyLastRecordedPushToken toValue:value]; +} + +- (nullable NSString *)getPushToken +{ + return [self tryGetValueForKey:OWSPreferencesKeyLastRecordedPushToken]; +} + +- (void)setVoipToken:(NSString *)value +{ + [self setValueForKey:OWSPreferencesKeyLastRecordedVoipToken toValue:value]; +} + +- (nullable NSString *)getVoipToken +{ + return [self tryGetValueForKey:OWSPreferencesKeyLastRecordedVoipToken]; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/Signal/src/environment/PropertyListPreferences.m b/Signal/src/environment/PropertyListPreferences.m deleted file mode 100644 index fe99284b6..000000000 --- a/Signal/src/environment/PropertyListPreferences.m +++ /dev/null @@ -1,309 +0,0 @@ -// -// Copyright (c) 2017 Open Whisper Systems. All rights reserved. -// - -#import "PropertyListPreferences.h" -#import "TSStorageHeaders.h" - -NS_ASSUME_NONNULL_BEGIN - -double const PropertyListPreferencesDefaultCallStreamDESBufferLevel = 0.5; -NSString *const PropertyListPreferencesSignalDatabaseCollection = @"SignalPreferences"; - -NSString *const PropertyListPreferencesKeyCallStreamDESBufferLevel = @"CallStreamDesiredBufferLevel"; -NSString *const PropertyListPreferencesKeyScreenSecurity = @"Screen Security Key"; -NSString *const PropertyListPreferencesKeyEnableDebugLog = @"Debugging Log Enabled Key"; -NSString *const PropertyListPreferencesKeyNotificationPreviewType = @"Notification Preview Type Key"; -NSString *const PropertyListPreferencesKeyHasSentAMessage = @"User has sent a message"; -NSString *const PropertyListPreferencesKeyHasArchivedAMessage = @"User archived a message"; -NSString *const PropertyListPreferencesKeyPlaySoundInForeground = @"NotificationSoundInForeground"; -NSString *const PropertyListPreferencesKeyHasRegisteredVoipPush = @"VOIPPushEnabled"; -NSString *const PropertyListPreferencesKeyLastRecordedPushToken = @"LastRecordedPushToken"; -NSString *const PropertyListPreferencesKeyLastRecordedVoipToken = @"LastRecordedVoipToken"; -NSString *const PropertyListPreferencesKeyCallKitEnabled = @"CallKitEnabled"; -NSString *const PropertyListPreferencesKeyCallKitPrivacyEnabled = @"CallKitPrivacyEnabled"; -NSString *const PropertyListPreferencesKeyCallsHideIPAddress = @"CallsHideIPAddress"; -NSString *const PropertyListPreferencesKeyHasDeclinedNoContactsView = @"hasDeclinedNoContactsView"; -NSString *const PropertyListPreferencesKeyIOSUpgradeNagVersion = @"iOSUpgradeNagVersion"; - -@implementation PropertyListPreferences - -- (instancetype)init -{ - self = [super init]; - if (!self) { - return self; - } - - OWSSingletonAssert(); - - return self; -} - -#pragma mark - Helpers - -- (void)clear { - @synchronized(self) { - NSString *appDomain = NSBundle.mainBundle.bundleIdentifier; - [NSUserDefaults.standardUserDefaults removePersistentDomainForName:appDomain]; - } -} - -- (nullable id)tryGetValueForKey:(NSString *)key -{ - ows_require(key != nil); - return - [TSStorageManager.sharedManager objectForKey:key inCollection:PropertyListPreferencesSignalDatabaseCollection]; -} - -- (void)setValueForKey:(NSString *)key toValue:(nullable id)value -{ - ows_require(key != nil); - - [TSStorageManager.sharedManager setObject:value - forKey:key - inCollection:PropertyListPreferencesSignalDatabaseCollection]; -} - -#pragma mark - Specific Preferences - -- (NSTimeInterval)getCachedOrDefaultDesiredBufferDepth -{ - id v = [self tryGetValueForKey:PropertyListPreferencesKeyCallStreamDESBufferLevel]; - if (v == nil) - return PropertyListPreferencesDefaultCallStreamDESBufferLevel; - return [v doubleValue]; -} - -- (void)setCachedDesiredBufferDepth:(double)value -{ - ows_require(value >= 0); - [self setValueForKey:PropertyListPreferencesKeyCallStreamDESBufferLevel toValue:@(value)]; -} - -- (BOOL)screenSecurityIsEnabled -{ - NSNumber *preference = [self tryGetValueForKey:PropertyListPreferencesKeyScreenSecurity]; - return preference ? [preference boolValue] : YES; -} - -- (BOOL)getHasSentAMessage -{ - NSNumber *preference = [self tryGetValueForKey:PropertyListPreferencesKeyHasSentAMessage]; - if (preference) { - return [preference boolValue]; - } else { - return NO; - } -} - -- (BOOL)getHasArchivedAMessage -{ - NSNumber *preference = [self tryGetValueForKey:PropertyListPreferencesKeyHasArchivedAMessage]; - if (preference) { - return [preference boolValue]; - } else { - return NO; - } -} - -- (BOOL)hasRegisteredVOIPPush -{ - NSNumber *preference = [self tryGetValueForKey:PropertyListPreferencesKeyHasRegisteredVoipPush]; - if (preference) { - return [preference boolValue]; - } else { - return YES; - } -} - -- (void)setScreenSecurity:(BOOL)flag -{ - [self setValueForKey:PropertyListPreferencesKeyScreenSecurity toValue:@(flag)]; -} - - -- (void)setHasRegisteredVOIPPush:(BOOL)enabled -{ - [self setValueForKey:PropertyListPreferencesKeyHasRegisteredVoipPush toValue:@(enabled)]; -} - -+ (BOOL)loggingIsEnabled -{ - NSNumber *preference = [NSUserDefaults.standardUserDefaults objectForKey:PropertyListPreferencesKeyEnableDebugLog]; - - if (preference) { - return [preference boolValue]; - } else { - return YES; - } -} - -+ (void)setLoggingEnabled:(BOOL)flag -{ - // Logging preferences are stored in UserDefaults instead of the database, so that we can (optionally) start - // logging before the database is initialized. This is important because sometimes there are problems *with* the - // database initialization, and without logging it would be hard to track down. - [NSUserDefaults.standardUserDefaults setObject:@(flag) forKey:PropertyListPreferencesKeyEnableDebugLog]; - [NSUserDefaults.standardUserDefaults synchronize]; -} - -- (void)setHasSentAMessage:(BOOL)enabled -{ - [self setValueForKey:PropertyListPreferencesKeyHasSentAMessage toValue:@(enabled)]; -} - -- (void)setHasArchivedAMessage:(BOOL)enabled -{ - [self setValueForKey:PropertyListPreferencesKeyHasArchivedAMessage toValue:@(enabled)]; -} - - -- (BOOL)hasDeclinedNoContactsView -{ - NSNumber *preference = [self tryGetValueForKey:PropertyListPreferencesKeyHasDeclinedNoContactsView]; - // Default to NO. - return preference ? [preference boolValue] : NO; -} - -- (void)setHasDeclinedNoContactsView:(BOOL)value -{ - [self setValueForKey:PropertyListPreferencesKeyHasDeclinedNoContactsView toValue:@(value)]; -} - -- (void)setIOSUpgradeNagVersion:(NSString *)value -{ - [self setValueForKey:PropertyListPreferencesKeyIOSUpgradeNagVersion toValue:value]; -} - -- (nullable NSString *)iOSUpgradeNagVersion -{ - return [self tryGetValueForKey:PropertyListPreferencesKeyIOSUpgradeNagVersion]; -} - -#pragma mark - Calling - -#pragma mark CallKit - -- (BOOL)isCallKitEnabled -{ - NSNumber *preference = [self tryGetValueForKey:PropertyListPreferencesKeyCallKitEnabled]; - return preference ? [preference boolValue] : YES; -} - -- (void)setIsCallKitEnabled:(BOOL)flag -{ - [self setValueForKey:PropertyListPreferencesKeyCallKitEnabled toValue:@(flag)]; -} - -- (BOOL)isCallKitEnabledSet -{ - NSNumber *preference = [self tryGetValueForKey:PropertyListPreferencesKeyCallKitEnabled]; - return preference != nil; -} - -- (BOOL)isCallKitPrivacyEnabled -{ - NSNumber *preference = [self tryGetValueForKey:PropertyListPreferencesKeyCallKitPrivacyEnabled]; - return preference ? [preference boolValue] : YES; -} - -- (void)setIsCallKitPrivacyEnabled:(BOOL)flag -{ - [self setValueForKey:PropertyListPreferencesKeyCallKitPrivacyEnabled toValue:@(flag)]; -} - -- (BOOL)isCallKitPrivacySet -{ - NSNumber *preference = [self tryGetValueForKey:PropertyListPreferencesKeyCallKitPrivacyEnabled]; - return preference != nil; -} - -#pragma mark direct call connectivity (non-TURN) - -// Allow callers to connect directly, when desirable, vs. enforcing TURN only proxy connectivity - -- (BOOL)doCallsHideIPAddress -{ - NSNumber *preference = [self tryGetValueForKey:PropertyListPreferencesKeyCallsHideIPAddress]; - return preference ? [preference boolValue] : NO; -} - -- (void)setDoCallsHideIPAddress:(BOOL)flag -{ - [self setValueForKey:PropertyListPreferencesKeyCallsHideIPAddress toValue:@(flag)]; -} - -#pragma mark Notification Preferences - -- (BOOL)soundInForeground -{ - NSNumber *preference = [self tryGetValueForKey:PropertyListPreferencesKeyPlaySoundInForeground]; - if (preference) { - return [preference boolValue]; - } else { - return YES; - } -} - -- (void)setSoundInForeground:(BOOL)enabled -{ - [self setValueForKey:PropertyListPreferencesKeyPlaySoundInForeground toValue:@(enabled)]; -} - -- (void)setNotificationPreviewType:(NotificationType)type -{ - [self setValueForKey:PropertyListPreferencesKeyNotificationPreviewType toValue:@(type)]; -} - -- (NotificationType)notificationPreviewType -{ - NSNumber *preference = [self tryGetValueForKey:PropertyListPreferencesKeyNotificationPreviewType]; - - if (preference) { - return [preference unsignedIntegerValue]; - } else { - return NotificationNamePreview; - } -} - -- (NSString *)nameForNotificationPreviewType:(NotificationType)notificationType -{ - switch (notificationType) { - case NotificationNamePreview: - return NSLocalizedString(@"NOTIFICATIONS_SENDER_AND_MESSAGE", nil); - case NotificationNameNoPreview: - return NSLocalizedString(@"NOTIFICATIONS_SENDER_ONLY", nil); - case NotificationNoNameNoPreview: - return NSLocalizedString(@"NOTIFICATIONS_NONE", nil); - default: - DDLogWarn(@"Undefined NotificationType in Settings"); - return @""; - } -} - -#pragma mark - Push Tokens - -- (void)setPushToken:(NSString *)value -{ - [self setValueForKey:PropertyListPreferencesKeyLastRecordedPushToken toValue:value]; -} - -- (nullable NSString *)getPushToken -{ - return [self tryGetValueForKey:PropertyListPreferencesKeyLastRecordedPushToken]; -} - -- (void)setVoipToken:(NSString *)value -{ - [self setValueForKey:PropertyListPreferencesKeyLastRecordedVoipToken toValue:value]; -} - -- (nullable NSString *)getVoipToken -{ - return [self tryGetValueForKey:PropertyListPreferencesKeyLastRecordedVoipToken]; -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/Signal/src/environment/VersionMigrations.m b/Signal/src/environment/VersionMigrations.m index 0265f84cc..1122688a9 100644 --- a/Signal/src/environment/VersionMigrations.m +++ b/Signal/src/environment/VersionMigrations.m @@ -7,7 +7,6 @@ #import "Environment.h" #import "LockInteractionController.h" #import "OWSDatabaseMigrationRunner.h" -#import "PropertyListPreferences.h" #import "PushManager.h" #import "SignalKeyingStorage.h" #import "TSAccountManager.h" diff --git a/Signal/src/network/PushManager.m b/Signal/src/network/PushManager.m index 81aba5d09..12680c3a2 100644 --- a/Signal/src/network/PushManager.m +++ b/Signal/src/network/PushManager.m @@ -6,7 +6,6 @@ #import "AppDelegate.h" #import "NSData+ows_StripToken.h" #import "OWSContactsManager.h" -#import "PropertyListPreferences.h" #import "Signal-Swift.h" #import "ThreadUtil.h" #import diff --git a/Signal/test/Models/AccountManagerTest.swift b/Signal/test/Models/AccountManagerTest.swift index aa50d5e3b..3ac8a62d0 100644 --- a/Signal/test/Models/AccountManagerTest.swift +++ b/Signal/test/Models/AccountManagerTest.swift @@ -43,7 +43,7 @@ class TokenObtainingTSAccountManager: VerifyingTSAccountManager { class AccountManagerTest: XCTestCase { let tsAccountManager = FailingTSAccountManager(networkManager: TSNetworkManager.shared(), storageManager: TSStorageManager.shared()) - var preferences = PropertyListPreferences() + var preferences = OWSPreferences() func testRegisterWhenEmptyCode() { let accountManager = AccountManager(textSecureAccountManager: tsAccountManager, preferences: self.preferences)