diff --git a/src/Android/PackageReplacedReceiver.cs b/src/Android/PackageReplacedReceiver.cs index 9620c3124..869aa56cc 100644 --- a/src/Android/PackageReplacedReceiver.cs +++ b/src/Android/PackageReplacedReceiver.cs @@ -15,8 +15,9 @@ namespace Bit.Android public override void OnReceive(Context context, Intent intent) { Debug.WriteLine("App updated!"); - Helpers.PerformUpdateTasks(Resolver.Resolve(), Resolver.Resolve(), - Resolver.Resolve()); + Helpers.PerformUpdateTasks(Resolver.Resolve(), + Resolver.Resolve(),Resolver.Resolve(), + Resolver.Resolve()); } } } diff --git a/src/App/App.cs b/src/App/App.cs index 74735454b..731ce905e 100644 --- a/src/App/App.cs +++ b/src/App/App.cs @@ -103,7 +103,7 @@ namespace Bit.App if(string.IsNullOrWhiteSpace(_uri)) { - Helpers.PerformUpdateTasks(_settings, _appInfoService, _databaseService); + Helpers.PerformUpdateTasks(_settings, _appInfoService, _databaseService, _syncService); await Task.Run(() => FullSyncAsync()).ConfigureAwait(false); } diff --git a/src/App/Utilities/Helpers.cs b/src/App/Utilities/Helpers.cs index 67e417a9c..26b7f6468 100644 --- a/src/App/Utilities/Helpers.cs +++ b/src/App/Utilities/Helpers.cs @@ -1,6 +1,7 @@ using Bit.App.Abstractions; using Plugin.Settings.Abstractions; using System; +using System.Threading.Tasks; using Xamarin.Forms; namespace Bit.App.Utilities @@ -41,14 +42,15 @@ namespace Bit.App.Utilities #endif } - public static bool PerformUpdateTasks(ISettings settings, IAppInfoService appInfoService, - IDatabaseService databaseService) + public static bool PerformUpdateTasks(ISettings settings, + IAppInfoService appInfoService, IDatabaseService databaseService, ISyncService syncService) { var lastBuild = settings.GetValueOrDefault(Constants.LastBuildKey, null); if(InDebugMode() || lastBuild == null || lastBuild != appInfoService.Build) { settings.AddOrUpdateValue(Constants.LastBuildKey, appInfoService.Build); databaseService.CreateTables(); + var task = Task.Run(async () => await syncService.FullSyncAsync(true)); return true; }