示例政策:工作资料设备

本页面包含适用于具有工作资料的设备的政策示例。

个人所有的设备

使用工作资料配置个人设备后,Android Device Policy 会自动将政策设置仅应用于工作资料。这样,您就可以将同一政策应用于具有工作资料的设备和完全受管设备

// Applies to the work profile.
"passwordRequirements": {
  "passwordMinimumLength": 6,
  "passwordQuality": "ALPHABETIC"
},
"applications": [{
  "defaultPermissionPolicy": "GRANT",
  "installType": "FORCE_INSTALLED",  // Auto-installs app in the work profile
  "packageName": "com.google.android.gm"
   },
  {
  "installType": "AVAILABLE",  // Adds app to the work profile's managed Play Store
  "packageName": "com.google.android.apps.docs"
}],

// Applies to the whole device.
"parentProfilePasswordRequirements": {
  "passwordMinimumLength": 4,
  "passwordQuality": "NUMERIC_COMPLEX"
}

公司自有设备

使用工作资料配置公司自有设备后,Android Device Policy 会自动将大多数政策设置应用于工作资料。虽然个人资料会维护用户隐私,但企业可以在个人资料和整个设备上强制执行部分限制和设置。

工作资料微件

workProfilewidgets 可让 IT 管理员更好地控制在设备主屏幕上显示哪些微件。 此字段目前设置为禁止的默认行为,但可以使用应用级 workProfileWidgets 和设备级 workProfileWidgetsDefault API 来允许。

个人使用政策

Enterprise 可以在公司自有设备的个人资料中强制执行特定限制,例如禁止安装特定应用、停用相机,以及设置用户可以暂停工作资料的时长。如需了解详情,请参阅 personalUsagePolicies

设备级政策

此表中的政策适用于整部设备。

政策名称
frpAdminEmails deviceOwnerLockScreenInfo systemUpdate
addUserDisabled bluetoothDisabled bluetoothConfigDisabled
cellBroadcastsConfigDisabled mobileNetworksConfigDisabled tetheringConfigDisabled
wifiConfigDisabled dataRoamingDisabled shareLocationDisabled
smsDisabled usbFileTransferDisabled autoTimeRequired
mountPhysicalMediaDisabled outgoingCallsDisabled setWallpaperDisabled
unmuteMicrophoneDisabled

政策示例

// Applies to the work profile
"passwordRequirements": {
  "passwordMinimumLength": 6,
  "passwordQuality": "ALPHABETIC"
},
"applications": [{
  "defaultPermissionPolicy": "GRANT",
  "installType": "FORCE_INSTALLED",  // Auto-installs app in the work profile
  "packageName": "com.google.android.gm"
   },
  {
  "installType": "AVAILABLE",  // Adds app to the work profile's managed Play Store
  "packageName": "com.google.android.apps.docs"
}],

// Applies to the personal profile
"personalUsagePolicies": {
  "personalPlayStoreMode": "BLACKLIST",
  "personalApplicationPolicy": [{
     "packageName": "com.example.app",
     "installType": "BLOCKED"
  }],
  "maxDaysWithWorkOff": 3,
  "cameraDisabled": true,
  "screenCaptureDisabled": true
},

// Applies to the whole device.
"bluetoothDisabled": true,
"usbFileTransferDisabled": true

已知问题

在公司自有设备上,系统可能不会立即检索和更新个人使用政策(延迟时间不应超过 10 分钟);在此之前,系统会显示“未找到任何结果”屏幕。否则,在手机启动到个人使用政策加载并应用期间,用户可能会安装 Play 商店中的任何应用。

应用个人使用政策后,请等待十分钟,然后触发缓存更新(例如,通过选择应用),然后重新打开 Google Play 个人应用。这样,个人使用政策应该已正确应用。