camera_HAL3: get media profiles by android-sh
Get the media profiles XML by android-sh so that it does not matter
where the file is mounted.
BUG=b/73804718
TEST='test_that soraka camera_HAL3'
Change-Id: Ia6e9bcbca3f8efc324af1fff2a74fa9c7e8b3d39
Reviewed-on: https://chromium-review.googlesource.com/936346
Commit-Ready: Hung-yu Wu <hywu@chromium.org>
Tested-by: Hung-yu Wu <hywu@chromium.org>
Reviewed-by: Ricky Liang <jcliang@chromium.org>
diff --git a/client/site_tests/camera_HAL3/camera_HAL3.py b/client/site_tests/camera_HAL3/camera_HAL3.py
index 3f6c655..efa8856 100644
--- a/client/site_tests/camera_HAL3/camera_HAL3.py
+++ b/client/site_tests/camera_HAL3/camera_HAL3.py
@@ -20,10 +20,7 @@
dep = 'camera_hal3'
adapter_service = 'camera-halv3-adapter'
timeout = 600
- media_profiles_path = os.path.join(os.path.sep, 'opt', 'google',
- 'containers', 'android', 'rootfs',
- 'root', 'vendor', 'etc',
- 'media_profiles.xml')
+ media_profiles_path = os.path.join('vendor', 'etc', 'media_profiles.xml')
def setup(self):
"""
@@ -41,8 +38,10 @@
with service_stopper.ServiceStopper([self.adapter_service]):
cmd = [ os.path.join(self.dep_dir, 'bin', self.test_binary) ]
- tree = xml.etree.ElementTree.parse(self.media_profiles_path)
- root = tree.getroot()
+ xml_content = utils.system_output(
+ ' '.join(['android-sh', '-c', '\"cat',
+ self.media_profiles_path + '\"']))
+ root = xml.etree.ElementTree.fromstring(xml_content)
recording_params = Set()
for camcorder_profiles in root.findall('CamcorderProfiles'):
for encoder_profile in camcorder_profiles.findall('EncoderProfile'):