1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-01 19:02:31 +01:00

Implement caching of ApkInfo

Allow caching of ApkInfo to prevent the requirement of re-parsing
of APK files.
This commit is contained in:
Marc Bonnici
2020-06-01 10:35:18 +01:00
committed by setrofim
parent 4557da2f80
commit 1425a6f6c9
5 changed files with 87 additions and 26 deletions

View File

@@ -32,16 +32,16 @@ import tarfile
from subprocess import CalledProcessError
from devlib.exception import TargetError
from devlib.utils.android import ApkInfo
from wa import Instrument, Parameter, very_fast
from wa.framework.exception import ConfigError
from wa.framework.instrument import slow
from wa.utils.diff import diff_sysfs_dirs, diff_interrupt_files
from wa.utils.misc import as_relative, lock_file
from wa.utils.misc import as_relative
from wa.utils.misc import ensure_file_directory_exists as _f
from wa.utils.misc import ensure_directory_exists as _d
from wa.utils.types import list_of_strings
from wa.utils.android import get_cacheable_apk_info
logger = logging.getLogger(__name__)
@@ -244,8 +244,7 @@ class ApkVersion(Instrument):
def setup(self, context):
if hasattr(context.workload, 'apk_file'):
with lock_file(context.workload.apk_file):
self.apk_info = ApkInfo(context.workload.apk_file)
self.apk_info = get_cacheable_apk_info(context.workload.apk_file)
else:
self.apk_info = None