emailAccountPolicy.getAllEmailAccounts() returns null
I am using the KNOX Standard SDK to retrieve all email accounts and delete a specific one from the list. I have followed the tutorial to activate the license and my app does activate (I checked via the EnterpriseLicenseManager.ACTION_LICENSE_STATUS lntent). But for some reason the emailAccountPolicy.getAllEmailAccounts() produces null even though there are email accounts on the device.
Here is the code I used with the KNOX APIs
EnterpriseDeviceManager edm = (EnterpriseDeviceManager) getSystemService(EnterpriseDeviceManager.ENTERPRISE_POLICY_SERVICE);
EmailAccountPolicy emailAccountPolicy = edm.getEmailAccountPolicy();
Account accounts = emailAccountPolicy.getAllEmailAccounts();
I was able to retrieve the accounts via the native Android API. here is the code I used
AccountManager accMgr = AccountManager.get(CTMobileApplication.getContext()); Account accounts = accMgr.getAccounts();
- Retrieve EmailAcount infomation from device
- Phone(Dialer)Application is not getting launch from custom Kiosk Lock
- Problem when trying to activate ELM license
- Is it possible to disable access to the recovery mode for an android device using Knox
- Unable to clear data after disabling admin removal
- Is it standard behavior that changes are reverted when device admin is removed? Is there any way to change this behavior?