1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-02 19:32:34 +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

@@ -22,8 +22,8 @@ try:
except ImportError:
from pipes import quote
from devlib.utils.android import ApkInfo
from wa.utils.android import get_cacheable_apk_info
from wa.framework.plugin import TargetedPlugin, Parameter
from wa.framework.resource import (ApkFile, ReventFile,
File, loose_version_matching,
@@ -523,7 +523,7 @@ class UiAutomatorGUI(object):
def init_resources(self, resolver):
self.uiauto_file = resolver.get(ApkFile(self.owner, uiauto=True))
if not self.uiauto_package:
uiauto_info = ApkInfo(self.uiauto_file)
uiauto_info = get_cacheable_apk_info(self.uiauto_file)
self.uiauto_package = uiauto_info.package
def init_commands(self):
@@ -743,8 +743,7 @@ class PackageHandler(object):
self.resolve_package_from_host(context)
if self.apk_file:
with lock_file(self.apk_file):
self.apk_info = ApkInfo(self.apk_file)
self.apk_info = get_cacheable_apk_info(self.apk_file)
else:
if self.error_msg:
raise WorkloadError(self.error_msg)