mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-04-20 09:40:50 +01:00
framework/workload: default view for ApkWorkload
- Add "activity" property to PackageManager exposing the underlying apk_info attribute. - Add "view" class attribute to ApkWorkload, initialized to None - If "view" is not set for a particular workload, set a default based on the package and activity of the underlying workload.
This commit is contained in:
parent
4e6ba64737
commit
9cb7ea862c
@ -99,12 +99,14 @@ class Workload(TargetedPlugin):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return '<Workload {}>'.format(self.name)
|
return '<Workload {}>'.format(self.name)
|
||||||
|
|
||||||
|
|
||||||
class ApkWorkload(Workload):
|
class ApkWorkload(Workload):
|
||||||
|
|
||||||
# May be optionally overwritten by subclasses
|
# May be optionally overwritten by subclasses
|
||||||
# Times are in seconds
|
# Times are in seconds
|
||||||
loading_time = 10
|
loading_time = 10
|
||||||
package_names = []
|
package_names = []
|
||||||
|
view = None
|
||||||
|
|
||||||
parameters = [
|
parameters = [
|
||||||
Parameter('package_name', kind=str,
|
Parameter('package_name', kind=str,
|
||||||
@ -175,6 +177,9 @@ class ApkWorkload(Workload):
|
|||||||
@once_per_instance
|
@once_per_instance
|
||||||
def initialize(self, context):
|
def initialize(self, context):
|
||||||
self.apk.initialize(context)
|
self.apk.initialize(context)
|
||||||
|
if self.view is None:
|
||||||
|
self.view = 'SurfaceView - {}/{}'.format(self.apk.package,
|
||||||
|
self.apk.activity)
|
||||||
|
|
||||||
def setup(self, context):
|
def setup(self, context):
|
||||||
self.apk.setup(context)
|
self.apk.setup(context)
|
||||||
@ -440,6 +445,12 @@ class PackageHandler(object):
|
|||||||
return None
|
return None
|
||||||
return self.apk_info.package
|
return self.apk_info.package
|
||||||
|
|
||||||
|
@property
|
||||||
|
def activity(self):
|
||||||
|
if self.apk_info is None:
|
||||||
|
return None
|
||||||
|
return self.apk_info.activity
|
||||||
|
|
||||||
def __init__(self, owner, install_timeout=300, version=None, variant=None,
|
def __init__(self, owner, install_timeout=300, version=None, variant=None,
|
||||||
package_name=None, strict=False, force_install=False, uninstall=False,
|
package_name=None, strict=False, force_install=False, uninstall=False,
|
||||||
exact_abi=False):
|
exact_abi=False):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user