我有几个设备通过NFC提供设备所有者权限,没有涉及EMM,所有策略都由我的DPC设置在供应期间下载。此时我不设置Google帐户。通过NFC的设备所有者应用程序/电话可以完全访问Play商店(而不是Play for Work)
手动添加Google帐户后,所有设备都可以访问Google Play Store工作应用(目前仅包含Google Apps应用),但不能访问常规Play商店。
有没有办法阻止设备访问Work Apps Play Store并授予他们完全访问权限?如果可能,我想不管理帐户,而只是做一些事情,例如不允许工厂重置和更改WiFi,电话,短信等等......
这些是我用DPC设置的策略,也许我是误解他们中的一些人做什么?
public static void setDefaultPolicies(Context context, boolean active) {
ComponentName componentName = DeviceAdminReceiver.getComponentName(context);
DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService(DEVICE_POLICY_SERVICE);
setUserRestriction(dpm, componentName, UserManager.DISALLOW_FACTORY_RESET, active);
setUserRestriction(dpm, componentName, UserManager.DISALLOW_ADD_USER, active);
setUserRestriction(dpm, componentName, UserManager.DISALLOW_REMOVE_USER, active);
setUserRestriction(dpm, componentName, UserManager.DISALLOW_MOUNT_PHYSICAL_MEDIA, active);
//setUserRestriction(dpm, componentName, UserManager.DISALLOW_ADJUST_VOLUME, active);
//no disabling of wifi and stuff.
setUserRestriction(dpm, componentName, UserManager.DISALLOW_CONFIG_WIFI, active);
setUserRestriction(dpm, componentName, UserManager.DISALLOW_NETWORK_RESET, active);
//setUserRestriction(dpm, componentName, UserManager.DISALLOW_);
setUserRestriction(dpm, componentName, UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES, active);
//no calls and sms.
setUserRestriction(dpm, componentName, UserManager.DISALLOW_SMS, active);
setUserRestriction(dpm, componentName, UserManager.DISALLOW_OUTGOING_CALLS, active);
// set System Update policy
if (active) {
dpm.setSystemUpdatePolicy(componentName,
SystemUpdatePolicy.createWindowedInstallPolicy(60, 120));
} else {
dpm.setSystemUpdatePolicy(componentName, null);
}
// set this Activity as a lock task package
// dpm.setLockTaskPackages(componentName,
// active ? new String[]{context.getPackageName()} : new String[]{});
IntentFilter intentFilter = new IntentFilter(Intent.ACTION_MAIN);
intentFilter.addCategory(Intent.CATEGORY_HOME);
intentFilter.addCategory(Intent.CATEGORY_DEFAULT);
if (active) {
// set app as home intent receiver so that it is started
// on reboot
dpm.addPersistentPreferredActivity(
componentName, intentFilter, new ComponentName(
context.getPackageName(), MainActivity.class.getName()));
} else {
dpm.clearPackagePersistentPreferredActivities(
componentName, context.getPackageName());
}
}
private static void setUserRestriction(DevicePolicyManager dpm, ComponentName componentName, String restriction, boolean disallow) {
if (disallow) {
dpm.addUserRestriction(componentName,
restriction);
} else {
dpm.clearUserRestriction(componentName,
restriction);
}
}
I know it's possible to grant users access to Play Store apps via the EMM Api,但是我不能使用EMM。
您说得对,我使用的是非托管G Suite帐户,但在拥有设备所有者的设备上登录显然会开始管理这种情况。您的第二个建议对我来说是一个很好的解决方案,另外我可以不使用G Suite帐户作为第三个解决方案。谢谢。 – Syzygy