From b6e7def9db0b30dadbc59c0a56c627bcaa50ca80 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 3 Oct 2016 11:13:04 +0200 Subject: add more logging to attaching file process --- .../eu/siacs/conversations/ui/ConversationActivity.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 40401fed..5db916d0 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -181,6 +181,7 @@ public class ConversationActivity extends XmppActivity } String pending = savedInstanceState.getString(STATE_PENDING_URI, null); if (pending != null) { + Log.d(Config.LOGTAG,"ConversationsActivity.onCreate() - restoring pending image uri"); mPendingImageUris.clear(); mPendingImageUris.add(Uri.parse(pending)); } @@ -1146,6 +1147,7 @@ public class ConversationActivity extends XmppActivity } savedInstanceState.putBoolean(STATE_PANEL_OPEN, isConversationsOverviewVisable()); if (this.mPendingImageUris.size() >= 1) { + Log.d(Config.LOGTAG,"ConversationsActivity.onSaveInstanceState() - saving pending image uri"); savedInstanceState.putString(STATE_PENDING_URI, this.mPendingImageUris.get(0).toString()); } else { savedInstanceState.remove(STATE_PENDING_URI); @@ -1233,13 +1235,22 @@ public class ConversationActivity extends XmppActivity this.onActivityResult(mPostponedActivityResult.first, RESULT_OK, mPostponedActivityResult.second); } + final boolean stopping; + if (Build.VERSION.SDK_INT >= 17) { + stopping = isFinishing() || isDestroyed(); + } else { + stopping = isFinishing(); + } + if (!forbidProcessingPendings) { for (Iterator i = mPendingImageUris.iterator(); i.hasNext(); i.remove()) { Uri foo = i.next(); + Log.d(Config.LOGTAG,"ConversationsActivity.onBackendConnected() - attaching image to conversations. stopping="+Boolean.toString(stopping)); attachImageToConversation(getSelectedConversation(), foo); } for (Iterator i = mPendingFileUris.iterator(); i.hasNext(); i.remove()) { + Log.d(Config.LOGTAG,"ConversationsActivity.onBackendConnected() - attaching file to conversations. stopping="+Boolean.toString(stopping)); attachFileToConversation(getSelectedConversation(), i.next()); } @@ -1364,6 +1375,7 @@ public class ConversationActivity extends XmppActivity mPendingImageUris.addAll(extractUriFromIntent(data)); if (xmppConnectionServiceBound) { for (Iterator i = mPendingImageUris.iterator(); i.hasNext(); i.remove()) { + Log.d(Config.LOGTAG,"ConversationsActivity.onActivityResult() - attaching image to conversations. CHOOSE_IMAGE"); attachImageToConversation(getSelectedConversation(), i.next()); } } @@ -1377,6 +1389,7 @@ public class ConversationActivity extends XmppActivity mPendingFileUris.addAll(uris); if (xmppConnectionServiceBound) { for (Iterator i = mPendingFileUris.iterator(); i.hasNext(); i.remove()) { + Log.d(Config.LOGTAG,"ConversationsActivity.onActivityResult() - attaching file to conversations. CHOOSE_FILE/RECORD_VOICE"); attachFileToConversation(c, i.next()); } } @@ -1393,6 +1406,7 @@ public class ConversationActivity extends XmppActivity if (mPendingImageUris.size() == 1) { Uri uri = mPendingImageUris.get(0); if (xmppConnectionServiceBound) { + Log.d(Config.LOGTAG,"ConversationsActivity.onActivityResult() - attaching image to conversations. TAKE_PHOTO"); attachImageToConversation(getSelectedConversation(), uri); mPendingImageUris.clear(); } -- cgit v1.2.3