1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-20 20:09:11 +00:00

Workload: Makes APK starting activity optional

The starting activity is not always listed in an apk or required to start
an application to its default state, for example youtube. Therefore now the
starting activity will only be used if one is available.
This commit is contained in:
Marc Bonnici 2017-06-27 10:50:13 +01:00
parent 1b93a4162b
commit d6f18466c9

View File

@ -515,9 +515,12 @@ class PackageHandler(object):
self.apk_version = host_version
def start_activity(self):
cmd = 'am start -W -n {}/{}'
output = self.target.execute(cmd.format(self.apk_info.package,
self.apk_info.activity))
if not self.apk_info.activity:
cmd = 'am start -W {}'.format(self.apk_info.package)
else:
cmd = 'am start -W -n {}/{}'.format(self.apk_info.package,
self.apk_info.activity)
output = self.target.execute(cmd)
if 'Error:' in output:
# this will dismiss any error dialogs
self.target.execute('am force-stop {}'.format(self.apk_info.package))