1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-21 20:38:57 +00:00

antutu: Fixed setting permissions

It has been observed on some devices that the FINE_LOCATION premissions is required
for antutu to run without asking for permissions at run time but this was not listed
in the APK manifest. This caused issues on devices were only the permissions in the
manifest can be granted. This commit sliences any error when trying to set this permission
as well as only trying only on Android 6+
This commit is contained in:
Sebastian Goscik 2016-08-24 14:36:00 +01:00
parent b426e00f2f
commit 9d4aa4983a

View File

@ -17,6 +17,7 @@ import os
from collections import defaultdict, OrderedDict
from wlauto import AndroidUiAutoBenchmark, Parameter, File
from wlauto.exceptions import DeviceError
from wlauto.utils.android import ApkInfo
@ -80,8 +81,12 @@ class Antutu(AndroidUiAutoBenchmark):
info = ApkInfo(antutu_3d)
if not context.device.is_installed(info.package):
self.device.install_apk(antutu_3d, timeout=120)
# Antutu doesnt seem to list this as one of its permissions, but it asks for it.
self.device.execute("pm grant com.antutu.ABenchMark android.permission.ACCESS_FINE_LOCATION")
if self.device.get_sdk_version() >= 23:
# Antutu doesnt seem to list this as one of its permissions, but on some devices it asks for it.
try:
self.device.execute("pm grant com.antutu.ABenchMark android.permission.ACCESS_FINE_LOCATION")
except DeviceError:
self.logger.debug("failed to grant ACCESS_FINE_LOCATION, continuing")
super(Antutu, self).setup(context)
def update_result(self, context):