diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 47d2c0042..d53ab5d04 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -269,10 +269,16 @@ #endif - if ([[LinphoneManager instance] lpConfigBoolForKey:@"vfs_enabled_preference"] && !VFSUtil.activateVFS) { - [VFSUtil oslogWithLog:@"[VFS] Error unable to activate." level:OS_LOG_TYPE_ERROR]; + if ([[LinphoneManager instance] lpConfigBoolForKey:@"vfs_enabled_preference"]) { + if (TARGET_IPHONE_SIMULATOR) { + LOGW(@"[VFS] Can not active for simulators."); + [[LinphoneManager instance] lpConfigSetBool:FALSE forKey:@"vfs_enabled_preference"]; + } else if (!VFSUtil.activateVFS) { + [VFSUtil oslogWithLog:@"[VFS] Error unable to activate." level:OS_LOG_TYPE_ERROR]; + [[LinphoneManager instance] lpConfigSetBool:FALSE forKey:@"vfs_enabled_preference"]; + } } - + UIApplication *app = [UIApplication sharedApplication]; UIApplicationState state = app.applicationState; diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index b7676b07f..b1ffb75c7 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -784,10 +784,17 @@ [lm lpConfigSetString:[self stringForKey:@"auto_download_mode"] forKey:@"auto_download_mode"]; BOOL vfsEnabled = [self boolForKey:@"vfs_enabled_mode"] || [lm lpConfigBoolForKey:@"vfs_enabled_preference"]; if (vfsEnabled) { - [lm lpConfigSetBool:TRUE forKey:@"vfs_enabled_preference"]; - [self setBool:TRUE forKey:@"vfs_enabled_mode"]; - if (!VFSUtil.activateVFS) { + if (TARGET_IPHONE_SIMULATOR) { + LOGW(@"[VFS] Can not active for simulators."); + [lm lpConfigSetBool:FALSE forKey:@"vfs_enabled_preference"]; + [self setBool:FALSE forKey:@"vfs_enabled_mode"]; + } else if (!VFSUtil.activateVFS) { [VFSUtil oslogWithLog:@"[VFS] Error unable to activate." level:OS_LOG_TYPE_ERROR]; + [lm lpConfigSetBool:FALSE forKey:@"vfs_enabled_preference"]; + [self setBool:FALSE forKey:@"vfs_enabled_mode"]; + } else { + [lm lpConfigSetBool:TRUE forKey:@"vfs_enabled_preference"]; + [self setBool:TRUE forKey:@"vfs_enabled_mode"]; } } [lm lpConfigSetBool:[self boolForKey:@"auto_write_to_gallery_mode"] forKey:@"auto_write_to_gallery_preference"];