mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 10:11:17 +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:
parent
320da77ac0
commit
1101c358d0
@ -844,7 +844,9 @@ class AndroidRuntimeConfig(RuntimeConfig):
|
||||
super(AndroidRuntimeConfig, self).__init__(target)
|
||||
|
||||
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
|
||||
|
||||
param_name = 'brightness'
|
||||
@ -857,33 +859,39 @@ class AndroidRuntimeConfig(RuntimeConfig):
|
||||
Specify the screen brightness to be set for
|
||||
the device
|
||||
""")
|
||||
param_name = 'airplane_mode'
|
||||
self._runtime_params[param_name] = \
|
||||
RuntimeParameter(param_name, kind=bool,
|
||||
setter=self.set_airplane_mode,
|
||||
description="""
|
||||
Specify whether airplane mode should be
|
||||
enabled for the device
|
||||
""")
|
||||
param_name = 'rotation'
|
||||
self._runtime_params[param_name] = \
|
||||
RuntimeParameter(param_name, kind=ScreenOrientation,
|
||||
setter=self.set_rotation,
|
||||
description="""
|
||||
Specify the screen orientation for the device
|
||||
""")
|
||||
param_name = 'screen_on'
|
||||
self._runtime_params[param_name] = \
|
||||
RuntimeParameter(param_name, kind=bool,
|
||||
default=True,
|
||||
setter=self.set_screen_state,
|
||||
description="""
|
||||
Specify whether the device screen should be on
|
||||
""")
|
||||
|
||||
if self.target.os is 'android':
|
||||
param_name = 'airplane_mode'
|
||||
self._runtime_params[param_name] = \
|
||||
RuntimeParameter(param_name, kind=bool,
|
||||
setter=self.set_airplane_mode,
|
||||
description="""
|
||||
Specify whether airplane mode should be
|
||||
enabled for the device
|
||||
""")
|
||||
|
||||
param_name = 'rotation'
|
||||
self._runtime_params[param_name] = \
|
||||
RuntimeParameter(param_name, kind=ScreenOrientation,
|
||||
setter=self.set_rotation,
|
||||
description="""
|
||||
Specify the screen orientation for the device
|
||||
""")
|
||||
|
||||
param_name = 'screen_on'
|
||||
self._runtime_params[param_name] = \
|
||||
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):
|
||||
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')
|
||||
if self.target.os == 'chromeos' and not self.target.supports_android:
|
||||
raise ConfigError('Target does not appear to support Android')
|
||||
|
||||
def validate_parameters(self):
|
||||
pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user