Deprecated
in API level 27
Class Overview
This class provides APIs to control email application-related settings.
Summary
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public Constructors
Public Methods
public
boolean
allowAccountAddition
(boolean allowed)
Deprecated
in API level 27
API to restrict user from adding any new email accounts.
Parameters
allowed
| true if user is allowed to add new email account, else
false . |
Returns
true
if administrator preference is saved, else false
.
Usage
Administrator can use this API to restrict user from adding any new email
accounts. The administrator can still add an account using add
new account API.
|
Permission
The use of this API requires the caller to have the
"com.samsung.android.knox.permission.KNOX_EMAIL" permission which has a
protection level of signature. |
public
boolean
allowEmailSettingsChange
(boolean allow, long accId)
Deprecated
in API level 27
API to allow or disallow user from changing an Email account settings.
Parameters
allow
| true to allow changing setting of a Email account, false to disallow. |
accId
| The Email account id to change setting of a Email account. |
Returns
true
if success else false
Usage
An administrator can use this API to allow or disallow user from changing settings of a Email account. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
EmailPolicy emailPolicy = edm.getEmailPolicy();
long accId = 1;
try {
// disallow changing settings of a Email account
emailPolicy.allowEmailSettingsChange(false,accId);
}
} catch (SecurityException e) {
Log.w(TAG,"SecurityException: " + e);
}
|
For Container:
// 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);
EmailPolicy emailPolicy = kcm.getEmailPolicy();
long accId = 1;
try {
// disallow changing settings of a Email account
emailPolicy.allowEmailSettingsChange(false,accId);
}
} catch (SecurityException e) {
Log.w(TAG,"SecurityException: " + e);
}
|
Permission
The use of this API requires the caller to have the
"com.samsung.android.knox.permission.KNOX_EMAIL" permission which has a
protection level of signature. |
public
boolean
getAllowEmailForwarding
(String emailAddress)
Deprecated
in API level 27
API to query whether the native email application is allowed to show an option
to forward emails using another email account.
Parameters
emailAddress
| The email address of the account that can be used
for forwarding. |
Returns
true
on email forwarding allowed, else false
.
Usage
If the email application is configured with more than one email
account, the application provides the user with an option to choose an
account to use for forwarding. For instance, a user has
configured two email accounts, E1 and E2, and receives
an email on E1 account. The email application provides the user an option
to forward from either E1 or E2. An administrator can use
this API to check whether the email forwarding option is allowed
for a particular account. Please note that Microsoft Exchange ActiveSync email
forwarding through other account functionality may be restricted
in devices for which Verizon is the carrier.
|
public
boolean
getAllowHtmlEmail
(String emailAddress)
Deprecated
in API level 27
API to query whether the native email application is allowed to use
HTML format to display emails.
Parameters
emailAddress
| The email address of the account. |
Returns
true
if HTML format display is allowed, else false
.
Usage
An administrator can use this API to query if email applications are configured to
use HTML format when displaying emails. The enterprise can take appropriate
actions based on enterprise policy depending on the setting.
|
public
boolean
isAccountAdditionAllowed
()
Deprecated
in API level 27
API to check if user is allowed to add email accounts.
Returns
true
if user is allowed to add email accounts.
Usage
An administrator can use this API to check if the user is allowed to add new
email accounts.
|
public
boolean
isEmailNotificationsEnabled
(long accId)
Deprecated
in API level 27
API to get enable notification of a Email account.
Parameters
accId
| The Email account id to get notification of a Email account. |
Returns
- notification of a Email account.
Usage
An administrator can use this API to get enable notification of a Email account. |
public
boolean
isEmailSettingsChangeAllowed
(long accId)
Deprecated
in API level 27
API to check whether Email account settings change is allowed or not.
Parameters
accId
| The Email account id to get changing setting of a Email account. |
Returns
true
if allowed else false
.
public
boolean
setAllowEmailForwarding
(String emailAddress, boolean allow)
Deprecated
in API level 27
API to prevent the forwarding of emails received by a given email address.
Parameters
emailAddress
| the email address of the account from which
forwarding is allowed or not allowed. |
allow
| true to allow email forwarding option, false to disallow
email forwarding option. |
Returns
true
if email forwarding is successfully allowed/disallowed, else
false
.
Usage
If the native email application is configured with more than one
email account, the email application provides the user with an
option to choose an account to use for forwarding. For instance,
an user has configured two email accounts, E1 and E2, and receives
an email on account E1. The native email application provides the
user an option to forward from either E1 or E2. An administrator
can use this API to turn off the email forwarding option for a
specific account (ex. E1) so that emails cannot be forwarded
using that account (E1) from other accounts. This policy works only
with the native Android email application. Note that Microsoft
Exchange ActiveSync email forwarding through other account
functionality may be restricted in devices for which Verizon is the
carrier.
|
Permission
The use of this API requires the caller to have the
"com.samsung.android.knox.permission.KNOX_EMAIL" permission which has a
protection level of signature. |
public
boolean
setAllowHtmlEmail
(String emailAddress, boolean allow)
Deprecated
in API level 27
API to set whether the native email application is allowed to use HTML format
for emails.
Parameters
emailAddress
| the email address of the account for which
HTML format should be configured. |
allow
| true to allow HTML format, false to disallow
HTML format. |
Returns
true
if HTML format display is successfully enabled or disabled, else
false
.
Usage
An administrator can use this API to allow or disallow the native email application
using HTML format when displaying emails. This policy works only Microsoft Exchange ActiveSync Account.
|
Permission
The use of this API requires the caller to have the
"com.samsung.android.knox.permission.KNOX_EMAIL" permission which has a
protection level of signature. |
public
boolean
setEmailNotificationsState
(boolean enable, long accId)
Deprecated
in API level 27
API to set enable or disable notification of a Email account.
Parameters
enable
| value set enable notification of a Email account. |
accId
| The Email account id to change notification of a Email account. |
Usage
An administrator can use this API to set enable or disable notification of a Email account. |
Permission
The use of this API requires the caller to have the
"com.samsung.android.knox.permission.KNOX_EMAIL" permission which has a
protection level of signature. |