1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Reformat according to style

This commit is contained in:
Jan Berkel 2014-12-19 09:48:02 +01:00
parent 4b0d016bb7
commit 98c1935c85

View File

@ -1,12 +1,15 @@
package com.fsck.k9.mail; package com.fsck.k9.mail;
public class K9MailLib { public class K9MailLib {
private static DebugStatus debugStatus = new DefaultDebugStatus(); 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 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 * 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) { public static void setDebugSensitive(boolean b) {
if (debugStatus instanceof WritableDebugStatus) { if (debugStatus instanceof WritableDebugStatus) {
((WritableDebugStatus)debugStatus).setSensitive(b); ((WritableDebugStatus) debugStatus).setSensitive(b);
} }
} }
public static void setDebug(boolean b) { public static void setDebug(boolean b) {
if (debugStatus instanceof WritableDebugStatus) { if (debugStatus instanceof WritableDebugStatus) {
((WritableDebugStatus)debugStatus).setEnabled(b); ((WritableDebugStatus) debugStatus).setEnabled(b);
} }
} }
public static interface DebugStatus { public static interface DebugStatus {
boolean enabled(); boolean enabled();
boolean debugSensitive(); boolean debugSensitive();
} }
@ -66,15 +70,32 @@ public class K9MailLib {
private static interface WritableDebugStatus extends DebugStatus { private static interface WritableDebugStatus extends DebugStatus {
void setEnabled(boolean enabled); void setEnabled(boolean enabled);
void setSensitive(boolean sensitive); void setSensitive(boolean sensitive);
} }
private static class DefaultDebugStatus implements WritableDebugStatus { private static class DefaultDebugStatus implements WritableDebugStatus {
private boolean enabled; private boolean enabled;
private boolean sensitive; private boolean sensitive;
@Override public boolean enabled() { return enabled; }
@Override public boolean debugSensitive() { return sensitive; } @Override
@Override public void setEnabled(boolean enabled) { this.enabled = enabled; } public boolean enabled() {
@Override public void setSensitive(boolean sensitive) { this.sensitive = sensitive; } 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;
}
} }
} }