1

我在此策略中有一个包含权限授予的应用程序。我已将此策略应用于多个完全托管的设备;但是,当去应用程序查看物理设备上的权限时,这些 GRANT 权限并没有反映在设备上。例如,它只是说 Chrome 没有权限。为了通过 Android Management API 策略控制特定的应用程序权限,是否必须设置前导设置?

这是当前的政策:

    "applications": [
    {
        "packageName": "com.android.chrome",
        "installType": "FORCE_INSTALLED",
        "permissionGrants": [
            {
                "permission": "ACCESS_COARSE_LOCATION",
                "policy": "GRANT"
            },
            {
                "permission": "ACCESS_FINE_LOCATION",
                "policy": "GRANT"
            },
            {
                "permission": "WRITE_EXTERNAL_STORAGE",
                "policy": "GRANT"
            },
            {
                "permission": "READ_EXTERNAL_STORAGE",
                "policy": "GRANT"
            },
            {
                "permission": "READ_CALL_LOG",
                "policy": "GRANT"
            },
            {
                "permission": "READ_PHONE_STATE",
                "policy": "GRANT"
            },
            {
                "permission": "READ_CONTACTS",
                "policy": "GRANT"
            },
            {
                "permission": "READ_SMS",
                "policy": "GRANT"
            },
            {
                "permission": "RECEIVE_SMS",
                "policy": "GRANT"
            },
            {
                "permission": "RECEIVE_MMS",
                "policy": "GRANT"
            },
            {
                "permission": "CAMERA",
                "policy": "GRANT"
            },
            {
                "permission": "REQUEST_IGNORE_BATTERY_OPTIMIZATIONS",
                "policy": "GRANT"
            }
        ]
    }
]
4

1 回答 1

2

权限值应该是权限常量的值,而不是它的名称。例如,您应该使用“android.permission.ACCESS_COARSE_LOCATION”而不是“ACCESS_COARSE_LOCATION”

"applications": [
    {
        "packageName": "com.android.chrome",
        "installType": "FORCE_INSTALLED",
        "permissionGrants": [
            {
                "permission": "android.permission.ACCESS_COARSE_LOCATION",
                "policy": "GRANT"
            },
            {
                "permission": "android.permission.ACCESS_FINE_LOCATION",
                "policy": "GRANT"
            },
            {
                "permission": "android.permission.WRITE_EXTERNAL_STORAGE",
                "policy": "GRANT"
            },
            ...
        ]
    }
]
于 2021-11-12T21:15:17.850 回答