private async Task TakeSinglePhoto() { AdbController controller = GetController(); if (_lastCameraAction + Settings.Default.CameraOpenTimeout < DateTime.UtcNow || !await controller.IsInteractiveAndUnlocked()) { await OpenCameraSafely(); await Task.Delay(1000); } await controller.TakeSinglePhotoAsync(); UpdateLastCameraAction(); }
private async void OnTakeSinglePhotoButtonClickedAsync(object sender, EventArgs e) { AdbController controller = GetController(); if (_lastCameraAction + Settings.Default.CameraOpenTimeout < DateTime.UtcNow || !await controller.IsInteractiveAndUnlocked()) { await OpenCameraSafely(); await Task.Delay(1000); } await controller.TakeSinglePhotoAsync(); UpdateLastCameraAction(); }