From 5a1eb4a77856511f4b032842c318939edc0d1a7a Mon Sep 17 00:00:00 2001 From: Elif Topuz Date: Wed, 6 Dec 2023 14:14:58 +0000 Subject: [PATCH] UIBenchJankTests:modification to support Android 12/14 versions dex file search is modified. It collects all the available methods under the package name. Tested with other benchmarks (geekbench,pcmark,jankbench in Android 12) as well. --- devlib/utils/android.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/devlib/utils/android.py b/devlib/utils/android.py index 0b4b074..33dc0f0 100755 --- a/devlib/utils/android.py +++ b/devlib/utils/android.py @@ -231,12 +231,15 @@ class ApkInfo(object): parser = etree.XMLParser(encoding='utf-8', recover=True) xml_tree = etree.parse(StringIO(dump), parser) - package = next((i for i in xml_tree.iter('package') - if i.attrib['name'] == self.package), None) + package = [] + for i in xml_tree.iter('package'): + if i.attrib['name'] == self.package: + package.append(i) - self._methods = [(meth.attrib['name'], klass.attrib['name']) - for klass in package.iter('class') - for meth in klass.iter('method')] if package else [] + for elem in package: + self._methods.extend([(meth.attrib['name'], klass.attrib['name']) + for klass in elem.iter('class') + for meth in klass.iter('method')]) return self._methods def _run(self, command):