diff --git a/app/src/main/java/eu/faircode/email/ActivityBase.java b/app/src/main/java/eu/faircode/email/ActivityBase.java index bc10d885a0..cfdabc92fe 100644 --- a/app/src/main/java/eu/faircode/email/ActivityBase.java +++ b/app/src/main/java/eu/faircode/email/ActivityBase.java @@ -116,7 +116,7 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc int before = Helper.getSize(outState); super.onSaveInstanceState(outState); int after = Helper.getSize(outState); - Log.i("Saved instance " + this + " size=" + before + "/" + after); + Log.d("Saved instance " + this + " size=" + before + "/" + after); Map crumb = new HashMap<>(); crumb.put("name", this.getClass().getName()); @@ -125,12 +125,12 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc Log.breadcrumb("onSaveInstanceState", crumb); for (String key : outState.keySet()) - Log.i("Saved " + this + " " + key + "=" + outState.get(key)); + Log.d("Saved " + this + " " + key + "=" + outState.get(key)); } @Override protected void onResume() { - Log.i("Resume " + this.getClass().getName()); + Log.d("Resume " + this.getClass().getName()); boolean contacts = hasPermission(Manifest.permission.READ_CONTACTS); if (!this.getClass().equals(ActivitySetup.class) && this.contacts != contacts) { @@ -145,7 +145,7 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc @Override protected void onPause() { - Log.i("Pause " + this.getClass().getName()); + Log.d("Pause " + this.getClass().getName()); super.onPause(); if (!this.getClass().equals(ActivityMain.class) && Helper.shouldAuthenticate(this)) @@ -154,13 +154,13 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc @Override public void onConfigurationChanged(Configuration newConfig) { - Log.i("Config " + this.getClass().getName()); + Log.d("Config " + this.getClass().getName()); super.onConfigurationChanged(newConfig); } @Override public void onUserInteraction() { - Log.i("User interaction"); + Log.d("User interaction"); if (!this.getClass().equals(ActivityMain.class) && Helper.shouldAuthenticate(this)) { finishAndRemoveTask(); @@ -172,7 +172,7 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc @Override protected void onUserLeaveHint() { - Log.i("User leaving"); + Log.d("User leaving"); } @Override @@ -255,13 +255,13 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc } void addBackPressedListener(final IBackPressedListener listener, LifecycleOwner owner) { - Log.i("Adding back listener=" + listener); + Log.d("Adding back listener=" + listener); backPressedListeners.add(listener); owner.getLifecycle().addObserver(new LifecycleObserver() { @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY) public void onDestroyed() { - Log.i("Removing back listener=" + listener); + Log.d("Removing back listener=" + listener); backPressedListeners.remove(listener); } }); diff --git a/app/src/main/java/eu/faircode/email/ActivityBilling.java b/app/src/main/java/eu/faircode/email/ActivityBilling.java index 423a1b67b7..738f607073 100644 --- a/app/src/main/java/eu/faircode/email/ActivityBilling.java +++ b/app/src/main/java/eu/faircode/email/ActivityBilling.java @@ -188,7 +188,7 @@ public class ActivityBilling extends ActivityBase implements PurchasesUpdatedLis } static boolean isPro(Context context) { - if (false && BuildConfig.DEBUG) + if (BuildConfig.DEBUG && false) return true; return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("pro", false); } diff --git a/app/src/main/java/eu/faircode/email/AdapterAccount.java b/app/src/main/java/eu/faircode/email/AdapterAccount.java index 8c4310948d..24fdc139e5 100644 --- a/app/src/main/java/eu/faircode/email/AdapterAccount.java +++ b/app/src/main/java/eu/faircode/email/AdapterAccount.java @@ -326,7 +326,7 @@ public class AdapterAccount extends RecyclerView.Adapter" + toPosition); + Log.d("Moved " + fromPosition + ">" + toPosition); } @Override public void onChanged(int position, int count, Object payload) { - Log.i("Changed @" + position + " #" + count); + Log.d("Changed @" + position + " #" + count); } }); diff.dispatchUpdatesTo(this); diff --git a/app/src/main/java/eu/faircode/email/AdapterAnswer.java b/app/src/main/java/eu/faircode/email/AdapterAnswer.java index fb65cf9c66..96b9e8f2b7 100644 --- a/app/src/main/java/eu/faircode/email/AdapterAnswer.java +++ b/app/src/main/java/eu/faircode/email/AdapterAnswer.java @@ -193,7 +193,7 @@ public class AdapterAnswer extends RecyclerView.Adapter" + toPosition); + Log.d("Moved " + fromPosition + ">" + toPosition); } @Override public void onChanged(int position, int count, Object payload) { - Log.i("Changed @" + position + " #" + count); + Log.d("Changed @" + position + " #" + count); } }); diff.dispatchUpdatesTo(this); diff --git a/app/src/main/java/eu/faircode/email/AdapterAttachment.java b/app/src/main/java/eu/faircode/email/AdapterAttachment.java index f640602879..3c47568eaa 100644 --- a/app/src/main/java/eu/faircode/email/AdapterAttachment.java +++ b/app/src/main/java/eu/faircode/email/AdapterAttachment.java @@ -309,7 +309,7 @@ public class AdapterAttachment extends RecyclerView.Adapter" + toPosition); + Log.d("Moved " + fromPosition + ">" + toPosition); } @Override public void onChanged(int position, int count, Object payload) { - Log.i("Changed @" + position + " #" + count); + Log.d("Changed @" + position + " #" + count); } }); diff.dispatchUpdatesTo(this); diff --git a/app/src/main/java/eu/faircode/email/AdapterCertificate.java b/app/src/main/java/eu/faircode/email/AdapterCertificate.java index f8522cea16..3c222a986e 100644 --- a/app/src/main/java/eu/faircode/email/AdapterCertificate.java +++ b/app/src/main/java/eu/faircode/email/AdapterCertificate.java @@ -163,22 +163,22 @@ public class AdapterCertificate extends RecyclerView.Adapter" + toPosition); + Log.d("Moved " + fromPosition + ">" + toPosition); } @Override public void onChanged(int position, int count, Object payload) { - Log.i("Changed @" + position + " #" + count); + Log.d("Changed @" + position + " #" + count); } }); diff.dispatchUpdatesTo(this); diff --git a/app/src/main/java/eu/faircode/email/AdapterContact.java b/app/src/main/java/eu/faircode/email/AdapterContact.java index e9720c93dd..8f34efcff8 100644 --- a/app/src/main/java/eu/faircode/email/AdapterContact.java +++ b/app/src/main/java/eu/faircode/email/AdapterContact.java @@ -307,7 +307,7 @@ public class AdapterContact extends RecyclerView.Adapter" + toPosition); + Log.d("Moved " + fromPosition + ">" + toPosition); } @Override public void onChanged(int position, int count, Object payload) { - Log.i("Changed @" + position + " #" + count); + Log.d("Changed @" + position + " #" + count); } }); diff.dispatchUpdatesTo(this); diff --git a/app/src/main/java/eu/faircode/email/AdapterFolder.java b/app/src/main/java/eu/faircode/email/AdapterFolder.java index 97dc1a7d3d..18e2f628a3 100644 --- a/app/src/main/java/eu/faircode/email/AdapterFolder.java +++ b/app/src/main/java/eu/faircode/email/AdapterFolder.java @@ -726,7 +726,7 @@ public class AdapterFolder extends RecyclerView.Adapter" + toPosition); + Log.d("Moved " + fromPosition + ">" + toPosition); } @Override public void onChanged(int position, int count, Object payload) { - Log.i("Changed @" + position + " #" + count); + Log.d("Changed @" + position + " #" + count); } }); diff.dispatchUpdatesTo(this); diff --git a/app/src/main/java/eu/faircode/email/AdapterIdentity.java b/app/src/main/java/eu/faircode/email/AdapterIdentity.java index a6116e4b0c..eee4aaede8 100644 --- a/app/src/main/java/eu/faircode/email/AdapterIdentity.java +++ b/app/src/main/java/eu/faircode/email/AdapterIdentity.java @@ -284,7 +284,7 @@ public class AdapterIdentity extends RecyclerView.Adapter" + toPosition); + Log.d("Moved " + fromPosition + ">" + toPosition); } @Override public void onChanged(int position, int count, Object payload) { - Log.i("Changed @" + position + " #" + count); + Log.d("Changed @" + position + " #" + count); } }); diff.dispatchUpdatesTo(this); diff --git a/app/src/main/java/eu/faircode/email/AdapterImage.java b/app/src/main/java/eu/faircode/email/AdapterImage.java index e2c1b7e843..03bccd3674 100644 --- a/app/src/main/java/eu/faircode/email/AdapterImage.java +++ b/app/src/main/java/eu/faircode/email/AdapterImage.java @@ -195,7 +195,7 @@ public class AdapterImage extends RecyclerView.Adapter owner.getLifecycle().addObserver(new LifecycleObserver() { @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY) public void onDestroyed() { - Log.i(AdapterImage.this + " parent destroyed"); + Log.d(AdapterImage.this + " parent destroyed"); AdapterImage.this.parentFragment = null; } }); @@ -218,22 +218,22 @@ public class AdapterImage extends RecyclerView.Adapter diff.dispatchUpdatesTo(new ListUpdateCallback() { @Override public void onInserted(int position, int count) { - Log.i("Inserted @" + position + " #" + count); + Log.d("Inserted @" + position + " #" + count); } @Override public void onRemoved(int position, int count) { - Log.i("Removed @" + position + " #" + count); + Log.d("Removed @" + position + " #" + count); } @Override public void onMoved(int fromPosition, int toPosition) { - Log.i("Moved " + fromPosition + ">" + toPosition); + Log.d("Moved " + fromPosition + ">" + toPosition); } @Override public void onChanged(int position, int count, Object payload) { - Log.i("Changed @" + position + " #" + count); + Log.d("Changed @" + position + " #" + count); } }); diff.dispatchUpdatesTo(this); diff --git a/app/src/main/java/eu/faircode/email/AdapterLog.java b/app/src/main/java/eu/faircode/email/AdapterLog.java index 742ee47baf..597af405cc 100644 --- a/app/src/main/java/eu/faircode/email/AdapterLog.java +++ b/app/src/main/java/eu/faircode/email/AdapterLog.java @@ -80,7 +80,7 @@ public class AdapterLog extends RecyclerView.Adapter { owner.getLifecycle().addObserver(new LifecycleObserver() { @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY) public void onDestroyed() { - Log.i(AdapterLog.this + " parent destroyed"); + Log.d(AdapterLog.this + " parent destroyed"); AdapterLog.this.parentFragment = null; } }); @@ -96,22 +96,22 @@ public class AdapterLog extends RecyclerView.Adapter { diff.dispatchUpdatesTo(new ListUpdateCallback() { @Override public void onInserted(int position, int count) { - Log.i("Inserted @" + position + " #" + count); + Log.d("Inserted @" + position + " #" + count); } @Override public void onRemoved(int position, int count) { - Log.i("Removed @" + position + " #" + count); + Log.d("Removed @" + position + " #" + count); } @Override public void onMoved(int fromPosition, int toPosition) { - Log.i("Moved " + fromPosition + ">" + toPosition); + Log.d("Moved " + fromPosition + ">" + toPosition); } @Override public void onChanged(int position, int count, Object payload) { - Log.i("Changed @" + position + " #" + count); + Log.d("Changed @" + position + " #" + count); } }); diff.dispatchUpdatesTo(this); diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index b0af3e0ff7..8c2f30ea70 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -3728,7 +3728,7 @@ public class AdapterMessage extends RecyclerView.Adapter" + toPosition); + Log.d("Moved " + fromPosition + ">" + toPosition); } @Override public void onChanged(int position, int count, Object payload) { - Log.i("Changed @" + position + " #" + count); + Log.d("Changed @" + position + " #" + count); } }); diff.dispatchUpdatesTo(this); diff --git a/app/src/main/java/eu/faircode/email/AdapterNavFolder.java b/app/src/main/java/eu/faircode/email/AdapterNavFolder.java index ea9f640361..6cc5fc4327 100644 --- a/app/src/main/java/eu/faircode/email/AdapterNavFolder.java +++ b/app/src/main/java/eu/faircode/email/AdapterNavFolder.java @@ -184,22 +184,22 @@ public class AdapterNavFolder extends RecyclerView.Adapter" + toPosition); + Log.d("Moved " + fromPosition + ">" + toPosition); } @Override public void onChanged(int position, int count, Object payload) { - Log.i("Changed @" + position + " #" + count); + Log.d("Changed @" + position + " #" + count); } }); diff.dispatchUpdatesTo(this); diff --git a/app/src/main/java/eu/faircode/email/AdapterNavMenu.java b/app/src/main/java/eu/faircode/email/AdapterNavMenu.java index ac24249147..b6643eb962 100644 --- a/app/src/main/java/eu/faircode/email/AdapterNavMenu.java +++ b/app/src/main/java/eu/faircode/email/AdapterNavMenu.java @@ -143,22 +143,22 @@ public class AdapterNavMenu extends RecyclerView.Adapter" + toPosition); + Log.d("Moved " + fromPosition + ">" + toPosition); } @Override public void onChanged(int position, int count, Object payload) { - Log.i("Changed @" + position + " #" + count); + Log.d("Changed @" + position + " #" + count); } }); diff.dispatchUpdatesTo(this); diff --git a/app/src/main/java/eu/faircode/email/AdapterNavUnified.java b/app/src/main/java/eu/faircode/email/AdapterNavUnified.java index fe247046a6..c4c11e16c7 100644 --- a/app/src/main/java/eu/faircode/email/AdapterNavUnified.java +++ b/app/src/main/java/eu/faircode/email/AdapterNavUnified.java @@ -152,22 +152,22 @@ public class AdapterNavUnified extends RecyclerView.Adapter" + toPosition); + Log.d("Moved " + fromPosition + ">" + toPosition); } @Override public void onChanged(int position, int count, Object payload) { - Log.i("Changed @" + position + " #" + count); + Log.d("Changed @" + position + " #" + count); } }); diff.dispatchUpdatesTo(this); diff --git a/app/src/main/java/eu/faircode/email/AdapterOperation.java b/app/src/main/java/eu/faircode/email/AdapterOperation.java index 94399a9f74..e8b33b6346 100644 --- a/app/src/main/java/eu/faircode/email/AdapterOperation.java +++ b/app/src/main/java/eu/faircode/email/AdapterOperation.java @@ -247,7 +247,7 @@ public class AdapterOperation extends RecyclerView.Adapter" + toPosition); + Log.d("Moved " + fromPosition + ">" + toPosition); } @Override public void onChanged(int position, int count, Object payload) { - Log.i("Changed @" + position + " #" + count); + Log.d("Changed @" + position + " #" + count); } }); diff.dispatchUpdatesTo(this); diff --git a/app/src/main/java/eu/faircode/email/AdapterOrder.java b/app/src/main/java/eu/faircode/email/AdapterOrder.java index d91a60c1aa..f6fcd25ebd 100644 --- a/app/src/main/java/eu/faircode/email/AdapterOrder.java +++ b/app/src/main/java/eu/faircode/email/AdapterOrder.java @@ -79,7 +79,7 @@ public class AdapterOrder extends RecyclerView.Adapter owner.getLifecycle().addObserver(new LifecycleObserver() { @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY) public void onDestroyed() { - Log.i(AdapterOrder.this + " parent destroyed"); + Log.d(AdapterOrder.this + " parent destroyed"); AdapterOrder.this.parentFragment = null; } }); @@ -98,22 +98,22 @@ public class AdapterOrder extends RecyclerView.Adapter diff.dispatchUpdatesTo(new ListUpdateCallback() { @Override public void onInserted(int position, int count) { - Log.i("Inserted @" + position + " #" + count); + Log.d("Inserted @" + position + " #" + count); } @Override public void onRemoved(int position, int count) { - Log.i("Removed @" + position + " #" + count); + Log.d("Removed @" + position + " #" + count); } @Override public void onMoved(int fromPosition, int toPosition) { - Log.i("Moved " + fromPosition + ">" + toPosition); + Log.d("Moved " + fromPosition + ">" + toPosition); } @Override public void onChanged(int position, int count, Object payload) { - Log.i("Changed @" + position + " #" + count); + Log.d("Changed @" + position + " #" + count); } }); diff.dispatchUpdatesTo(this); diff --git a/app/src/main/java/eu/faircode/email/AdapterRule.java b/app/src/main/java/eu/faircode/email/AdapterRule.java index 42aa14da1d..9622f9e354 100644 --- a/app/src/main/java/eu/faircode/email/AdapterRule.java +++ b/app/src/main/java/eu/faircode/email/AdapterRule.java @@ -380,7 +380,7 @@ public class AdapterRule extends RecyclerView.Adapter { owner.getLifecycle().addObserver(new LifecycleObserver() { @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY) public void onDestroyed() { - Log.i(AdapterRule.this + " parent destroyed"); + Log.d(AdapterRule.this + " parent destroyed"); AdapterRule.this.parentFragment = null; } }); @@ -396,22 +396,22 @@ public class AdapterRule extends RecyclerView.Adapter { diff.dispatchUpdatesTo(new ListUpdateCallback() { @Override public void onInserted(int position, int count) { - Log.i("Inserted @" + position + " #" + count); + Log.d("Inserted @" + position + " #" + count); } @Override public void onRemoved(int position, int count) { - Log.i("Removed @" + position + " #" + count); + Log.d("Removed @" + position + " #" + count); } @Override public void onMoved(int fromPosition, int toPosition) { - Log.i("Moved " + fromPosition + ">" + toPosition); + Log.d("Moved " + fromPosition + ">" + toPosition); } @Override public void onChanged(int position, int count, Object payload) { - Log.i("Changed @" + position + " #" + count); + Log.d("Changed @" + position + " #" + count); } }); diff.dispatchUpdatesTo(this); diff --git a/app/src/main/java/eu/faircode/email/AdapterRuleMatch.java b/app/src/main/java/eu/faircode/email/AdapterRuleMatch.java index a73ee360bb..a64dd5b4ea 100644 --- a/app/src/main/java/eu/faircode/email/AdapterRuleMatch.java +++ b/app/src/main/java/eu/faircode/email/AdapterRuleMatch.java @@ -87,7 +87,7 @@ public class AdapterRuleMatch extends RecyclerView.Adapter" + toPosition); + Log.d("Moved " + fromPosition + ">" + toPosition); } @Override public void onChanged(int position, int count, Object payload) { - Log.i("Changed @" + position + " #" + count); + Log.d("Changed @" + position + " #" + count); } }); diff.dispatchUpdatesTo(this); diff --git a/app/src/main/java/eu/faircode/email/ContentLoadingProgressBar.java b/app/src/main/java/eu/faircode/email/ContentLoadingProgressBar.java index bd6cfc0ae2..b1a5bd1817 100644 --- a/app/src/main/java/eu/faircode/email/ContentLoadingProgressBar.java +++ b/app/src/main/java/eu/faircode/email/ContentLoadingProgressBar.java @@ -42,7 +42,7 @@ public class ContentLoadingProgressBar extends ProgressBar { @Override public void setVisibility(int visibility) { this.visibility = visibility; - if (false && BuildConfig.DEBUG) { + if (BuildConfig.DEBUG && false) { super.setVisibility(visibility); return; } diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 86fb54bf4a..7eada2a23b 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -2302,8 +2302,8 @@ class Core { if (process) updateContactInfo(context, folder, message); - else if (BuildConfig.DEBUG) - Log.i(folder.name + " unchanged uid=" + uid); + else + Log.d(folder.name + " unchanged uid=" + uid); } List fkeywords = new ArrayList<>(Arrays.asList(folder.keywords)); diff --git a/app/src/main/java/eu/faircode/email/DB.java b/app/src/main/java/eu/faircode/email/DB.java index 2d041359a3..0e4fc8ba72 100644 --- a/app/src/main/java/eu/faircode/email/DB.java +++ b/app/src/main/java/eu/faircode/email/DB.java @@ -135,8 +135,7 @@ public abstract class DB extends RoomDatabase { EntityLog.TABLE_NAME) { @Override public void onInvalidated(@NonNull Set tables) { - if (BuildConfig.DEBUG) - Log.i("ROOM invalidated=" + TextUtils.join(",", tables)); + Log.d("ROOM invalidated=" + TextUtils.join(",", tables)); } }); } diff --git a/app/src/main/java/eu/faircode/email/FragmentBase.java b/app/src/main/java/eu/faircode/email/FragmentBase.java index 373581ca3c..8c13ebf3e3 100644 --- a/app/src/main/java/eu/faircode/email/FragmentBase.java +++ b/app/src/main/java/eu/faircode/email/FragmentBase.java @@ -40,7 +40,6 @@ import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatActivity; import androidx.documentfile.provider.DocumentFile; import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentManager; import androidx.lifecycle.Lifecycle; import androidx.localbroadcastmanager.content.LocalBroadcastManager; @@ -124,12 +123,12 @@ public class FragmentBase extends Fragment { @Override public void onSaveInstanceState(Bundle outState) { - Log.i("Save instance " + this); + Log.d("Save instance " + this); int before = Helper.getSize(outState); outState.putString("fair:subtitle", subtitle); super.onSaveInstanceState(outState); int after = Helper.getSize(outState); - Log.i("Saved instance " + this + " size=" + before + "/" + after); + Log.d("Saved instance " + this + " size=" + before + "/" + after); Map crumb = new HashMap<>(); crumb.put("name", this.getClass().getName()); @@ -142,7 +141,7 @@ public class FragmentBase extends Fragment { Log.breadcrumb("onSaveInstanceState", crumb); for (String key : outState.keySet()) - Log.i("Saved " + this + " " + key + "=" + outState.get(key)); + Log.d("Saved " + this + " " + key + "=" + outState.get(key)); } @Override @@ -155,19 +154,19 @@ public class FragmentBase extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - Log.i("Create view " + this); + Log.d("Create view " + this); return super.onCreateView(inflater, container, savedInstanceState); } @Override public void onActivityCreated(Bundle savedInstanceState) { - Log.i("Activity " + this + " saved=" + (savedInstanceState != null)); + Log.d("Activity " + this + " saved=" + (savedInstanceState != null)); super.onActivityCreated(savedInstanceState); } @Override public void onResume() { - Log.i("Resume " + this); + Log.d("Resume " + this); super.onResume(); updateSubtitle(); if (finish) { @@ -184,7 +183,7 @@ public class FragmentBase extends Fragment { @Override public void onPause() { - Log.i("Pause " + this); + Log.d("Pause " + this); super.onPause(); LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(getContext()); @@ -217,6 +216,7 @@ public class FragmentBase extends Fragment { @Override public void onDetach() { + Log.d("Detach " + this); super.onDetach(); InputMethodManager im = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); @@ -227,7 +227,7 @@ public class FragmentBase extends Fragment { @Override public void onConfigurationChanged(Configuration newConfig) { - Log.i("Config " + this); + Log.d("Config " + this); super.onConfigurationChanged(newConfig); } diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 255d28533f..cfd86a9a6a 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -3833,10 +3833,13 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. private BroadcastReceiver creceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { - Log.i("Received " + intent); - Log.logExtras(intent); - String action = intent.getAction(); + + if (!SimpleTask.ACTION_TASK_COUNT.equals(action)) { + Log.i("Received " + intent); + Log.logExtras(intent); + } + if (SimpleTask.ACTION_TASK_COUNT.equals(action)) onTaskCount(intent); else if (ACTION_NEW_MESSAGE.equals(action)) diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index 9d971d8e2f..e30b685274 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -167,8 +167,7 @@ public class Helper { @Override protected void beforeExecute(Thread t, Runnable r) { - if (BuildConfig.DEBUG) - Log.i("Executing " + t.getName()); + Log.d("Executing " + t.getName()); } } diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index ca29fd0b6e..b804ef7fd6 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -436,10 +436,9 @@ public class HtmlHelper { } boolean email = matcher.group().contains("@") && !matcher.group().contains(":"); - if (BuildConfig.DEBUG) - Log.i("Web url=" + matcher.group() + - " " + matcher.start() + "..." + matcher.end() + "/" + text.length() + - " linked=" + linked + " email=" + email + " count=" + links); + Log.d("Web url=" + matcher.group() + + " " + matcher.start() + "..." + matcher.end() + "/" + text.length() + + " linked=" + linked + " email=" + email + " count=" + links); if (linked) span.appendText(text.substring(pos, matcher.end())); diff --git a/app/src/main/java/eu/faircode/email/ImageHelper.java b/app/src/main/java/eu/faircode/email/ImageHelper.java index a00a8909d8..0a285fbde3 100644 --- a/app/src/main/java/eu/faircode/email/ImageHelper.java +++ b/app/src/main/java/eu/faircode/email/ImageHelper.java @@ -218,9 +218,8 @@ class ImageHelper { boolean embedded = a.source.startsWith("cid:"); boolean data = a.source.startsWith("data:"); - if (BuildConfig.DEBUG) - Log.i("Image show=" + show + " inline=" + inline + - " embedded=" + embedded + " data=" + data + " source=" + a.source); + Log.d("Image show=" + show + " inline=" + inline + + " embedded=" + embedded + " data=" + data + " source=" + a.source); // Embedded images if (embedded && (show || inline)) { diff --git a/app/src/main/java/eu/faircode/email/ItemDetailsMessage.java b/app/src/main/java/eu/faircode/email/ItemDetailsMessage.java index 61b8ac7a5c..20f32bd52a 100644 --- a/app/src/main/java/eu/faircode/email/ItemDetailsMessage.java +++ b/app/src/main/java/eu/faircode/email/ItemDetailsMessage.java @@ -32,7 +32,7 @@ public class ItemDetailsMessage extends ItemDetailsLookup.ItemDetails { @Override public int getPosition() { int pos = viewHolder.getAdapterPosition(); - Log.i("ItemDetails pos=" + pos); + Log.d("ItemDetails pos=" + pos); return pos; } @@ -41,7 +41,7 @@ public class ItemDetailsMessage extends ItemDetailsLookup.ItemDetails { public Long getSelectionKey() { int pos = viewHolder.getAdapterPosition(); Long key = viewHolder.getKey(); - Log.i("ItemDetails pos=" + pos + " key=" + key); + Log.d("ItemDetails pos=" + pos + " key=" + key); return key; } } diff --git a/app/src/main/java/eu/faircode/email/Log.java b/app/src/main/java/eu/faircode/email/Log.java index 105e2d1893..12aea11265 100644 --- a/app/src/main/java/eu/faircode/email/Log.java +++ b/app/src/main/java/eu/faircode/email/Log.java @@ -104,7 +104,7 @@ public class Log { private static final String TAG = "fairemail"; public static int d(String msg) { - if (BuildConfig.DEBUG) + if (BuildConfig.DEBUG && false) return android.util.Log.d(TAG, msg); else return 0; diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 920eb0a2b2..4845178dd2 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -207,7 +207,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences @Override public void onChanged(List accountNetworkStates) { if (!running) { - Log.i("XXX not running"); + Log.i("### not running"); return; } @@ -225,7 +225,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences int index = accountStates.indexOf(current); if (index < 0) { if (current.canRun()) { - Log.i("XXX new " + current); + Log.i("### new " + current); start(current, current.accountState.isEnabled(current.enabled)); } } else { @@ -242,7 +242,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences if (current.reload || prev.canRun() != current.canRun() || !prev.accountState.equals(current.accountState)) { - Log.i("XXX changed " + current + + Log.i("### changed " + current + " reload=" + current.reload + " run prev=" + prev.canRun() + " run cur=" + current.canRun() + @@ -309,9 +309,9 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences crumb.put("lastLost", new Date(lastLost).toString()); Log.breadcrumb("start", crumb); - Log.i("XXX start=" + accountNetworkState); + Log.i("### start=" + accountNetworkState); astate.start(); - Log.i("XXX started=" + accountNetworkState); + Log.i("### started=" + accountNetworkState); } }); } @@ -334,10 +334,10 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences crumb.put("lastLost", new Date(lastLost).toString()); Log.breadcrumb("stop", crumb); - Log.i("XXX stop=" + accountNetworkState); + Log.i("### stop=" + accountNetworkState); state.stop(); state.join(); - Log.i("XXX stopped=" + accountNetworkState); + Log.i("### stopped=" + accountNetworkState); } }); } @@ -366,7 +366,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences queue.submit(new Runnable() { @Override public void run() { - Log.i("XXX exit"); + Log.i("### exit"); DB db = DB.getInstance(ServiceSynchronize.this); List ops = db.operation().getOperations(EntityOperation.SYNC); @@ -374,7 +374,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences db.folder().setFolderSyncState(op.folder, null); stopSelf(); - Log.i("XXX exited"); + Log.i("### exited"); } }); } @@ -563,7 +563,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences @Override public int onStartCommand(Intent intent, int flags, int startId) { String action = (intent == null ? null : intent.getAction()); - Log.i("Service command intent=" + intent + " action=" + action); + String reason = (intent == null ? null : intent.getStringExtra("reason")); + Log.i("### Service command intent=" + intent + " action=" + action + " reason=" + reason); Log.logExtras(intent); super.onStartCommand(intent, flags, startId); diff --git a/app/src/main/java/eu/faircode/email/SimpleTask.java b/app/src/main/java/eu/faircode/email/SimpleTask.java index 40ca1878cd..2adad52837 100644 --- a/app/src/main/java/eu/faircode/email/SimpleTask.java +++ b/app/src/main/java/eu/faircode/email/SimpleTask.java @@ -134,7 +134,7 @@ public abstract class SimpleTask implements LifecycleObserver { cleanup(context); } else if (state.isAtLeast(Lifecycle.State.RESUMED)) { // Inline delivery - Log.i("Deliver task " + name); + Log.i("Deliver task " + name + " state=" + state); deliver(); cleanup(context); } else diff --git a/app/src/main/java/eu/faircode/email/TwoStateOwner.java b/app/src/main/java/eu/faircode/email/TwoStateOwner.java index 4c78031ff9..9e2edac3b4 100644 --- a/app/src/main/java/eu/faircode/email/TwoStateOwner.java +++ b/app/src/main/java/eu/faircode/email/TwoStateOwner.java @@ -46,8 +46,7 @@ public class TwoStateOwner implements LifecycleOwner { owner.getLifecycle().addObserver(new LifecycleObserver() { @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY) public void onDestroyed() { - if (BuildConfig.DEBUG) - Log.i("LifeCycle " + name + " parent destroyed"); + Log.d("LifeCycle " + name + " parent destroyed"); destroy(); } }); diff --git a/app/src/main/java/eu/faircode/email/ViewModelMessages.java b/app/src/main/java/eu/faircode/email/ViewModelMessages.java index 0a5cb5f21e..57a8c16ca0 100644 --- a/app/src/main/java/eu/faircode/email/ViewModelMessages.java +++ b/app/src/main/java/eu/faircode/email/ViewModelMessages.java @@ -64,12 +64,12 @@ public class ViewModelMessages extends ViewModel { String query, boolean server) { Args args = new Args(context, viewType, type, account, folder, thread, id, query, server); - Log.i("Get model=" + viewType + " " + args); + Log.d("Get model=" + viewType + " " + args); dump(); Model model = models.get(viewType); if (model == null || !model.args.equals(args)) { - Log.i("Creating model=" + viewType + " replace=" + (model != null)); + Log.d("Creating model=" + viewType + " replace=" + (model != null)); if (model != null) model.list.removeObservers(owner); @@ -165,17 +165,17 @@ public class ViewModelMessages extends ViewModel { int free_mb = Log.getFreeMemMb(); boolean lowmem = (free_mb < LOW_MEM_MB); - Log.i("Destroy model=" + viewType + + Log.d("Destroy model=" + viewType + " lowmem=" + lowmem + " free=" + free_mb + " MB"); Model model = models.get(viewType); if (model != null) { - Log.i("Remove observer model=" + viewType); + Log.d("Remove observer model=" + viewType); model.list.removeObservers(owner); } if (viewType == AdapterMessage.ViewType.THREAD || lowmem) { - Log.i("Remove model=" + viewType); + Log.d("Remove model=" + viewType); models.remove(viewType); } @@ -191,10 +191,10 @@ public class ViewModelMessages extends ViewModel { if (viewType != AdapterMessage.ViewType.THREAD) { last = viewType; - Log.i("Last model=" + last); + Log.d("Last model=" + last); } - Log.i("Returning model=" + viewType); + Log.d("Returning model=" + viewType); dump(); return model; @@ -207,7 +207,7 @@ public class ViewModelMessages extends ViewModel { } void observePrevNext(LifecycleOwner owner, final long id, final IPrevNext intf) { - Log.i("Observe prev/next model=" + last); + Log.d("Observe prev/next model=" + last); Model model = models.get(last); if (model == null) { @@ -215,11 +215,11 @@ public class ViewModelMessages extends ViewModel { return; } - Log.i("Observe previous/next id=" + id); + Log.d("Observe previous/next id=" + id); model.list.observe(owner, new Observer>() { @Override public void onChanged(PagedList messages) { - Log.i("Observe previous/next id=" + id + " messages=" + messages.size()); + Log.d("Observe previous/next id=" + id + " messages=" + messages.size()); for (int pos = 0; pos < messages.size(); pos++) { TupleMessageEx item = messages.get(pos); @@ -376,7 +376,7 @@ public class ViewModelMessages extends ViewModel { } private void dump() { - Log.i("Current models=" + TextUtils.join(", ", models.keySet())); + Log.d("Current models=" + TextUtils.join(", ", models.keySet())); } class Model {