mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-03-22 10:38:37 +00:00
AndroidDevice: Added method to retrive primary abi of installed package
Tries to retireve the primary abi of a currently installed package on device.
This commit is contained in:
parent
4352e02806
commit
f467f6f991
@ -262,6 +262,24 @@ class AndroidDevice(BaseLinuxDevice): # pylint: disable=W0223
|
|||||||
return line.split('=', 1)[1]
|
return line.split('=', 1)[1]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def get_installed_package_abi(self, package):
|
||||||
|
"""
|
||||||
|
Returns the primary abi of the specified package if it is installed
|
||||||
|
on the device, or ``None`` otherwise.
|
||||||
|
"""
|
||||||
|
output = self.execute('dumpsys package {}'.format(package))
|
||||||
|
val = None
|
||||||
|
for line in convert_new_lines(output).split('\n'):
|
||||||
|
if 'primaryCpuAbi' in line:
|
||||||
|
val = line.split('=', 1)[1]
|
||||||
|
break
|
||||||
|
if val == 'null':
|
||||||
|
return None
|
||||||
|
for abi, architectures in ABI_MAP.iteritems():
|
||||||
|
if val in architectures:
|
||||||
|
return abi
|
||||||
|
return val
|
||||||
|
|
||||||
def list_packages(self):
|
def list_packages(self):
|
||||||
"""
|
"""
|
||||||
List packages installed on the device.
|
List packages installed on the device.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user