bitwarden-android/src/Android/Receivers/PackageReplacedReceiver.cs

23 lines
835 B
C#
Raw Normal View History

2019-05-16 19:30:20 +03:00
using System;
using Android.App;
using Android.Content;
2019-05-30 21:13:02 +03:00
using Bit.App.Abstractions;
using Bit.App.Utilities;
using Bit.Core.Abstractions;
using Bit.Core.Utilities;
2019-05-16 19:30:20 +03:00
namespace Bit.Droid.Receivers
{
[BroadcastReceiver(Name = "com.x8bit.bitwarden.PackageReplacedReceiver", Exported = false)]
[IntentFilter(new[] { Intent.ActionMyPackageReplaced })]
public class PackageReplacedReceiver : BroadcastReceiver
{
2019-05-30 21:13:02 +03:00
public override async void OnReceive(Context context, Intent intent)
2019-05-16 19:30:20 +03:00
{
2019-05-30 21:13:02 +03:00
var storageService = ServiceContainer.Resolve<IStorageService>("storageService");
await AppHelpers.PerformUpdateTasksAsync(ServiceContainer.Resolve<ISyncService>("syncService"),
ServiceContainer.Resolve<IDeviceActionService>("deviceActionService"), storageService);
2019-05-16 19:30:20 +03:00
}
}
}