1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-07 13:41:24 +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,33 +859,39 @@ class AndroidRuntimeConfig(RuntimeConfig):
Specify the screen brightness to be set for Specify the screen brightness to be set for
the device the device
""") """)
param_name = 'airplane_mode'
self._runtime_params[param_name] = \ if self.target.os is 'android':
RuntimeParameter(param_name, kind=bool, param_name = 'airplane_mode'
setter=self.set_airplane_mode, self._runtime_params[param_name] = \
description=""" RuntimeParameter(param_name, kind=bool,
Specify whether airplane mode should be setter=self.set_airplane_mode,
enabled for the device description="""
""") Specify whether airplane mode should be
param_name = 'rotation' enabled for the device
self._runtime_params[param_name] = \ """)
RuntimeParameter(param_name, kind=ScreenOrientation,
setter=self.set_rotation, param_name = 'rotation'
description=""" self._runtime_params[param_name] = \
Specify the screen orientation for the device RuntimeParameter(param_name, kind=ScreenOrientation,
""") setter=self.set_rotation,
param_name = 'screen_on' description="""
self._runtime_params[param_name] = \ Specify the screen orientation for the device
RuntimeParameter(param_name, kind=bool, """)
default=True,
setter=self.set_screen_state, param_name = 'screen_on'
description=""" self._runtime_params[param_name] = \
Specify whether the device screen should be on RuntimeParameter(param_name, kind=bool,
""") default=True,
setter=self.set_screen_state,
description="""
Specify whether the device screen should be on
""")
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