1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-12 20:45:04 -05:00

Rework handling of certificate errors while pushing

Eliminate import of MessagingController in ImapStore.
This commit is contained in:
Joe Steele 2014-03-06 17:30:15 -05:00
parent a7898fa2eb
commit e475e51731
3 changed files with 3 additions and 4 deletions

View File

@ -2628,7 +2628,7 @@ public class MessagingController implements Runnable {
}
}
public static void notifyUserIfCertificateProblem(Context context, Exception e,
void notifyUserIfCertificateProblem(Context context, Exception e,
Account account, boolean incoming) {
if (!(e instanceof CertificateValidationException)) {
return;
@ -5044,7 +5044,7 @@ public class MessagingController implements Runnable {
* @param ringAndVibrate
* {@code true}, if ringtone/vibration are allowed. {@code false}, otherwise.
*/
private static void configureNotification(NotificationCompat.Builder builder, String ringtone,
private void configureNotification(NotificationCompat.Builder builder, String ringtone,
long[] vibrationPattern, Integer ledColor, int ledSpeed, boolean ringAndVibrate) {
// if it's quiet time, then we shouldn't be ringing, buzzing or flashing

View File

@ -77,6 +77,7 @@ public class MessagingControllerPushReceiver implements PushReceiver {
public void pushError(String errorMessage, Exception e) {
String errMess = errorMessage;
controller.notifyUserIfCertificateProblem(mApplication, e, account, true);
if (errMess == null && e != null) {
errMess = e.getMessage();
}

View File

@ -67,7 +67,6 @@ import com.fsck.k9.Account;
import com.fsck.k9.K9;
import com.fsck.k9.R;
import com.fsck.k9.controller.MessageRetrievalListener;
import com.fsck.k9.controller.MessagingController;
import com.fsck.k9.helper.StringUtils;
import com.fsck.k9.helper.Utility;
import com.fsck.k9.helper.power.TracingPowerManager;
@ -3133,7 +3132,6 @@ public class ImapStore extends Store {
if (stop.get()) {
Log.i(K9.LOG_TAG, "Got exception while idling, but stop is set for " + getLogId());
} else {
MessagingController.notifyUserIfCertificateProblem(K9.app, e, getAccount(), true);
receiver.pushError("Push error for " + getName(), e);
Log.e(K9.LOG_TAG, "Got exception while idling for " + getLogId(), e);
int delayTimeInt = delayTime.get();