Skip to main content
jdermont
New Member
May 22, 2026
Question

DISALLOW_MODIFY_ACCOUNTS and setAccountManagementDisabled(true) still allows adding accounts by apps

  • May 22, 2026
  • 1 reply
  • 14 views

We are device owner app. We use DevicePolicyManager.addUserRestriction with UserManager.DISALLOW_MODIFY_ACCOUNTS and DevicePolicyManager.setAccountManagementDisabled(..., true) for all account types listed by AccountManager. In the settings the user can't add or delete accounts, or sign in to new account gmail. But the user can sign in i.e. in OneDrive, and when he does, the account appears in the settings. Is this alright by design? Or is there some other ways to block adding accounts to the system by other apps?

1 reply

Moombas
Level 4.4: KitKat
May 22, 2026

On my opinion it’s on design and would be needed this way.

Why?

Example from us: We don’t want any accounts created manually, so we block that entirely. BUT we provide some apps (managed play store) where you need to login for ex. O365 which needs to create accounts on the device ofc.

For the account restricition you can choose only:

  • No Accounts (we use that)
  • All accounts except Google
  • All accounts

None of that would fit our need as we would need to define what kind of accounts we allow otherwise very precisely which can be very app specific.

And in addition some apps like Outlook or so, you can limit the accounts which can login via managed app policy.