mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-20 20:09:11 +00:00
fw/workload: Fix installed apk info
Fix an issue where AndroidWorkload.pull_apk would sometimes get the wrong package if the desired package name is a substring of another package name. Rather than using a regex to match the package name, use the new get_package_info method to match the name exactly.
This commit is contained in:
parent
758abedd1f
commit
dd7ff641f3
@ -780,9 +780,8 @@ class PackageHandler(object):
|
||||
if not self.target.package_is_installed(package):
|
||||
message = 'Cannot retrieve "{}" as not installed on Target'
|
||||
raise WorkloadError(message.format(package))
|
||||
package_info = self.target.execute('pm list packages -f {}'.format(package))
|
||||
apk_path = re.match('package:(.*)={}'.format(package), package_info).group(1)
|
||||
self.target.pull(apk_path, self.owner.dependencies_directory)
|
||||
package_info = self.target.get_package_info(package)
|
||||
self.target.pull(package_info.apk_path, self.owner.dependencies_directory)
|
||||
|
||||
def teardown(self):
|
||||
self.target.execute('am force-stop {}'.format(self.apk_info.package))
|
||||
|
Loading…
x
Reference in New Issue
Block a user