Merge branch 'charlesmchen/explicitBackupFeatureFlag' into release/2.32.0

This commit is contained in:
Matthew Chen 2018-12-03 22:05:26 -05:00
commit 151b339339
3 changed files with 12 additions and 13 deletions

View File

@ -193,20 +193,8 @@
actionBlock:^{
[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 showBackup = isBackupEnabled;
SUPPRESS_DEADSTORE_WARNING(showBackup);
#ifdef DEBUG
showBackup = YES;
#endif
BOOL showBackup = (OWSBackup.isFeatureEnabled && isBackupEnabled);
if (showBackup) {
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_BACKUP",
@"Label for the backup view in app settings.")

View File

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

View File

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