本文整理汇总了Java中com.fsck.k9.activity.setup.AccountSetupCheckSettings.CheckDirection.INCOMING属性的典型用法代码示例。如果您正苦于以下问题:Java CheckDirection.INCOMING属性的具体用法?Java CheckDirection.INCOMING怎么用?Java CheckDirection.INCOMING使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.fsck.k9.activity.setup.AccountSetupCheckSettings.CheckDirection
的用法示例。
在下文中一共展示了CheckDirection.INCOMING属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteCertificate
/**
* Examine the existing settings for an account. If the old host/port is different from the
* new host/port, then try and delete any (possibly non-existent) certificate stored for the
* old host/port.
*/
public void deleteCertificate(String newHost, int newPort, CheckDirection direction) {
Uri uri;
if (direction == CheckDirection.INCOMING) {
uri = Uri.parse(getStoreUri());
} else {
uri = Uri.parse(getTransportUri());
}
String oldHost = uri.getHost();
int oldPort = uri.getPort();
if (oldPort == -1) {
// This occurs when a new account is created
return;
}
if (!newHost.equals(oldHost) || newPort != oldPort) {
LocalKeyStore localKeyStore = LocalKeyStore.getInstance();
localKeyStore.deleteCertificate(oldHost, oldPort);
}
}
示例2: addCertificate
/**
* Add a new certificate for the incoming or outgoing server to the local key store.
*/
public void addCertificate(CheckDirection direction, X509Certificate certificate) throws CertificateException {
Uri uri;
if (direction == CheckDirection.INCOMING) {
uri = Uri.parse(getStoreUri());
} else {
uri = Uri.parse(getTransportUri());
}
LocalKeyStore localKeyStore = LocalKeyStore.getInstance();
localKeyStore.addCertificate(uri.getHost(), uri.getPort(), certificate);
}
示例3: clearCertificateErrorNotifications
public void clearCertificateErrorNotifications(Account account, CheckDirection direction) {
boolean incoming = (direction == CheckDirection.INCOMING);
notificationController.clearCertificateErrorNotifications(account, incoming);
}