Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 021b24c9 authored by cketti's avatar cketti Committed by Vincent Breitmoser
Browse files

Remove conditional logging from call sites

parent eb618290
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -571,20 +571,21 @@ public class K9 extends Application {
                intent.putExtra(K9.Intents.EmailReceived.EXTRA_SUBJECT, message.getSubject());
                intent.putExtra(K9.Intents.EmailReceived.EXTRA_FROM_SELF, account.isAnIdentity(message.getFrom()));
                K9.this.sendBroadcast(intent);
                if (K9.DEBUG)

                Timber.d("Broadcasted: action=%s account=%s folder=%s message uid=%s",
                            action, account.getDescription(), folder, message.getUid());
                        action,
                        account.getDescription(),
                        folder,
                        message.getUid());
            }

            private void updateUnreadWidget() {
                try {
                    UnreadWidgetProvider.updateUnreadCount(K9.this);
                } catch (Exception e) {
                    if (K9.DEBUG) {
                    Timber.e(e, "Error while updating unread widget(s)");
                }
            }
            }

            private void updateMailListWidget() {
                try {
@@ -592,7 +593,7 @@ public class K9 extends Application {
                } catch (RuntimeException e) {
                    if (BuildConfig.DEBUG) {
                        throw e;
                    } else if (K9.DEBUG) {
                    } else {
                        Timber.e(e, "Error while updating message list widget");
                    }
                }
@@ -802,9 +803,8 @@ public class K9 extends Application {
    protected void notifyObservers() {
        synchronized (observers) {
            for (final ApplicationAware aware : observers) {
                if (K9.DEBUG) {
                Timber.v("Initializing observer: %s", aware);
                }

                try {
                    aware.initializeComponent(this);
                } catch (Exception e) {
+11 −21
Original line number Diff line number Diff line
@@ -792,9 +792,7 @@ public class MessageCompose extends K9Activity implements OnClickListener,

    private void onAccountChosen(Account account, Identity identity) {
        if (!this.account.equals(account)) {
            if (K9.DEBUG) {
            Timber.v("Switching account from %s to %s", this.account, account);
            }

            // on draft edit, make sure we don't keep previous message UID
            if (action == Action.EDIT_DRAFT) {
@@ -812,15 +810,12 @@ public class MessageCompose extends K9Activity implements OnClickListener,
                // actual account switch
                this.account = account;

                if (K9.DEBUG) {
                Timber.v("Account switch, saving new draft in new account");
                }
                checkToSaveDraftImplicitly();

                if (previousDraftId != INVALID_DRAFT_ID) {
                    if (K9.DEBUG) {
                    Timber.v("Account switch, deleting draft from previous account: %d", previousDraftId);
                    }

                    MessagingController.getInstance(getApplication()).deleteDraft(previousAccount,
                            previousDraftId);
                }
@@ -1199,10 +1194,8 @@ public class MessageCompose extends K9Activity implements OnClickListener,
            }

        } else {
            if (K9.DEBUG) {
            Timber.d("could not get Message-ID.");
        }
        }

        // Quote the message and setup the UI.
        quotedMessagePresenter.initFromReplyToMessage(messageViewInfo, action);
@@ -1235,10 +1228,8 @@ public class MessageCompose extends K9Activity implements OnClickListener,
            repliedToMessageId = message.getMessageId();
            referencedMessageIds = repliedToMessageId;
        } else {
            if (K9.DEBUG) {
            Timber.d("could not get Message-ID.");
        }
        }

        // Quote the message and setup the UI.
        quotedMessagePresenter.processMessageToForward(messageViewInfo);
@@ -1369,12 +1360,11 @@ public class MessageCompose extends K9Activity implements OnClickListener,
         **/
        private void updateReferencedMessage() {
            if (messageReference != null && messageReference.getFlag() != null) {
                if (K9.DEBUG) {
                Timber.d("Setting referenced message (%s, %s) flag to %s",
                        messageReference.getFolderName(),
                        messageReference.getUid(),
                        messageReference.getFlag());
                }

                final Account account = Preferences.getPreferences(context)
                        .getAccount(messageReference.getAccountUuid());
                final String folderName = messageReference.getFolderName();
+1 −2
Original line number Diff line number Diff line
@@ -757,7 +757,6 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
        // Swallow these events too to avoid the audible notification of a volume change
        if (K9.useVolumeKeysForListNavigationEnabled()) {
            if ((keyCode == KeyEvent.KEYCODE_VOLUME_UP) || (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)) {
                if (K9.DEBUG)
                Timber.v("Swallowed key up.");
                return true;
            }
+1 −3
Original line number Diff line number Diff line
@@ -58,9 +58,7 @@ public class AttachmentContentLoader extends AsyncTaskLoader<Attachment> {
            File file = File.createTempFile(FILENAME_PREFIX, null, context.getCacheDir());
            file.deleteOnExit();

            if (K9.DEBUG) {
            Timber.v("Saving attachment to %s", file.getAbsolutePath());
            }

            SafeContentResolver safeContentResolver = SafeContentResolverCompat.newInstance(context);
            InputStream in = safeContentResolver.openInputStream(sourceAttachment.uri);
+1 −3
Original line number Diff line number Diff line
@@ -53,9 +53,7 @@ public class TemporaryAttachmentStore {
        for (File file : files) {
            if (file.lastModified() < cutOffTime) {
                if (file.delete()) {
                    if (K9.DEBUG) {
                    Timber.d("Deleted from temporary attachment store: %s", file.getName());
                    }
                } else {
                    Timber.w("Couldn't delete from temporary attachment store: %s", file.getName());
                }
Loading