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.
"""