1

I am writting some tests regarding the open/close of the flash to allow better images capturing from the camera.

How can I know inside an Espresso/UiAutomator test if the flash is on or off?

VC.One
  • 14,790
  • 4
  • 25
  • 57
svprdga
  • 2,171
  • 1
  • 28
  • 51
  • Are you trying to detect if it is currently on during a live capture or if it was on? Do you have access to a CameraCaptureSession or CaptureResult? If a solution does exist, it'll be in the Camera2 API: https://developer.android.com/reference/android/hardware/camera2/package-summary – Mike Collins Jan 22 '20 at 19:22
  • No @MikeCollins, in the test we are out of the normal activity scope, so there is no access to the Camera2 API as far as I know. – svprdga Jan 23 '20 at 16:49
  • I figured as much. I looked pretty hard and couldn’t find anything. There’s nothing in Espresso for this and adb output didn’t reveal anything useful for state, only existence. – Mike Collins Jan 24 '20 at 17:40

0 Answers0