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();
- API Question
- Container account blacklist and whitelist
- com.sec.enterprise.knox.permission.CUSTOM_SETTING n Error:: java.lang.SecurityException: No active admin owned by uid 10163
- getting SecurityException: Admin does not have android.permission.sec.MDM_SECURITY OR com.samsung.android.knox.permission.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?