我正在尝试通过 Android Management API 将策略应用于一些平板电脑。我已经能够毫无问题地创建我的企业、Web 应用程序、策略并添加设备。
我遇到的麻烦在于我的政策。我已经尝试了 SO 和文档中的各种版本,但它要么没有锁定平板电脑,要么我遇到了不合规错误。
我尝试过的政策
版本 1(来源)
{
"version": 1,
"applications": [
{
"packageName": "com.google.my.webapp",
"installType": "KIOSK",
"defaultPermissionPolicy": "GRANT"
},
{
"packageName": "com.android.chrome",
"installType": "FORCE_INSTALLED",
"managedConfiguration": {
"URLBLacklist": ["*"],
"URLWhitelist": ["my.whitelabeled.url.com"]
},
"defaultPermissionPolicy": "GRANT"
}
]
}
版本 2(来源)
{
"version": 2,
"applications": [
{
"packageName": "com.android.chrome",
"installType": "FORCE_INSTALLED",
"defaultPermissionPolicy": "GRANT",
"managedConfiguration": {
"URLBlacklist": [
"*"
],
"URLWhitelist": [
"my.whitelabeled.url.com"
]
}
},
{
"packageName": "com.google.my.webapp",
"installType": "KIOSK",
"defaultPermissionPolicy": "GRANT"
}
],
"statusBarDisabled": true,
"keyguardDisabled": true
}
第 3 版(来源)
{
"version": 3,
"applications": [
{
"packageName": "com.google.my.webapp",
"installType": "KIOSK",
"defaultPermissionPolicy": "GRANT"
}
],
"cameraDisabled": true,
"defaultPermissionPolicy": "GRANT",
"debuggingFeaturesAllowed": true
}
连同上述和其他示例的一些其他变体。他们都没有锁定设备。当我查看我的设备(下面的输出)表明存在MANAGEMENT_MODE
问题时,我似乎遇到了一些错误,这是有道理的,因为看起来政策只是PROFILE_OWNER
.
"devices": [
{
"name": "enterprises/__enterpriseid__/devices/__deviceid__",
"managementMode": "PROFILE_OWNER",
"state": "ACTIVE",
"appliedState": "ACTIVE",
"nonComplianceDetails": [
{
"settingName": "applications",
"nonComplianceReason": "MANAGEMENT_MODE",
"packageName": "com.google.my.webapp"
},
{
"settingName": "systemErrorDialogsDisabled",
"nonComplianceReason": "MANAGEMENT_MODE"
},
{
"settingName": "lockTaskFeatures",
"nonComplianceReason": "MANAGEMENT_MODE"
},
{
"settingName": "persistentPreferredActivities",
"nonComplianceReason": "INVALID_VALUE",
"packageName": "com.google.my.webapp"
},
{
"settingName": "statusBarDisabled",
"nonComplianceReason": "MANAGEMENT_MODE"
},
{
"settingName": "wifiConfigsLockdownEnabled",
"nonComplianceReason": "MANAGEMENT_MODE"
}
],
...
}
]
我确定我应该在某个地方指定它,但我找不到它。
有没有人有这样的工作政策:
- 在启动时启动 Chrome 和/或网络应用程序
- 锁定 Chrome,没有奇怪的固定选项
- 隐藏状态菜单/按钮
- 不让平板电脑休眠
谢谢!