diff --git a/src/com/fsck/k9/mail/K9MailLib.java b/src/com/fsck/k9/mail/K9MailLib.java index 04de4f387..38c4b10dd 100644 --- a/src/com/fsck/k9/mail/K9MailLib.java +++ b/src/com/fsck/k9/mail/K9MailLib.java @@ -1,12 +1,15 @@ package com.fsck.k9.mail; + public class K9MailLib { private static DebugStatus debugStatus = new DefaultDebugStatus(); - private K9MailLib() {} - public static final String LOG_TAG = "k9"; + private K9MailLib() { + } + + public static final String LOG_TAG = "k9"; public static final int PUSH_WAKE_LOCK_TIMEOUT = 60000; - public static final String IDENTITY_HEADER = "X-K9mail-Identity"; + public static final String IDENTITY_HEADER = "X-K9mail-Identity"; /** * Should K-9 log the conversation it has over the wire with @@ -42,18 +45,19 @@ public class K9MailLib { public static void setDebugSensitive(boolean b) { if (debugStatus instanceof WritableDebugStatus) { - ((WritableDebugStatus)debugStatus).setSensitive(b); + ((WritableDebugStatus) debugStatus).setSensitive(b); } } public static void setDebug(boolean b) { if (debugStatus instanceof WritableDebugStatus) { - ((WritableDebugStatus)debugStatus).setEnabled(b); + ((WritableDebugStatus) debugStatus).setEnabled(b); } } public static interface DebugStatus { boolean enabled(); + boolean debugSensitive(); } @@ -66,15 +70,32 @@ public class K9MailLib { private static interface WritableDebugStatus extends DebugStatus { void setEnabled(boolean enabled); + void setSensitive(boolean sensitive); } private static class DefaultDebugStatus implements WritableDebugStatus { private boolean enabled; private boolean sensitive; - @Override public boolean enabled() { return enabled; } - @Override public boolean debugSensitive() { return sensitive; } - @Override public void setEnabled(boolean enabled) { this.enabled = enabled; } - @Override public void setSensitive(boolean sensitive) { this.sensitive = sensitive; } + + @Override + public boolean enabled() { + return enabled; + } + + @Override + public boolean debugSensitive() { + return sensitive; + } + + @Override + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + @Override + public void setSensitive(boolean sensitive) { + this.sensitive = sensitive; + } } }