1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-07 21:51:33 +00:00

framework/rt_config: Add support for chromeos for some AndroidRTConfig

Allows setting of select android runtime configuration for devices running
chromeos and which support android. Currently only 'brightness' is functioning
correctly therefore the other parameters are only enable for standard android devices.
This commit is contained in:
Marc Bonnici 2018-01-10 17:45:32 +00:00 committed by setrofim
parent 320da77ac0
commit 1101c358d0

View File

@ -844,7 +844,9 @@ class AndroidRuntimeConfig(RuntimeConfig):
super(AndroidRuntimeConfig, self).__init__(target) super(AndroidRuntimeConfig, self).__init__(target)
def initialize(self): def initialize(self):
if self.target.os != 'android': if self.target.os not in ['android', 'chromeos']:
return
if self.target.os == 'chromeos' and not self.target.supports_android:
return return
param_name = 'brightness' param_name = 'brightness'
@ -857,6 +859,8 @@ class AndroidRuntimeConfig(RuntimeConfig):
Specify the screen brightness to be set for Specify the screen brightness to be set for
the device the device
""") """)
if self.target.os is 'android':
param_name = 'airplane_mode' param_name = 'airplane_mode'
self._runtime_params[param_name] = \ self._runtime_params[param_name] = \
RuntimeParameter(param_name, kind=bool, RuntimeParameter(param_name, kind=bool,
@ -865,6 +869,7 @@ class AndroidRuntimeConfig(RuntimeConfig):
Specify whether airplane mode should be Specify whether airplane mode should be
enabled for the device enabled for the device
""") """)
param_name = 'rotation' param_name = 'rotation'
self._runtime_params[param_name] = \ self._runtime_params[param_name] = \
RuntimeParameter(param_name, kind=ScreenOrientation, RuntimeParameter(param_name, kind=ScreenOrientation,
@ -872,6 +877,7 @@ class AndroidRuntimeConfig(RuntimeConfig):
description=""" description="""
Specify the screen orientation for the device Specify the screen orientation for the device
""") """)
param_name = 'screen_on' param_name = 'screen_on'
self._runtime_params[param_name] = \ self._runtime_params[param_name] = \
RuntimeParameter(param_name, kind=bool, RuntimeParameter(param_name, kind=bool,
@ -882,8 +888,10 @@ class AndroidRuntimeConfig(RuntimeConfig):
""") """)
def check_target(self): def check_target(self):
if self.target.os != 'android': if self.target.os != 'android' and self.target.os != 'chromeos':
raise ConfigError('Target does not appear to be running Android') raise ConfigError('Target does not appear to be running Android')
if self.target.os == 'chromeos' and not self.target.supports_android:
raise ConfigError('Target does not appear to support Android')
def validate_parameters(self): def validate_parameters(self):
pass pass