1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-22 04:49:00 +00:00

AndroidWorkload: Added unchangeable android permissions

Some android permissions are categorized as 'unchangeable' so we don't need to
try and set them.
This commit is contained in:
Marc Bonnici 2017-05-18 17:51:15 +01:00
parent 3f03dec7af
commit 70f646f87d
2 changed files with 32 additions and 11 deletions

View File

@ -26,7 +26,8 @@ from wlauto.core.resource import NO_ONE
from wlauto.common.android.resources import ApkFile, ReventFile from wlauto.common.android.resources import ApkFile, ReventFile
from wlauto.common.resources import ExtensionAsset, Executable, File from wlauto.common.resources import ExtensionAsset, Executable, File
from wlauto.exceptions import WorkloadError, ResourceError, DeviceError from wlauto.exceptions import WorkloadError, ResourceError, DeviceError
from wlauto.utils.android import ApkInfo, ANDROID_NORMAL_PERMISSIONS, UNSUPPORTED_PACKAGES from wlauto.utils.android import (ApkInfo, ANDROID_NORMAL_PERMISSIONS,
ANDROID_UNCHANGEABLE_PERMISSIONS, UNSUPPORTED_PACKAGES)
from wlauto.utils.types import boolean, ParameterDict from wlauto.utils.types import boolean, ParameterDict
from wlauto.utils.revent import ReventRecording from wlauto.utils.revent import ReventRecording
import wlauto.utils.statedetect as state_detector import wlauto.utils.statedetect as state_detector
@ -446,6 +447,8 @@ class ApkWorkload(Workload):
# "Normal" Permisions are automatically granted and cannot be changed # "Normal" Permisions are automatically granted and cannot be changed
permission_name = permission.rsplit('.', 1)[1] permission_name = permission.rsplit('.', 1)[1]
if permission_name not in ANDROID_NORMAL_PERMISSIONS: if permission_name not in ANDROID_NORMAL_PERMISSIONS:
# Some permissions are not allowed to be "changed"
if permission_name not in ANDROID_UNCHANGEABLE_PERMISSIONS:
# On some API 23+ devices, this may fail with a SecurityException # On some API 23+ devices, this may fail with a SecurityException
# on previously granted permissions. In that case, just skip as it # on previously granted permissions. In that case, just skip as it
# is not fatal to the workload execution # is not fatal to the workload execution

View File

@ -103,6 +103,24 @@ ANDROID_NORMAL_PERMISSIONS = [
'UNINSTALL_SHORTCUT', 'UNINSTALL_SHORTCUT',
] ]
ANDROID_UNCHANGEABLE_PERMISSIONS = [
'USE_CREDENTIALS',
'MANAGE_ACCOUNTS',
'DOWNLOAD_WITHOUT_NOTIFICATION',
'AUTHENTICATE_ACCOUNTS',
'WRITE_SETTINGS',
'WRITE_SYNC_STATS',
'SUBSCRIBED_FEEDS_WRITE',
'SUBSCRIBED_FEEDS_READ',
'READ_PROFILE',
'WRITE_MEDIA_STORAGE',
'RESTART_PACKAGES',
'MOUNT_UNMOUNT_FILESYSTEMS',
'CLEAR_APP_CACHE',
'GET_TASKS',
]
# Package versions that are known to have problems with AndroidUiAutoBenchmark workloads. # Package versions that are known to have problems with AndroidUiAutoBenchmark workloads.
# NOTE: ABI versions are not included. # NOTE: ABI versions are not included.
UNSUPPORTED_PACKAGES = { UNSUPPORTED_PACKAGES = {