示例#1
0
        private void StopBluetoothIfNotHasPermissions()
        {
            if ((LocationServicesPermissionUtils.DoesNotHavePermissions() || !_viewModel.GetAutoStartScanner()) && _viewModel.IsRunning)
            {
                _viewModel.StopBluetooth();

                UnbindService(serviceConnection);
            }
        }
示例#2
0
 private void StartBluetoothIfHasPermissions()
 {
     if (!LocationServicesPermissionUtils.DoesNotHavePermissions() && !_viewModel.IsRunning && _viewModel.GetAutoStartScanner())
     {
         if (LocationServicesPermissionUtils.AdapterState == State.On)
         {
             _viewModel.StartBluetooth();
         }
     }
 }
示例#3
0
 private void HandleStartStop()
 {
     if (_viewModel.IsRunning)
     {
         _viewModel.StopBluetooth();
         UnbindService(serviceConnection);
     }
     else
     {
         if (!LocationServicesPermissionUtils.DoesNotHavePermissions() && !_viewModel.IsRunning)
         {
             _viewModel.StartBluetooth();
             BindDroidBluetoothService();
         }
     }
     UpdateUI();
 }