diff --git a/QKSMS/src/main/java/com/moez/QKSMS/data/Conversation.java b/QKSMS/src/main/java/com/moez/QKSMS/data/Conversation.java index 86af5bbc..aa05d779 100644 --- a/QKSMS/src/main/java/com/moez/QKSMS/data/Conversation.java +++ b/QKSMS/src/main/java/com/moez/QKSMS/data/Conversation.java @@ -757,12 +757,10 @@ public class Conversation { * @param deleteAll Delete the whole thread including locked messages * @param threadIds Collection of thread IDs of the conversations to be deleted */ - public static void startDelete(ConversationQueryHandler handler, int token, boolean deleteAll, - Collection threadIds) { + public static void startDelete(ConversationQueryHandler handler, int token, boolean deleteAll, Collection threadIds) { synchronized (sDeletingThreadsLock) { if (DELETEDEBUG) { - Log.v(TAG, "Conversation startDelete sDeletingThreads: " + - sDeletingThreads); + Log.v(TAG, "Conversation startDelete sDeletingThreads: " + sDeletingThreads); } if (sDeletingThreads) { Log.e(TAG, "startDeleteAll already in the middle of a delete", new Exception()); @@ -829,18 +827,11 @@ public class Conversation { @Override protected void onDeleteComplete(int token, Object cookie, int result) { if (token == mDeleteToken) { - // Test code -// try { -// Thread.sleep(10000); -// } catch (InterruptedException e) { -// } - // release lock synchronized (sDeletingThreadsLock) { sDeletingThreads = false; if (DELETEDEBUG) { - Log.v(TAG, "Conversation onDeleteComplete sDeletingThreads: " + - sDeletingThreads); + Log.v(TAG, "Conversation onDeleteComplete sDeletingThreads: " + sDeletingThreads); } sDeletingThreadsLock.notifyAll(); } diff --git a/QKSMS/src/main/java/com/moez/QKSMS/ui/MainActivity.java b/QKSMS/src/main/java/com/moez/QKSMS/ui/MainActivity.java index 8de68184..20a21a74 100644 --- a/QKSMS/src/main/java/com/moez/QKSMS/ui/MainActivity.java +++ b/QKSMS/src/main/java/com/moez/QKSMS/ui/MainActivity.java @@ -697,16 +697,13 @@ public class MainActivity extends QKActivity implements SlidingMenu.OnOpenListen @Override public void onClick(DialogInterface dialog, final int whichButton) { MessageUtils.handleReadReport(mContext, mThreadIds, - PduHeaders.READ_STATUS__DELETED_WITHOUT_BEING_READ, new Runnable() { - @Override - public void run() { - int token = DELETE_CONVERSATION_TOKEN; - if (mThreadIds == null) { - Conversation.startDeleteAll(mHandler, token, mDeleteLockedMessages); - DraftCache.getInstance().refresh(); - } else { - Conversation.startDelete(mHandler, token, mDeleteLockedMessages, mThreadIds); - } + PduHeaders.READ_STATUS__DELETED_WITHOUT_BEING_READ, () -> { + int token = DELETE_CONVERSATION_TOKEN; + if (mThreadIds == null) { + Conversation.startDeleteAll(mHandler, token, mDeleteLockedMessages); + DraftCache.getInstance().refresh(); + } else { + Conversation.startDelete(mHandler, token, mDeleteLockedMessages, mThreadIds); } } ); diff --git a/QKSMS/src/main/java/com/moez/QKSMS/ui/conversationlist/ConversationListFragment.java b/QKSMS/src/main/java/com/moez/QKSMS/ui/conversationlist/ConversationListFragment.java index d2313055..10e52dcc 100644 --- a/QKSMS/src/main/java/com/moez/QKSMS/ui/conversationlist/ConversationListFragment.java +++ b/QKSMS/src/main/java/com/moez/QKSMS/ui/conversationlist/ConversationListFragment.java @@ -120,7 +120,8 @@ public class ConversationListFragment extends QKFragment implements LoaderManage } /** - * Returns the weighting for unread vs. read conversations that are selected + * Returns the weighting for unread vs. read conversations that are selected, to decide + * which options we should show in the multi selction toolbar */ private int getUnreadWeight() { int unreadWeight = 0;