智能客服
你问我答,随时在线为你解决问题
Class Info |
|---|
public class DeviceEmailManager 邮箱相关的管理类。 |
Constructor Name |
|---|
EmailAccount(String emailAddress, String inComingProtocol, String inComingServerAddress, int inComingServerPort, String inComingServerLogin, String inComingServerPassword, String outGoingProtocol, String outGoingServerAddress, int outGoingServerPort, String outGoingServerLogin, String outGoingServerPassword) EmailAccount构造方法。 |
EmailAccount(String emailAddress, String inComingProtocol, String inComingServerAddress, int inComingServerPort, String inComingServerLogin, String inComingServerPassword, boolean inComingServerUseSSL, boolean inComingServerUseTLS, boolean inComingServerAcceptAllCertificates, String inComingPathPrefix, String outGoingProtocol, String outGoingServerAddress, int outGoingServerPort, String outGoingServerLogin, String outGoingServerPassword, boolean outGoingServerUseSSL, boolean outGoingServerUseTLS, boolean outGoingServerAcceptAllCertificates, String outGoingPathPrefix, String senderName, String signature, boolean isDefault) EmailAccount构造方法。 |
ExchangeAccount(String emailAddress, String easUser, String easDomain, String serverAddress, String serverPassword) ExchangeAccount构造方法。 |
ExchangeAccount(String displayName, String emailAddress, String easUser, String easDomain, int syncLookback, int syncInterval, boolean isDefault, String senderName, String protocolVersion, String signature, String serverAddress, boolean useSSL,boolean useTLS, boolean acceptAllCertificates, String serverPassword, String serverPathPrefix, int calendarPeriod, boolean displayHtmlDisabled, boolean forwardEmailDisabled, boolean screenShotDisabled) ExchangeAccount构造方法。 |
Qualifier and Type | Method Name and Description |
|---|---|
boolean | setAccountDeletionDisabled(ComponentName admin, boolean isDisabled) 禁止删除邮箱帐户。 |
boolean | isAccountDeletionDisabled(ComponentName admin) 查询是否禁止删除邮箱帐户。 |
boolean | setAccountAdditionDisabled(ComponentName admin,boolean isDisabled) 禁止添加邮箱帐户。 |
boolean | isAccountAdditionDisabled(ComponentName admin) 查询添加邮箱帐户功能是否被禁用。 |
boolean | setPop3ImapDisabled(ComponentName admin,boolean isDisabled) 禁用 Pop3/Imap 协议。 |
boolean | isPop3ImapDisabled(ComponentName admin) 查询 Pop3/Imap 协议是否被禁用。 |
void | configEmailAccount(ComponentName admin, EmailAccount emailAccount) 添加 Email 账户或更新 Email 账户配置。 |
void | configExchangeAccount(ComponentName admin,ExchangeAccount exchangeAccount) 添加Exchange账户或更新Exchange账户配置。 |
boolean | setEmailForwardingDisabled(ComponentName admin, String emailAddress, boolean isDisabled) 禁止邮箱帐户转发。 |
boolean | setExceptionListForAccountAddition(ComponentName admin, boolean isDisabled, ArrayList<String> list) 禁止/允许添加账户设置例外名单。 |
ArrayList<String> | getAccountsTrustListDisablingAddition(ComponentName admin) 获取禁止添加账户设置白名单。 |
ArrayList<String> | getAccountsWhiteListDisablingAddition(ComponentName admin) EMUI 11.0.0该方法已废弃,请使用ArrayList<String> getAccountsTrustListDisablingAddition(ComponentName admin)。 |
ArrayList<String> | getAccountsBlockListAllowingAddition(ComponentName admin) 获取允许添加账户设置的黑名单。 |
ArrayList<String> | getAccountsBlackListAllowingAddition(ComponentName admin) EMUI 11.0.0该方法已废弃,请使用ArrayList<String> getAccountsBlockListAllowingAddition(ComponentName admin)。 |
boolean | isAccountAdditionDisabled(ComponentName admin, String emailAddress) 查询邮箱地址为emailAddress的帐户添加功能是否被禁用。 |
boolean | setExceptionListForAccountDeletion(ComponentName admin, boolean isDisabled, ArrayList<String> list) 禁止/允许删除账户设置例外名单。 |
ArrayList<String> | getAccountsTrustListDisablingDeletion(ComponentName admin) 获取禁止删除账户设置的白名单。 |
ArrayList<String> | getAccountsWhiteListDisablingDeletion(ComponentName admin) EMUI 11.0.0该方法已废弃,请使用ArrayList<String> getAccountsTrustListDisablingDeletion(ComponentName admin)。 |
ArrayList<String> | getAccountsBlockListAllowingDeletion(ComponentName admin) 获取允许删除账户设置的黑名单。 |
ArrayList<String> | getAccountsBlackListAllowingDeletion(ComponentName admin) EMUI 11.0.0该方法已废弃,请使用ArrayList<String> getAccountsBlockListAllowingDeletion(ComponentName admin)。 |
boolean | isAccountDeletionDisabled(ComponentName admin, String emailAddress) 查询邮箱地址为emailAddress的帐户删除功能是否已被禁用。 |
boolean | isAccountAddedByMDM(Context context, String emailAddress, int userId) 查询电子邮箱地址是否通过MDM应用添加。 |
boolean | setForceSMIMECertificateAlias(ComponentName admin, String emailAddress, String alias, int type) 设置电子邮箱证书别名。 |
boolean | isForceSMIMECertificateAlias(Context context, String emailAddress, String alias, int type) 查询是否对电子邮箱证书指定的别名。 |
boolean | setForceSMIMEMessages(ComponentName admin, String emailAddress, boolean isForced, int type) 设置对指定邮箱进行签名或者加密。 |
boolean | isForceSMIMEMessages(Context context, String emailAddress, int type) 查询是否对指定邮箱设置了签名或者加密。 |
boolean | setForceRequiredSMIMEAndCertificateAlias(ComponentName admin, String emailAddress, String alias, boolean isForced, int type) 对邮箱设置SMIME证书别名并且强制打开SMIME。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 5.1及以上或HarmonyOS 2.0及以上 |
Constructor |
|---|
public EmailAccount(String emailAddress, String inComingProtocol, String inComingServerAddress, int inComingServerPort, String inComingServerLogin, String inComingServerPassword, String outGoingProtocol, String outGoingServerAddress, int outGoingServerPort, String outGoingServerLogin, String outGoingServerPassword) 构造EmailAccount。 |
Parameters
Name | Description |
|---|---|
emailAddress | 电子邮件地址。 |
inComingProtocol | 接收设置协议:pop3/imap。 |
inComingServerAddress | 接收设置主机名,不能为空。 |
inComingServerPort | 接收设置端口,不能为空。 |
inComingServerLogin | 接收设置用户名,不能为空。 |
inComingServerPassword | 接收设置密码。 |
outGoingProtocol | 外发设置协议,不能为空。 |
outGoingServerAddress | 外发设置主机名。 |
outGoingServerPort | 外发设置端口。 |
outGoingServerLogin | 外发设置用户名。 |
outGoingServerPassword | 外发设置密码。 |
Throws
Name | Description |
|---|---|
IllegalArgumentException | 参数错误。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 5.1及以上或HarmonyOS 2.0及以上 |
Constructor |
|---|
public EmailAccount(String emailAddress, String inComingProtocol, String inComingServerAddress, int inComingServerPort, String inComingServerLogin, String inComingServerPassword, boolean inComingServerUseSSL, boolean inComingServerUseTLS, boolean inComingServerAcceptAllCertificates, String inComingPathPrefix, String outGoingProtocol, String outGoingServerAddress, int outGoingServerPort, String outGoingServerLogin, String outGoingServerPassword, boolean outGoingServerUseSSL, boolean outGoingServerUseTLS, boolean outGoingServerAcceptAllCertificates, String outGoingPathPrefix, String senderName, String signature, boolean isDefault 构造EmailAccount。 |
Parameters
Name | Description |
|---|---|
emailAddress | 电子邮件地址。 |
inComingProtocol | 接收设置协议:pop3/imap。 |
inComingServerAddress | 接收设置主机名,不能为空。 |
inComingServerPort | 接收设置端口,不能为空。 |
inComingServerLogin | 接收设置用户名,不能为空。 |
inComingServerPassword | 接收设置密码。 |
inComingServerUseSSL | 接收设置使用SSL。 |
inComingServerUseTLS | 接收设置使用TSL。 |
inComingServerAcceptAllCertificates | 接收设置使用所有证书。 |
inComingPathPrefix | 接收设置路径前缀。 |
outGoingProtocol | 外发设置协议,不能为空。 |
outGoingServerAddress | 外发设置主机名。 |
outGoingServerPort | 外发设置端口。 |
outGoingServerLogin | 外发设置用户名。 |
outGoingServerPassword | 外发设置密码。 |
outGoingServerUseSSL | 外发设置使用SSL。 |
outGoingServerUseTLS | 外发设置使用TSL。 |
outGoingServerAcceptAllCertificates | 外发设置接收所有证书。 |
outGoingPathPrefix | 外发设置路径前缀。 |
senderName | 发件人名称。 |
signature | 电子邮件签名。 |
isDefault | 设置为默认账户。 |
Throws
Name | Description |
|---|---|
IllegalArgumentException | 参数错误。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 5.1及以上或HarmonyOS 2.0及以上 |
Constructor |
|---|
public ExchangeAccount(String emailAddress, String easUser, String easDomain, String serverAddress, String serverPassword) 构造ExchangeAccount。 |
Parameters
Name | Description |
|---|---|
emailAddress | 电子邮件地址,不能为空。 |
easUser | 用户名。 |
easDomain | 域。 |
serverAddress | 服务器,不能为空。 |
serverPassword | 密码。 |
Throws
Name | Description |
|---|---|
IllegalArgumentException | 参数错误。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 5.1及以上或HarmonyOS 2.0及以上 |
Constructor |
|---|
public ExchangeAccount(String displayName, String emailAddress, String easUser, String easDomain, int syncLookback, int syncInterval, boolean isDefault, String senderName, String protocolVersion, String signature, String serverAddress, boolean useSSL,boolean useTLS, boolean acceptAllCertificates, String serverPassword, String serverPathPrefix, int calendarPeriod, boolean displayHtmlDisabled, boolean forwardEmailDisabled, boolean screenShotDisabled) 构造ExchangeAccount。 |
Parameters
Name↵ | Description↵ |
|---|---|
displayName | 账户名称。 |
emailAddress | 电子邮件地址,不能为空。 |
easUser | 用户名。 |
easDomain | 域。 |
syncLookback | 同步天数。
|
syncInterval | 同步周期。
|
isDefault | 设置为默认账户。 |
senderName | 发件人名称。 |
protocolVersion | 协议版本号。 |
signature | 电子邮件签名。 |
serverAddress | 服务器,不能为空。 |
useSSL | 使用SSL。 |
useTLS | 使用TSL。 |
acceptAllCertificates | 接受所有证书。 |
serverPassword | 密码。 |
serverPathPrefix | 路径前缀。 |
calendarPeriod | 同步日程。
|
displayHtmlDisabled | 禁止HTML格式。 |
forwardEmailDisabled | 禁止转发邮件。 |
screenShotDisabled | 禁止截屏。 |
Throws
Name | Description |
|---|---|
IllegalArgumentException | 参数错误。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 5.1及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean setAccountDeletionDisabled(ComponentName admin, boolean isDisabled) 禁止删除邮箱帐户。如果禁止删除邮箱帐户,用户不能删除华为邮箱内已登录的帐户。 注意:需要申请com.huawei.permission.sec.MDM_EMAIL权限。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,不能为null。 |
isDisabled |
|
Return
Type | Description |
|---|---|
boolean |
|
Throws
Name | Description |
|---|---|
SecurityException |
|
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 5.1及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean isAccountDeletionDisabled(ComponentName admin) 查询是否已禁止删除邮箱帐户。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,查询该应用配置的策略;参数为null时,获取所有应用设置的综合策略结果。 |
Return
Type | Description |
|---|---|
boolean |
|
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 5.1及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean setAccountAdditionDisabled (ComponentName admin,boolean isDisabled) 禁止添加邮箱帐户。如果禁止添加邮箱帐户,用户不能向华为邮箱中添加帐户。 注意:需要申请com.huawei.permission.sec.MDM_EMAIL权限。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,不能为null。 |
isDisabled |
|
Return
Type | Description |
|---|---|
boolean |
|
Throws
Name | Description |
|---|---|
SecurityException |
|
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 5.1及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean isAccountAdditionDisabled(ComponentName admin) 查询添加邮箱帐户功能是否已被禁用。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,查询该应用配置的策略;参数为null时,获取所有应用设置的综合策略结果。 |
Return
Type | Description |
|---|---|
boolean |
|
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 5.1及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean setPop3ImapDisabled(ComponentName admin,boolean isDisabled) 禁用 Pop3/Imap 协议。如果禁用 Pop3/Imap 协议,用户在华为邮箱内不能添加Pop3/Imap 协议的帐户,已登录的 Pop3/Imap 帐户也会被从设备中删除。 注意:需要申请com.huawei.permission.sec.MDM_EMAIL权限。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,不能为null。 |
isDisabled |
|
Return
Type | Description |
|---|---|
boolean |
|
Throws
Name | Description |
|---|---|
SecurityException |
|
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 5.1及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean isPop3ImapDisabled (ComponentName admin) 查询Pop3/Imap协议是否被禁用。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,查询该应用配置的策略;参数为null时,获取所有应用设置的综合策略结果。 |
Return
Type | Description |
|---|---|
boolean |
|
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 5.1及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public void configEmailAccount(ComponentName admin, EmailAccount emailAccount) 添加Email账户或更新Email账户配置。 注意:需要申请com.huawei.permission.sec.MDM_EMAIL权限。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,不能为null。 |
emailAccount | EmailAccount,不能为空。 |
Return
Type | Description |
|---|---|
void | - |
Throws
Name | Description |
|---|---|
IllegalArgumentException | 参数错误。 |
SecurityException |
|
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 5.1及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public void configExchangeAccount(ComponentName admin,ExchangeAccount exchangeAccount) 添加Exchange账户或更新Exchange账户配置。 注意:需要申请com.huawei.permission.sec.MDM_EMAIL权限。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,不能为null。 |
exchangeAccount | ExchangeAccount,不能为空。 |
Return
Type | Description |
|---|---|
void | - |
Throws
Name | Description |
|---|---|
IllegalArgumentException | 参数错误。 |
SecurityException |
|
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 8.0及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean setEmailForwardingDisabled(ComponentName admin, String emailAddress, boolean isDisabled) 禁止邮箱帐户转发。当邮件账户被禁止转发时:1.该账户不能作为转发的发件人;2.该账户回复邮件时,不能更改收件人及抄送密送配置。 注意:需要申请com.huawei.permission.sec.MDM_EMAIL权限。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,不能为null。 |
emailAddress | 被禁止转发的邮件地址。 |
isDisabled |
|
Return
Type | Description |
|---|---|
boolean |
|
Throws
Name | Description |
|---|---|
IllegalArgumentException | 参数错误。 |
SecurityException |
|
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 8.0及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean setExceptionListForAccountAddition(ComponentName admin, boolean isDisabled, ArrayList<String> list) 禁止/允许添加账户,设置例外名单。当禁止添加账户,设置白名单,白名单里账户可以添加;当允许添加账户,设置黑名单,黑名单里账户不允许添加。 注意:需要申请com.huawei.permission.sec.MDM_EMAIL权限。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,不能为null。 |
isDisabled |
|
list | 禁止/允许添加账户,要设置的例外名单列表。 |
Return
Type | Description |
|---|---|
boolean |
|
Throws
Name | Description |
|---|---|
SecurityException |
|
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 11.0或HarmonyOS 2.0及以上 |
Method |
|---|
public ArrayList<String> getAccountsTrustListDisablingAddition(ComponentName admin) 获取禁止添加账户设置白名单。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,查询该应用配置的策略;参数为null时,获取所有应用设置的综合策略结果。 |
Return
Type | Description |
|---|---|
ArrayList<String> | 禁止添加账户设置的白名单列表。 |
Throws
Name | Description |
|---|---|
SecurityException | 此APK未经设备管理激活。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 8.0~EMUI 10.1 |
Method |
|---|
public ArrayList<String> getAccountsWhiteListDisablingAddition (ComponentName admin) EMUI 11.0.0该方法废弃,请使用getAccountsTrustListDisablingAddition。 获取禁止添加账户设置白名单。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,查询该应用配置的策略;参数为null时,获取所有应用设置的综合策略结果。 |
Return
Type | Description |
|---|---|
ArrayList<String> | 禁止添加账户设置的白名单列表。 |
Throws
Name | Description |
|---|---|
SecurityException | 此APK未经设备管理激活。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 11.0或HarmonyOS 2.0及以上 |
Method |
|---|
public ArrayList<String> getAccountsBlockListAllowingAddition(ComponentName admin) 获取允许添加账户设置的黑名单。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,查询该应用配置的策略;参数为null时,获取所有应用设置的综合策略结果。 |
Return
Type | Description |
|---|---|
ArrayList<String> | 允许添加账户设置的黑名单列表。 |
Throws
Name | Description |
|---|---|
SecurityException | 此APK未经设备管理激活。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 8.0~EMUI 10.1 |
Method |
|---|
public ArrayList<String> getAccountsBlackListAllowingAddition (ComponentName admin) EMUI 11.0.0该方法废弃,请使用getAccountsBlockListAllowingAddition。 获取允许添加账户设置的黑名单。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,查询该应用配置的策略;参数为null时,获取所有应用设置的综合策略结果。 |
Return
Type | Description |
|---|---|
ArrayList<String> | 允许添加账户设置的黑名单列表。 |
Throws
Name | Description |
|---|---|
SecurityException | 此APK未经设备管理激活。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 8.0及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean isAccountAdditionDisabled(ComponentName admin, String emailAddress) 查询邮箱地址为emailAddress的帐户添加功能是否被禁用。 |
Parameters
Name | Description |
|---|---|
admin | 调用接口的组件名称,查询该应用配置的策略;参数为null时,获取所有应用设置的综合策略结果。 |
emailAddress | 邮箱地址。 |
Return
Type | Description |
|---|---|
boolean |
|
Throws
Name | Description |
|---|---|
SecurityException | 此APK未经设备管理激活。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 8.0及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean setExceptionListForAccountDeletion(ComponentName admin, boolean isDisabled, ArrayList<String> list) 允许/禁止删除账户,设置例外名单。当禁止删除账户,设置白名单,白名单里账户可以删除;当允许删除账户,设置黑名单,黑名单里账户不允许删除。 注意:需要申请com.huawei.permission.sec.MDM_EMAIL权限。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,不能为null。 |
isDisabled |
|
list | 允许/禁止删除账户,要设置的例外名单列表。 |
Return
Type | Description |
|---|---|
boolean |
|
Throws
Name | Description |
|---|---|
SecurityException |
|
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 11.0或HarmonyOS 2.0及以上 |
Method |
|---|
public ArrayList<String> getAccountsTrustListDisablingDeletion(ComponentName admin) 获取禁止删除账户设置白名单。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,查询该应用配置的策略;参数为null时,获取所有应用设置的综合策略结果。 |
Return
Type | Description |
|---|---|
ArrayList<String> | 禁止删除账户设置的白名单列表。 |
Throws
Name | Description |
|---|---|
SecurityException | 此APK未经设备管理激活。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 8.0~EMUI 10.1 |
Method |
|---|
public ArrayList<String> getAccountsWhiteListDisablingDeletion(ComponentName admin) EMUI 11.0.0该方法废弃,请使用getAccountsTrustListDisablingDeletion。 获取禁止删除账户设置白名单。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,查询该应用配置的策略;参数为null时,获取所有应用设置的综合策略结果。 |
Return
Type | Description |
|---|---|
ArrayList<String> | 禁止删除账户设置的白名单列表。 |
Throws
Name | Description |
SecurityException | 此APK未经设备管理激活。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 11.0或HarmonyOS 2.0及以上 |
Method |
|---|
public ArrayList<String> getAccountsBlockListAllowingDeletion(ComponentName admin) 获取允许删除账户设置的黑名单。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,查询该应用配置的策略;参数为null时,获取所有应用设置的综合策略结果。 |
Return
Type | Description |
|---|---|
ArrayList<String> | 允许删除账户设置的黑名单列表。 |
Throws
Name | Description |
|---|---|
SecurityException | 此APK未经设备管理激活。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 8.0~EMUI 10.1 |
Method |
|---|
public ArrayList<String> getAccountsBlackListAllowingDeletion(ComponentName admin) EMUI 11.0.0该方法废弃,请使用getAccountsBlockListAllowingDeletion。 获取允许删除账户设置的黑名单。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,查询该应用配置的策略;参数为null时,获取所有应用设置的综合策略结果。 |
Return
Type | Description |
|---|---|
ArrayList<String> | 允许删除账户设置的黑名单列表。 |
Throws
Name | Description |
|---|---|
SecurityException | 此APK未经设备管理激活。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 8.0及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean isAccountDeletionDisabled(ComponentName admin, String emailAddress) 查询邮箱地址为emailAddress的帐户删除功能是否已被禁用。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称,查询该应用配置的策略;参数为null时,获取所有应用设置的综合策略结果。 |
emailAddress | 邮箱地址。 |
Return
Type | Description |
|---|---|
boolean |
|
Throws
Name | Description |
|---|---|
SecurityException | 此APK未经设备管理激活。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 9.0及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean isAccountAddedByMDM(Context context, String emailAddress, int userId) 查询电子邮箱地址是否通过MDM应用添加。 |
Parameters
Name | Description |
|---|---|
context | 上下文。 |
emailAddress | 邮箱地址。 |
userId | 用户ID。 |
Return
Type | Description |
|---|---|
boolean |
|
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 9.0及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean setForceSMIMECertificateAlias(ComponentName admin, String emailAddress, String alias, int type) 设置电子邮箱证书别名。 注意:需要申请com.huawei.permission.sec.MDM_EMAIL权限。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口APK的组件名称,不能为null。 |
emailAddress | 邮箱地址。 |
alias | 证书别名。 |
type | 证书类别。
|
Return
Type | Description |
|---|---|
boolean |
|
Throws
Name | Description |
|---|---|
SecurityException |
|
IllegalArgumentException | 参数admin为null时。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 9.0及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean isForceSMIMECertificateAlias(Context context, String emailAddress, String alias, int type) 查询是否对电子邮箱证书指定的别名。 |
Parameters
Name | Description |
|---|---|
context | 上下文。 |
emailAddress | 邮箱地址。 |
alias | 证书别名。 |
type | 证书类别 1 :签名证书。 2 :加密证书。 |
Return
Type | Description |
|---|---|
boolean |
|
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 9.0及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean setForceSMIMEMessages(ComponentName admin, String emailAddress, boolean isForced, int type) 设置对指定邮箱进行签名或者加密。 注意:需要申请com.huawei.permission.sec.MDM_EMAIL权限。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口APK的组件名称,不能为null。 |
emailAddress | 邮箱地址。 |
isForced |
|
type | 证书类别。
|
Return
Type | Description |
|---|---|
boolean |
|
Throws
Name | Description |
|---|---|
SecurityException |
|
IllegalArgumentException | 参数admin为null时。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 9.0及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean isForceSMIMEMessages(Context context, String emailAddress, int type) 查询是否对指定邮箱设置了签名或者加密。 |
Parameters
Name | Description |
|---|---|
context | 上下文。 |
emailAddress | 邮箱地址。 |
type | 证书类别。
|
Return
Type | Description |
|---|---|
boolean |
|
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 9.0及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean setForceRequiredSMIMEAndCertificateAlias(ComponentName admin, String emailAddress, String alias, boolean isForced, int type) 对邮箱设置SMIME证书别名并且强制打开SMIME。 注意:需要申请com.huawei.permission.sec.MDM_EMAIL权限。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口APK的组件名称,不能为null。 |
emailAddress | 邮箱地址。 |
alias | 证书别名。 |
isForced |
|
type | 证书类别。
|
Return
Type | Description |
|---|---|
boolean |
|
Throws
Name | Description |
|---|---|
SecurityException |
|
IllegalArgumentException | 参数admin为null时。 |