示例#1
0
 private static void EndEnergySaverStatusMonitoring()
 {
     if (_powerSaveModeChangeReceiver != null)
     {
         Android.App.Application.Context.UnregisterReceiver(_powerSaveModeChangeReceiver);
         _powerSaveModeChangeReceiver = null;
     }
 }
示例#2
0
        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);
        }