我有幾個設備通過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