java.lang.Object | |
↳ | com.samsung.android.knox.accounts.ExchangeAccount |
Deprecated in API level 27
This class contains all the account information for a given email (EAS) account. Some configuration value has dependency on Microsoft Exchange ActiveSync protocol version.
API level 11 |
MDM 5.0 |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | SET_SMIME_CERTIFICATE_ALL | SMIME certificate mode by encryption and signing | |||||||||
int | SET_SMIME_CERTIFICATE_BY_ENCRYPTION | SMIME certificate mode by encryption | |||||||||
int | SET_SMIME_CERTIFICATE_BY_SIGNING | SMIME certificate mode by signing |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
acceptAllCertificates | true to accept all certificates sent by the server |
||||||||||
certificateAlias | Authentication certificate alias to be set upon account creation (optional; can be null ). |
||||||||||
certificateData | Certificate binary (optional can be null ) |
||||||||||
certificatePassword | Certificate password to extract information (optional; can be null ) |
||||||||||
certificateStorageName | Credential storage name where certificateAlias shall be stored (optional; can be null ). |
||||||||||
displayName | The display name of the account | ||||||||||
easDomain | Account domain | ||||||||||
easUser | The user of the account | ||||||||||
emailAddress | The email address corresponding to the account | ||||||||||
emailNotificationVibrateAlways | true to always vibrate on email notification |
||||||||||
isDefault | true to make this account the default |
||||||||||
isNotify | true to notify user on receiving new mail |
||||||||||
offPeak | Frequency to sync email during off-peak time Value -2 - Automatic push Value -1 - Never Value 5 - 5 minutes Value 10 - 10 minutes Value 15 - 15 minutes Value 30 - 30 minutes Value 60 - 1 hour Value 240 - 4 hours Value 720 - 12 hours | ||||||||||
peakDays | Peak days for sync schedule. | ||||||||||
peakEndTime | Peak end time in minutes. | ||||||||||
peakStartTime | Peak start time in minutes. | ||||||||||
periodCalendar | Number of previous days Calendar to sync Value 0 - All Value 4 - 2 weeks Value 5 - 1 month Value 6 - 3 months Value 7 - 6 months | ||||||||||
protocolVersion | Protocol version of Microsoft Exchange ActiveSync (EAS only) | ||||||||||
retrivalSize | Email retrieval size
Value 0 - Headers only
Value 1 - 0.5 KB
Value 2 - 1 KB
Value 3 - 2 KB
Value 4 - 5 KB
Value 5 - 10 KB
Value 6 - 20 KB
Value 7 - 50 KB
Value 8 - 100 KB
Value 9 - All NOTE: Some ActiveSync protocol versions with EAS 2003 do not support value 9. |
||||||||||
roamingSchedule | 0 - Manual 1 - Use sync settings | ||||||||||
senderName | User name for outgoing messages | ||||||||||
serverAddress | The server address corresponding to this account | ||||||||||
serverPassword | The server password corresponding to this account | ||||||||||
serverPathPrefix | The server path Prefix corresponding to this account | ||||||||||
signature | Signature to use with the account | ||||||||||
smimeCertificateMode | Set certificate mode when account creation time. | ||||||||||
smimeCertificatePassword | SMIME certificate password when account creation time | ||||||||||
smimeCertificatePath | SMIME certificate path when account creation time | ||||||||||
syncCalendar | syncCalendar = true , then account syncs calendar information
syncCalendar = false , then account does not sync calendar information |
||||||||||
syncContacts | syncContacts = true , then account syncs contacts information
syncContacts = false ,then account does not sync contacts information |
||||||||||
syncInterval | Frequency to sync email during peak time Value -2 - Automatic push, Value -1 - Never, Value 5 - 5 minutes, Value 10 - 10 minutes, Value 15 - 15 minutes Value 30 - 30 minutes, Value 60 - 1 hour, Value 60 - 1 hour, Value 240 - 4 hours, Value 720 - 12 hours | ||||||||||
syncLookback | Number of previous days to sync email Value 1 - 1 day, Value 2 - 3 days, Value 3 - 1 week, Value 4 - 2 weeks, Value 5 - 1 month | ||||||||||
useSSL | true to use Secure Sockets Layer (SSL) |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Struct to add a new Microsoft Exchange account with base parameters.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.os.Parcelable
|
SMIME certificate mode by encryption and signing
API level 11 |
MDM 5.0 |
SMIME certificate mode by encryption
API level 20 |
MDM 5.7 |
SMIME certificate mode by signing
API level 11 |
MDM 5.0 |
true
to accept all certificates sent by the server
API level 11 |
MDM 5.0 |
Authentication certificate alias to be set upon account creation (optional; can be null
).
If not empty, takes precedence over certificate data from certificateData
and
certificatePassword
.
If certificateStorageName
is null
, certificate
must be installed either in Client Certificate Manager (CCM) or
KEYSTORE_FOR_VPN_AND_APPS
keystore.
Please refer either to CCM APIs (KNOX Premium SDK) or
installCertificateToKeystore(String, byte[], String, String, int)
for further details on how to install a certificate to those keystores, respectively.
In case same alias is present on both keystores, the certificate at
CCM will be enforced, taking precedence over the one installed at VPN and APPS keystore.
API level 20 |
MDM 5.7 |
Certificate binary (optional can be null
)
API level 11 |
MDM 5.0 |
Certificate password to extract information (optional; can be null
)
API level 11 |
MDM 5.0 |
Credential storage name where certificateAlias
shall be stored (optional; can be null
).
In order to see how to install certificates to credential storage, please refer to Universal
Credential Manager (UCM) DEV guide.
Leave it as null
if certificate is installed either at Client Certificate Manager (CCM) or
KEYSTORE_FOR_VPN_AND_APPS
keystore.
API level 20 |
MDM 5.7 |
The display name of the account
API level 11 |
MDM 5.0 |
The email address corresponding to the account
API level 11 |
MDM 5.0 |
true
to always vibrate on email notification
API level 11 |
MDM 5.0 |
true
to make this account the default
API level 11 |
MDM 5.0 |
true
to notify user on receiving new mail
API level 11 |
MDM 5.0 |
Frequency to sync email during off-peak time Value -2 - Automatic push Value -1 - Never Value 5 - 5 minutes Value 10 - 10 minutes Value 15 - 15 minutes Value 30 - 30 minutes Value 60 - 1 hour Value 240 - 4 hours Value 720 - 12 hours
API level 11 |
MDM 5.0 |
Peak days for sync schedule. For example: 62 (0x3e) for Mon|Tue|Wed|Thu|Fri (0111110) 73 (0x49) for Sun|Wed|Sat (1001001)
API level 11 |
MDM 5.0 |
Peak end time in minutes. For example: 5PM 17hr x 60 = 1020 6PM 18hr x 60 = 1080
API level 11 |
MDM 5.0 |
Peak start time in minutes. For example: 8AM 8hr x 60 = 480 9AM 9hr x 60 = 540
API level 11 |
MDM 5.0 |
Number of previous days Calendar to sync Value 0 - All Value 4 - 2 weeks Value 5 - 1 month Value 6 - 3 months Value 7 - 6 months
API level 11 |
MDM 5.0 |
Protocol version of Microsoft Exchange ActiveSync (EAS only)
API level 11 |
MDM 5.0 |
Email retrieval size
Value 0 - Headers only
Value 1 - 0.5 KB
Value 2 - 1 KB
Value 3 - 2 KB
Value 4 - 5 KB
Value 5 - 10 KB
Value 6 - 20 KB
Value 7 - 50 KB
Value 8 - 100 KB
Value 9 - All
NOTE: Some ActiveSync protocol versions with EAS 2003 do not support value 9.
Please see
https://msdn.microsoft.com/en-us/library/gg675441(v=exchg.80).aspx for more details.
API level 11 |
MDM 5.0 |
0 - Manual 1 - Use sync settings
API level 11 |
MDM 5.0 |
User name for outgoing messages
API level 11 |
MDM 5.0 |
The server address corresponding to this account
API level 11 |
MDM 5.0 |
The server password corresponding to this account
API level 11 |
MDM 5.0 |
The server path Prefix corresponding to this account
API level 11 |
MDM 5.0 |
Signature to use with the account
API level 11 |
MDM 5.0 |
Set certificate mode when account creation time. Possible values are:
API level 20 |
MDM 5.7 |
SMIME certificate password when account creation time
API level 11 |
MDM 5.0 |
SMIME certificate path when account creation time
API level 11 |
MDM 5.0 |
syncCalendar = true
, then account syncs calendar information
syncCalendar = false
, then account does not sync calendar information
API level 11 |
MDM 5.0 |
syncContacts = true
, then account syncs contacts information
syncContacts = false
,then account does not sync contacts information
API level 11 |
MDM 5.0 |
Frequency to sync email during peak time Value -2 - Automatic push, Value -1 - Never, Value 5 - 5 minutes, Value 10 - 10 minutes, Value 15 - 15 minutes Value 30 - 30 minutes, Value 60 - 1 hour, Value 60 - 1 hour, Value 240 - 4 hours, Value 720 - 12 hours
API level 11 |
MDM 5.0 |
Number of previous days to sync email Value 1 - 1 day, Value 2 - 3 days, Value 3 - 1 week, Value 4 - 2 weeks, Value 5 - 1 month
API level 11 |
MDM 5.0 |
true
to use Secure Sockets Layer (SSL)
API level 11 |
MDM 5.0 |
Struct to add a new Microsoft Exchange account with base parameters.
emailAddress | Email address of the account |
---|---|
easUser | User name of the account |
easDomain | Domain name of the account |
serverAddress | Address of the server (e.g., "mail.xyz.com") |
serverPassword | Password of the account
NOTE : All other settings values are set to default. |
long accountId = -1; EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); ExchangeAccountPolicy exchangeAccountPolicy = edm.getExchangeAccountPolicy(); try { accountId = exchangeAccountPolicy.addNewAccount(new ExchangeAccount( "testeasid@easserver.com", "testeasid","easDomain", "easserver.com", "Password@123")); if(accountId >= 0){ Log.d(TAG,"Add a new exchange account with base parameters succeeded!"); // Administrator needs to call sendAccountsChangedBroadcast() API // to notify about the Microsoft Exchange account addition. exchangeAccountPolicy.sendAccountsChangedBroadcast(); }else{ Log.d(TAG," Add a new exchange account with base parameters failed."); } } catch(SecurityException e) { Log.w(TAG,"SecurityException: "+e); } |
long accountId = -1; // When you create container successfully, containerID will be returned via intent. // Use this containerID in below API. EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID); ExchangeAccountPolicy exchangeAccountPolicy = kcm.getExchangeAccountPolicy(); try { accountId = exchangeAccountPolicy.addNewAccount(new ExchangeAccount( "testeasid@easserver.com", "testeasid","easDomain", "easserver.com", "Password@123")); if(accountId >= 0){ Log.d(TAG,"Add a new exchange account with base parameters succeeded!"); // Administrator needs to call sendAccountsChangedBroadcast() API // to notify about the Microsoft Exchange account addition. exchangeAccountPolicy.sendAccountsChangedBroadcast(); }else{ Log.d(TAG," Add a new exchange account with base parameters failed."); } } catch(SecurityException e) { Log.w(TAG,"SecurityException: "+e); } |
User Scope |
API level 11 |
MDM 5.0 |