private static void EndEnergySaverStatusMonitoring() { if (_powerSaveModeChangeReceiver != null) { Android.App.Application.Context.UnregisterReceiver(_powerSaveModeChangeReceiver); _powerSaveModeChangeReceiver = null; } }
private static void StartEnergySaverStatusMonitoring() { if (_powerSaveModeChangeReceiver == null) { _powerSaveModeChangeReceiver = new PowerSaveModeChangeReceiver(); } var filter = new IntentFilter(); filter.AddAction(AndroidPowerManager.ActionPowerSaveModeChanged); Android.App.Application.Context.RegisterReceiver(_powerSaveModeChangeReceiver, filter); }