protected override void OnResume() { base.OnResume(); try { RegisterReceiver(_appRestrictiosReceiver, new IntentFilter(Intent.ActionApplicationRestrictionsChanged)); } catch (Exception) { } Restrictor.ResolveRestrictions(ApplicationContext, _eventService); if (_settingsService.GetSetting <bool>("IsBroadcastEnabled") && !_settingsService.GetSetting <bool>("IsForegroundServiceEnabled")) { var udpClientServiceIntent = new Intent(this, typeof(UdpClientService)); StopService(udpClientServiceIntent); StartService(udpClientServiceIntent); } }
public override void OnReceive(Context context, Intent intent) => Restrictor.ResolveRestrictions(context, MainActivity.Container.Resolve <IEventService>());