1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-03 03:42:35 +01:00

AndroidWorkload: Modified workload to properly check for an apks abi

Previously when retrieving apks only it's name would be used to choose
an apk. Now the native code reported by the apk is used to determine
the correct version to run for the specific device. It tries to
match the primary abi of device with native code before falling back to
using a compatible apk.

When using the check_abi parameter it no longer relies on naming convention
and only allows apks with native code supporting a devices primary abi to be
used.

Updated the relevant documentation.
This commit is contained in:
Marc Bonnici
2016-12-07 16:34:15 +00:00
parent f467f6f991
commit a8a8d21de6
4 changed files with 50 additions and 24 deletions

View File

@@ -30,7 +30,7 @@ from wlauto.common.resources import Executable
from wlauto.core.resource import NO_ONE
from wlauto.common.linux.device import BaseLinuxDevice, PsEntry
from wlauto.exceptions import DeviceError, WorkerThreadError, TimeoutError, DeviceNotRespondingError
from wlauto.utils.misc import convert_new_lines
from wlauto.utils.misc import convert_new_lines, ABI_MAP
from wlauto.utils.types import boolean, regex
from wlauto.utils.android import (adb_shell, adb_background_shell, adb_list_devices,
adb_command, AndroidProperties, ANDROID_VERSION_MAP)
@@ -108,7 +108,11 @@ class AndroidDevice(BaseLinuxDevice): # pylint: disable=W0223
@property
def abi(self):
return self.getprop()['ro.product.cpu.abi'].split('-')[0]
val = self.getprop()['ro.product.cpu.abi'].split('-')[0]
for abi, architectures in ABI_MAP.iteritems():
if val in architectures:
return abi
return val
@property
def supported_eabi(self):
@@ -120,7 +124,18 @@ class AndroidDevice(BaseLinuxDevice): # pylint: disable=W0223
for eabi in props['ro.product.cpu.abilist'].split(','):
if eabi not in result:
result.append(eabi)
return result
mapped_result = []
for supported_eabi in result:
for abi, architectures in ABI_MAP.iteritems():
found = False
if supported_eabi in architectures and abi not in mapped_result:
mapped_result.append(abi)
found = True
break
if not found and supported_eabi not in mapped_result:
mapped_result.append(supported_eabi)
return mapped_result
def __init__(self, **kwargs):
super(AndroidDevice, self).__init__(**kwargs)