Fix cases of inlined & missing log tags.

This commit is contained in:
Alan Evans
2020-05-11 11:03:42 -03:00
committed by Alex Hart
parent 3db5da1c8d
commit 06ab3cf013
18 changed files with 52 additions and 40 deletions

View File

@@ -1360,7 +1360,7 @@ public class MmsDatabase extends MessagingDatabase {
cursor = db.query(TABLE_NAME, new String[] {ID}, where, new String[] {threadId+""}, null, null, null);
while (cursor != null && cursor.moveToNext()) {
Log.i("MmsDatabase", "Trimming: " + cursor.getLong(0));
Log.i(TAG, "Trimming: " + cursor.getLong(0));
delete(cursor.getLong(0));
}

View File

@@ -153,7 +153,7 @@ public class SmsDatabase extends MessagingDatabase {
}
private void updateTypeBitmask(long id, long maskOff, long maskOn) {
Log.i("MessageDatabase", "Updating ID: " + id + " to base type: " + maskOn);
Log.i(TAG, "Updating ID: " + id + " to base type: " + maskOn);
SQLiteDatabase db = databaseHelper.getWritableDatabase();
db.execSQL("UPDATE " + TABLE_NAME +
@@ -368,7 +368,7 @@ public class SmsDatabase extends MessagingDatabase {
}
public void markStatus(long id, int status) {
Log.i("MessageDatabase", "Updating ID: " + id + " to status: " + status);
Log.i(TAG, "Updating ID: " + id + " to status: " + status);
ContentValues contentValues = new ContentValues();
contentValues.put(STATUS, status);
@@ -793,7 +793,7 @@ public class SmsDatabase extends MessagingDatabase {
}
public boolean deleteMessage(long messageId) {
Log.i("MessageDatabase", "Deleting: " + messageId);
Log.i(TAG, "Deleting: " + messageId);
SQLiteDatabase db = databaseHelper.getWritableDatabase();
long threadId = getThreadIdForMessage(messageId);
db.delete(TABLE_NAME, ID_WHERE, new String[] {messageId+""});

View File

@@ -135,7 +135,7 @@ public class SmsMigrator {
return null;
}
} catch (IllegalStateException iae) {
Log.w("SmsMigrator", iae);
Log.w(TAG, iae);
return null;
} finally {
if (cursor != null)

View File

@@ -248,19 +248,19 @@ public class ThreadDatabase extends Database {
}
public void trimThread(long threadId, int length) {
Log.i("ThreadDatabase", "Trimming thread: " + threadId + " to: " + length);
Log.i(TAG, "Trimming thread: " + threadId + " to: " + length);
Cursor cursor = null;
try {
cursor = DatabaseFactory.getMmsSmsDatabase(context).getConversation(threadId);
if (cursor != null && length > 0 && cursor.getCount() > length) {
Log.w("ThreadDatabase", "Cursor count is greater than length!");
Log.w(TAG, "Cursor count is greater than length!");
cursor.moveToPosition(length - 1);
long lastTweetDate = cursor.getLong(cursor.getColumnIndexOrThrow(MmsSmsColumns.NORMALIZED_DATE_RECEIVED));
Log.i("ThreadDatabase", "Cut off tweet date: " + lastTweetDate);
Log.i(TAG, "Cut off tweet date: " + lastTweetDate);
DatabaseFactory.getSmsDatabase(context).deleteMessagesInThreadBeforeDate(threadId, lastTweetDate);
DatabaseFactory.getMmsDatabase(context).deleteMessagesInThreadBeforeDate(threadId, lastTweetDate);

View File

@@ -182,10 +182,10 @@ public class ClassicOpenHelper extends SQLiteOpenHelper {
Cursor smsCursor = null;
Log.i("DatabaseFactory", "Upgrade count: " + (smsCount + threadCount));
Log.i(TAG, "Upgrade count: " + (smsCount + threadCount));
do {
Log.i("DatabaseFactory", "Looping SMS cursor...");
Log.i(TAG, "Looping SMS cursor...");
if (smsCursor != null)
smsCursor.close();
@@ -224,7 +224,7 @@ public class ClassicOpenHelper extends SQLiteOpenHelper {
new String[] {body, type+"", id+""});
}
} catch (InvalidMessageException e) {
Log.w("DatabaseFactory", e);
Log.w(TAG, e);
}
}
@@ -237,7 +237,7 @@ public class ClassicOpenHelper extends SQLiteOpenHelper {
skip = 0;
do {
Log.i("DatabaseFactory", "Looping thread cursor...");
Log.i(TAG, "Looping thread cursor...");
if (threadCursor != null)
threadCursor.close();
@@ -281,7 +281,7 @@ public class ClassicOpenHelper extends SQLiteOpenHelper {
new String[] {snippet, snippetType+"", id+""});
}
} catch (InvalidMessageException e) {
Log.w("DatabaseFactory", e);
Log.w(TAG, e);
}
}
@@ -296,13 +296,13 @@ public class ClassicOpenHelper extends SQLiteOpenHelper {
}
if (fromVersion < LegacyMigrationJob.MMS_BODY_VERSION) {
Log.i("DatabaseFactory", "Update MMS bodies...");
Log.i(TAG, "Update MMS bodies...");
MasterCipher masterCipher = new MasterCipher(masterSecret);
Cursor mmsCursor = db.query("mms", new String[] {"_id"},
"msg_box & " + 0x80000000L + " != 0",
null, null, null, null);
Log.i("DatabaseFactory", "Got MMS rows: " + (mmsCursor == null ? "null" : mmsCursor.getCount()));
Log.i(TAG, "Got MMS rows: " + (mmsCursor == null ? "null" : mmsCursor.getCount()));
while (mmsCursor != null && mmsCursor.moveToNext()) {
listener.setProgress(mmsCursor.getPosition(), mmsCursor.getCount());
@@ -336,7 +336,7 @@ public class ClassicOpenHelper extends SQLiteOpenHelper {
dataFile.delete();
db.delete("part", "_id = ?", new String[] {partId+""});
} catch (IOException e) {
Log.w("DatabaseFactory", e);
Log.w(TAG, e);
}
} else if (MediaUtil.isAudioType(contentType) ||
MediaUtil.isImageType(contentType) ||
@@ -355,7 +355,7 @@ public class ClassicOpenHelper extends SQLiteOpenHelper {
new String[] {partCount+"", mmsId+""});
}
Log.i("DatabaseFactory", "Updated body: " + body + " and part_count: " + partCount);
Log.i(TAG, "Updated body: " + body + " and part_count: " + partCount);
}
}