Merge branch 'charlesmchen/explicitBackupFeatureFlag' into release/2.32.0

pull/1/head
Matthew Chen 6 years ago
commit 151b339339

@ -193,20 +193,8 @@
actionBlock:^{ actionBlock:^{
[weakSelf showAdvanced]; [weakSelf showAdvanced];
}]]; }]];
// Show backup UI in debug builds OR if backup has already been enabled.
//
// NOTE: Backup format is not yet finalized and backups are not yet
// properly encrypted, so these debug backups should only be
// done on test devices and will not be usable if/when we ship
// backup to production.
//
// TODO: Always show backup when we go to production.
BOOL isBackupEnabled = [OWSBackup.sharedManager isBackupEnabled]; BOOL isBackupEnabled = [OWSBackup.sharedManager isBackupEnabled];
BOOL showBackup = isBackupEnabled; BOOL showBackup = (OWSBackup.isFeatureEnabled && isBackupEnabled);
SUPPRESS_DEADSTORE_WARNING(showBackup);
#ifdef DEBUG
showBackup = YES;
#endif
if (showBackup) { if (showBackup) {
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_BACKUP", [section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_BACKUP",
@"Label for the backup view in app settings.") @"Label for the backup view in app settings.")

@ -44,6 +44,8 @@ typedef NS_ENUM(NSUInteger, OWSBackupState) {
@property (nonatomic, readonly, nullable) NSString *backupExportDescription; @property (nonatomic, readonly, nullable) NSString *backupExportDescription;
@property (nonatomic, readonly, nullable) NSNumber *backupExportProgress; @property (nonatomic, readonly, nullable) NSNumber *backupExportProgress;
+ (BOOL)isFeatureEnabled;
- (BOOL)isBackupEnabled; - (BOOL)isBackupEnabled;
- (void)setIsBackupEnabled:(BOOL)value; - (void)setIsBackupEnabled:(BOOL)value;

@ -107,6 +107,11 @@ NS_ASSUME_NONNULL_BEGIN
}); });
} }
+ (BOOL)isFeatureEnabled
{
return NO;
}
#pragma mark - Backup Export #pragma mark - Backup Export
- (void)tryToExportBackup - (void)tryToExportBackup
@ -251,6 +256,10 @@ NS_ASSUME_NONNULL_BEGIN
{ {
OWSAssertIsOnMainThread(); OWSAssertIsOnMainThread();
if (!OWSBackup.isFeatureEnabled) {
return;
}
// Start or abort a backup export if neccessary. // Start or abort a backup export if neccessary.
if (!self.shouldHaveBackupExport && self.backupExportJob) { if (!self.shouldHaveBackupExport && self.backupExportJob) {
[self.backupExportJob cancel]; [self.backupExportJob cancel];

Loading…
Cancel
Save