Add more logging to track down a monkey bug
The monkey is finding a situation where getting or creating a thread id is
failing. Add more logging code to help track down the problem.
diff --git a/src/com/android/providers/telephony/MmsSmsProvider.java b/src/com/android/providers/telephony/MmsSmsProvider.java
index 61b4757..81de1af 100644
--- a/src/com/android/providers/telephony/MmsSmsProvider.java
+++ b/src/com/android/providers/telephony/MmsSmsProvider.java
@@ -437,18 +437,23 @@
String THREAD_QUERY = "SELECT _id FROM threads " +
"WHERE recipient_ids = ?";
+ if (DEBUG) {
+ Log.v(LOG_TAG, "getThreadId THREAD_QUERY: " + THREAD_QUERY);
+ }
SQLiteDatabase db = mOpenHelper.getReadableDatabase();
Cursor cursor = db.rawQuery(THREAD_QUERY, new String[] { recipientIds });
if (cursor.getCount() == 0) {
cursor.close();
+ if (DEBUG) {
+ Log.v(LOG_TAG, "getThreadId cursor zero, creating new threadid");
+ }
insertThread(recipientIds, recipients.size());
db = mOpenHelper.getReadableDatabase(); // In case insertThread closed it
cursor = db.rawQuery(THREAD_QUERY, new String[] { recipientIds });
}
- if (DEBUG && cursor.getCount() == 0) {
- Log.e(LOG_TAG, "getThreadId couldn't return a threadId, recipientIds: " +
- recipientIds);
+ if (DEBUG) {
+ Log.v(LOG_TAG, "getThreadId cursor count: " + cursor.getCount());
}
return cursor;
@@ -897,7 +902,7 @@
SQLiteDatabase db = mOpenHelper.getWritableDatabase();
Context context = getContext();
int affectedRows = 0;
-
+
switch(URI_MATCHER.match(uri)) {
case URI_CONVERSATIONS_MESSAGES:
long threadId;