Commit d88641c3 authored by DanmeiChen's avatar DanmeiChen
Browse files

disable VFS for simulators or error case

parent 7183116b
Pipeline #29009 passed with stage
in 4 minutes and 40 seconds
......@@ -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;
......
......@@ -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"];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment