Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +26 −19 Original line number Diff line number Diff line Loading @@ -15413,31 +15413,35 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } } boolean compatible = !hasIncompatibleAccounts(am, accounts); if (compatible) { Slogf.w(LOG_TAG, "All accounts are compatible"); } else { Slogf.e(LOG_TAG, "Found incompatible accounts"); } return !compatible; }); } private boolean hasIncompatibleAccounts(AccountManager am, Account[] accounts) { // TODO(b/244284408): Add test final String[] feature_allow = { DevicePolicyManager.ACCOUNT_FEATURE_DEVICE_OR_PROFILE_OWNER_ALLOWED }; final String[] feature_disallow = { DevicePolicyManager.ACCOUNT_FEATURE_DEVICE_OR_PROFILE_OWNER_DISALLOWED }; boolean compatible = true; for (Account account : accounts) { if (hasAccountFeatures(am, account, feature_disallow)) { Slogf.e(LOG_TAG, "%s has %s", account, feature_disallow[0]); compatible = false; break; return true; } if (!hasAccountFeatures(am, account, feature_allow)) { Slogf.e(LOG_TAG, "%s doesn't have %s", account, feature_allow[0]); compatible = false; break; } return true; } if (compatible) { Slogf.w(LOG_TAG, "All accounts are compatible"); } else { Slogf.e(LOG_TAG, "Found incompatible accounts"); } return !compatible; }); return false; } private boolean hasAccountFeatures(AccountManager am, Account account, String[] features) { Loading Loading @@ -18703,7 +18707,10 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } AccountManager am = AccountManager.get(mContext); Account[] accounts = am.getAccounts(); return accounts.length == 0; if (accounts.length == 0) { return true; } return !hasIncompatibleAccounts(am, accounts); } private void setBypassDevicePolicyManagementRoleQualificationStateInternal( Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +26 −19 Original line number Diff line number Diff line Loading @@ -15413,31 +15413,35 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } } boolean compatible = !hasIncompatibleAccounts(am, accounts); if (compatible) { Slogf.w(LOG_TAG, "All accounts are compatible"); } else { Slogf.e(LOG_TAG, "Found incompatible accounts"); } return !compatible; }); } private boolean hasIncompatibleAccounts(AccountManager am, Account[] accounts) { // TODO(b/244284408): Add test final String[] feature_allow = { DevicePolicyManager.ACCOUNT_FEATURE_DEVICE_OR_PROFILE_OWNER_ALLOWED }; final String[] feature_disallow = { DevicePolicyManager.ACCOUNT_FEATURE_DEVICE_OR_PROFILE_OWNER_DISALLOWED }; boolean compatible = true; for (Account account : accounts) { if (hasAccountFeatures(am, account, feature_disallow)) { Slogf.e(LOG_TAG, "%s has %s", account, feature_disallow[0]); compatible = false; break; return true; } if (!hasAccountFeatures(am, account, feature_allow)) { Slogf.e(LOG_TAG, "%s doesn't have %s", account, feature_allow[0]); compatible = false; break; } return true; } if (compatible) { Slogf.w(LOG_TAG, "All accounts are compatible"); } else { Slogf.e(LOG_TAG, "Found incompatible accounts"); } return !compatible; }); return false; } private boolean hasAccountFeatures(AccountManager am, Account account, String[] features) { Loading Loading @@ -18703,7 +18707,10 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } AccountManager am = AccountManager.get(mContext); Account[] accounts = am.getAccounts(); return accounts.length == 0; if (accounts.length == 0) { return true; } return !hasIncompatibleAccounts(am, accounts); } private void setBypassDevicePolicyManagementRoleQualificationStateInternal(