diff --git a/wlauto/common/android/workload.py b/wlauto/common/android/workload.py index 85826139..8bebfacd 100644 --- a/wlauto/common/android/workload.py +++ b/wlauto/common/android/workload.py @@ -188,7 +188,7 @@ class ApkWorkload(Workload): self.device.clear_logcat() def initialize_package(self, context): - installed_version = self.device.get_installed_package_version(self.package) + installed_version = self.device.get_package_version(self.package) if self.check_apk: self.initialize_with_host_apk(context, installed_version) else: @@ -238,7 +238,7 @@ class ApkWorkload(Workload): # As of android API level 23, apps can request permissions at runtime, # this will grant all of them so requests do not pop up when running the app - if self.device.get_sdk_version() >= 23: + if self.device.os_version['sdk'] >= 23: self._grant_requested_permissions() def install_apk(self, context): @@ -281,7 +281,7 @@ class ApkWorkload(Workload): def update_result(self, context): self.logcat_log = os.path.join(context.output_directory, 'logcat.log') - self.device.dump_logcat(self.logcat_log) + context.device_manager.dump_logcat(self.logcat_log) context.add_iteration_artifact(name='logcat', path='logcat.log', kind='log', @@ -488,7 +488,7 @@ class GameWorkload(ApkWorkload, ReventWorkload): # exist. self.device.push(asset_tarball, ondevice_cache, timeout=timeout) - device_asset_directory = self.device.path.join(self.device.external_storage_directory, 'Android', kind) + device_asset_directory = self.device.path.join(self.context.device_manager.external_storage_directory, 'Android', kind) deploy_command = 'cd {} && {} tar -xzf {}'.format(device_asset_directory, self.device.busybox, ondevice_cache) diff --git a/wlauto/workloads/bbench/__init__.py b/wlauto/workloads/bbench/__init__.py index c04f18de..0652a669 100644 --- a/wlauto/workloads/bbench/__init__.py +++ b/wlauto/workloads/bbench/__init__.py @@ -123,7 +123,7 @@ class BBench(Workload): self.device.write_value('/proc/sys/vm/drop_caches', 3) #On android 6+ the web browser requires permissions to access the sd card - if self.device.get_sdk_version() >= 23: + if self.device.os_version["sdk"]() >= 23: self.device.execute("pm grant com.android.browser android.permission.READ_EXTERNAL_STORAGE") self.device.execute("pm grant com.android.browser android.permission.WRITE_EXTERNAL_STORAGE") diff --git a/wlauto/workloads/dex2oat/__init__.py b/wlauto/workloads/dex2oat/__init__.py index de46472c..f7788219 100644 --- a/wlauto/workloads/dex2oat/__init__.py +++ b/wlauto/workloads/dex2oat/__init__.py @@ -88,7 +88,7 @@ class Dex2oatBenchmark(Workload): """ logcat_log = os.path.join(context.output_directory, 'logcat.log') - self.device.dump_logcat(logcat_log) + context.device_manager.dump_logcat(logcat_log) regex_time = re.compile("^I\/dex2oat \( *[0-9]+\): dex2oat took (?P