mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Improved bread crumb
This commit is contained in:
parent
721d151dc4
commit
a60de82922
1 changed files with 22 additions and 9 deletions
|
@ -26,6 +26,7 @@ import android.app.PendingIntent;
|
|||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.sqlite.SQLiteConstraintException;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
@ -145,15 +146,6 @@ class Core {
|
|||
" msg=" + op.message +
|
||||
" args=" + op.args);
|
||||
|
||||
Map<String, String> crumb = new HashMap<>();
|
||||
crumb.put("name", op.name);
|
||||
crumb.put("args", op.args);
|
||||
crumb.put("folder", op.account + ":" + op.folder + ":" + folder.type);
|
||||
if (op.message != null)
|
||||
crumb.put("message", Long.toString(op.message));
|
||||
crumb.put("free", Integer.toString(Log.getFreeMemMb()));
|
||||
Log.breadcrumb("operation", crumb);
|
||||
|
||||
// Fetch most recent copy of message
|
||||
EntityMessage message = null;
|
||||
if (op.message != null)
|
||||
|
@ -197,6 +189,7 @@ class Core {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (skip) {
|
||||
Log.i(folder.name +
|
||||
" skipping op=" + op.id + "/" + op.name +
|
||||
|
@ -205,6 +198,15 @@ class Core {
|
|||
continue;
|
||||
}
|
||||
|
||||
Map<String, String> crumb = new HashMap<>();
|
||||
crumb.put("name", op.name);
|
||||
crumb.put("args", op.args);
|
||||
crumb.put("folder", op.account + ":" + op.folder + ":" + folder.type);
|
||||
if (op.message != null)
|
||||
crumb.put("message", Long.toString(op.message));
|
||||
crumb.put("free", Integer.toString(Log.getFreeMemMb()));
|
||||
Log.breadcrumb("start operation", crumb);
|
||||
|
||||
if (istore instanceof POP3Store)
|
||||
switch (op.name) {
|
||||
case EntityOperation.SEEN:
|
||||
|
@ -297,6 +299,9 @@ class Core {
|
|||
}
|
||||
}
|
||||
|
||||
crumb.put("free", Integer.toString(Log.getFreeMemMb()));
|
||||
Log.breadcrumb("end operation", crumb);
|
||||
|
||||
// Operation succeeded
|
||||
db.operation().deleteOperation(op.id);
|
||||
} catch (Throwable ex) {
|
||||
|
@ -1861,6 +1866,14 @@ class Core {
|
|||
runRules(context, imessage, message, rules);
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} catch (SQLiteConstraintException ex) {
|
||||
Log.e(ex);
|
||||
|
||||
Map<String, String> crumb = new HashMap<>();
|
||||
crumb.put("folder", message.account + ":" + message.folder + ":" + folder.type);
|
||||
crumb.put("message", uid + ":" + message.uid);
|
||||
crumb.put("what", ex.getMessage());
|
||||
Log.breadcrumb("insert", crumb);
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue