diff --git a/wlauto/common/android/workload.py b/wlauto/common/android/workload.py index 7bc4ed55..fa2454ba 100755 --- a/wlauto/common/android/workload.py +++ b/wlauto/common/android/workload.py @@ -653,20 +653,26 @@ class AndroidUxPerfWorkload(AndroidUiAutoBenchmark): def push_assets(self, context): pushed = False + file_list = [] for f in self.deployable_assets: fpath = context.resolver.get(File(self, f)) device_path = self._path_on_device(fpath) if self.force_push_assets or not self.device.file_exists(device_path): self.device.push_file(fpath, device_path, timeout=300) + file_list.append(device_path) pushed = True if pushed: - self.device.broadcast_media_mounted(self.device.working_directory) + self.device.refresh_device_files(file_list) def delete_assets(self): if self.deployable_assets: + file_list = [] for f in self.deployable_assets: - self.device.delete_file(self._path_on_device(f)) - self.device.broadcast_media_mounted(self.device.working_directory) + f = self._path_on_device(f) + self.device.delete_file(f) + file_list.append(f) + self.device.delete_file(f) + self.device.refresh_device_files(file_list) def __init__(self, device, **kwargs): super(AndroidUxPerfWorkload, self).__init__(device, **kwargs) diff --git a/wlauto/workloads/googlephotos/__init__.py b/wlauto/workloads/googlephotos/__init__.py index 4b6e2006..57c5030b 100755 --- a/wlauto/workloads/googlephotos/__init__.py +++ b/wlauto/workloads/googlephotos/__init__.py @@ -83,17 +83,22 @@ class Googlephotos(AndroidUxPerfWorkload): # This is to guarantee ordering and allows the workload to select a specific # image by subfolder, as filenames are not shown easily within the app d = self.device.working_directory + file_list = [] for i, f in enumerate(self.test_images): self.device.execute('mkdir -p {0}/wa-{1}'.format(d, i + 1)) self.device.execute('mv {0}/{2} {0}/wa-{1}/{2}'.format(d, i + 1, f)) + file_list.append('{0}/wa-{1}/{2}'.format(d, i + 1, f)) # Force rescan - self.device.broadcast_media_mounted(self.device.working_directory) + self.device.refresh_device_files(file_list) def teardown(self, context): super(Googlephotos, self).teardown(context) # Remove the subfolders and its content d = self.device.working_directory + file_list = [] for i in xrange(len(self.test_images)): - self.device.execute('rm -rf {0}/wa-{1}'.format(d, i + 1)) + f = '{0}/wa-{1}'.format(d, i + 1) + self.device.execute('rm -rf {}'.format(f)) + file_list.append(f) # Force rescan - self.device.broadcast_media_mounted(self.device.working_directory) + self.device.refresh_device_files(file_list)