CameraITS: properly gate the flash mode test

Skip the flash mode test if the device doesn't support
flash control.

Bug: 17994909

Change-Id: I598a2650554ab6cdfc39524da78dc34f0dc28f3a
diff --git a/apps/CameraITS/pymodules/its/caps.py b/apps/CameraITS/pymodules/its/caps.py
index 5167614..bf9ec91 100644
--- a/apps/CameraITS/pymodules/its/caps.py
+++ b/apps/CameraITS/pymodules/its/caps.py
@@ -186,6 +186,18 @@
     return props.has_key("android.scaler.croppingType") and \
            props["android.scaler.croppingType"] == 1
 
+def flash(props):
+    """Returns whether a device supports flash control.
+
+    Args:
+        props: Camera properties object.
+
+    Return:
+        Boolean.
+    """
+    return props.has_key("android.flash.info.available") and \
+           props["android.flash.info.available"] == 1
+
 class __UnitTest(unittest.TestCase):
     """Run a suite of unit tests on this module.
     """
diff --git a/apps/CameraITS/tests/scene1/test_param_flash_mode.py b/apps/CameraITS/tests/scene1/test_param_flash_mode.py
index 28ccc29..709437e 100644
--- a/apps/CameraITS/tests/scene1/test_param_flash_mode.py
+++ b/apps/CameraITS/tests/scene1/test_param_flash_mode.py
@@ -26,7 +26,8 @@
 
     with its.device.ItsSession() as cam:
         props = cam.get_camera_properties()
-        its.caps.skip_unless(its.caps.compute_target_exposure(props))
+        its.caps.skip_unless(its.caps.compute_target_exposure(props) and
+                             its.caps.flash(props))
 
         flash_modes_reported = []
         flash_states_reported = []