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

Commit 52f61659 authored by ByteHamster's avatar ByteHamster
Browse files

Using K9.DEVELOPER_MODE in more places

parent 243dd318
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2141,8 +2141,8 @@ public class MessagingController {

    @SuppressLint("NewApi") // used for debugging only
    public void debugClearMessagesLocally(final List<MessageReference> messages) {
        if (!BuildConfig.DEBUG) {
            throw new AssertionError("method must only be used in debug build!");
        if (!K9.DEVELOPER_MODE) {
            throw new AssertionError("method must only be used in developer mode!");
        }

        actOnMessagesGroupedByAccountAndFolder(messages, new MessageActor() {
+3 −2
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ import android.database.sqlite.SQLiteDatabase;
import androidx.annotation.VisibleForTesting;

import com.fsck.k9.Account;
import com.fsck.k9.K9;
import com.fsck.k9.core.BuildConfig;
import com.fsck.k9.controller.MessageReference;
import com.fsck.k9.mail.Address;
@@ -340,8 +341,8 @@ public class LocalMessage extends MimeMessage {
    }

    public void debugClearLocalData() throws MessagingException {
        if (!BuildConfig.DEBUG) {
            throw new AssertionError("method must only be used in debug build!");
        if (!K9.DEVELOPER_MODE) {
            throw new AssertionError("method must only be used in developer mode!");
        }

        try {
+2 −1
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ package com.fsck.k9.storage;

import android.database.sqlite.SQLiteDatabase;

import com.fsck.k9.K9;
import com.fsck.k9.core.BuildConfig;
import com.fsck.k9.mail.Folder;
import com.fsck.k9.mailstore.LockableDatabase.SchemaDefinition;
@@ -31,7 +32,7 @@ class StoreSchemaDefinition implements SchemaDefinition {
        try {
            upgradeDatabase(db);
        } catch (Exception e) {
            if (BuildConfig.DEBUG) {
            if (K9.DEVELOPER_MODE) {
                throw new Error("Exception while upgrading database", e);
            }

+1 −1
Original line number Diff line number Diff line
@@ -1136,7 +1136,7 @@ public class MessageListFragment extends Fragment implements OnItemClickListener
        }

        getActivity().getMenuInflater().inflate(R.menu.message_list_item_context, menu);
        menu.findItem(R.id.debug_delete_locally).setVisible(BuildConfig.DEBUG);
        menu.findItem(R.id.debug_delete_locally).setVisible(K9.DEVELOPER_MODE);

        contextMenuUniqueId = cursor.getLong(uniqueIdColumn);
        Account account = getAccountFromCursor(cursor);