From 9376c6875b861afdba6666c0c897c2db983604a1 Mon Sep 17 00:00:00 2001 From: muendelezaji Date: Tue, 3 May 2016 14:25:15 +0100 Subject: [PATCH] ApkWorkload extension support - Allow disabling main activity launch in setup (required for some apps) - Parameterise clear data on reset (default behaviour unchanged) --- wlauto/common/android/workload.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wlauto/common/android/workload.py b/wlauto/common/android/workload.py index 0dbae5bd..34bb8059 100644 --- a/wlauto/common/android/workload.py +++ b/wlauto/common/android/workload.py @@ -138,6 +138,11 @@ class ApkWorkload(Workload): :view: The class of the main view pane of the app. This needs to be defined in order to collect SurfaceFlinger-derived statistics (such as FPS) for the app, but may otherwise be left as ``None``. + :launch_main: If ``False``, the default activity will not be launched (during setup), + allowing workloads to start the app with an intent of their choice in + the run step. This is useful for apps without a launchable default/main + activity or those where it cannot be launched without intent data (which + is provided at the run phase). :install_timeout: Timeout for the installation of the APK. This may vary wildly based on the size and nature of a specific APK, and so should be defined on per-workload basis. @@ -160,6 +165,7 @@ class ApkWorkload(Workload): min_apk_version = None max_apk_version = None supported_platforms = ['android'] + launch_main = True parameters = [ Parameter('install_timeout', kind=int, default=300, @@ -214,7 +220,8 @@ class ApkWorkload(Workload): if self.check_apk: self.check_apk_version() - self.launch_package() + if self.launch_main: + self.launch_package() # launch default activity without intent data self.device.execute('am kill-all') # kill all *background* activities self.device.clear_logcat()