diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-10-05 21:01:09 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-10-05 21:01:09 +0200 |
commit | 41d836902227c619017c0acfa65c59a9594ec3ba (patch) | |
tree | ea08397f37a3f960fff1cd5ee3ba2ac79bdb0676 /src/main/java/de | |
parent | c50d2d68fb3f6b7f07aed1949f735ec9b4a75932 (diff) |
add more logging to attaching file process
Diffstat (limited to 'src/main/java/de')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationActivity.java | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java index 13e487735..c2088e559 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java @@ -206,10 +206,9 @@ 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)); - mPendingPhotoUris.clear(); - mPendingPhotoUris.add(Uri.parse(pending)); } } @@ -1347,6 +1346,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 if (this.mPendingPhotoUris.size() >= 1) { savedInstanceState.putString(STATE_PENDING_URI, this.mPendingPhotoUris.get(0).toString()); @@ -1472,28 +1472,40 @@ 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) { int ImageUrisCount = mPendingImageUris.size(); if (ImageUrisCount == 1) { Uri uri = mPendingImageUris.get(0); + Log.d(Config.LOGTAG,"ConversationsActivity.onBackendConnected() - attaching image to conversations. stopping="+Boolean.toString(stopping)); attachImageToConversation(getSelectedConversation(), uri); } else { for (Iterator<Uri> i = mPendingImageUris.iterator(); i.hasNext(); i.remove()) { Uri foo = i.next(); + Log.d(Config.LOGTAG,"ConversationsActivity.onBackendConnected() - attaching images to conversations. stopping="+Boolean.toString(stopping)); attachImagesToConversation(getSelectedConversation(), foo); } } for (Iterator<Uri> i = mPendingPhotoUris.iterator(); i.hasNext(); i.remove()) { + Log.d(Config.LOGTAG,"ConversationsActivity.onBackendConnected() - attaching photo to conversations. stopping="+Boolean.toString(stopping)); attachPhotoToConversation(getSelectedConversation(), i.next()); } for (Iterator<Uri> i = mPendingVideoUris.iterator(); i.hasNext(); i.remove()) { + Log.d(Config.LOGTAG,"ConversationsActivity.onBackendConnected() - attaching video to conversations. stopping="+Boolean.toString(stopping)); attachVideoToConversation(getSelectedConversation(), i.next()); } for (Iterator<Uri> i = mPendingFileUris.iterator(); i.hasNext(); i.remove()) { - attachFileToConversation(getSelectedConversation(), i.next()); + Log.d(Config.LOGTAG,"ConversationsActivity.onBackendConnected() - attaching file to conversations. stopping="+Boolean.toString(stopping)); + attachFileToConversation(getSelectedConversation(), i.next()); } if (mPendingGeoUri != null) { @@ -1619,9 +1631,11 @@ public class ConversationActivity extends XmppActivity if (xmppConnectionServiceBound) { if (ImageUrisCount == 1) { Uri uri = mPendingImageUris.get(0); + Log.d(Config.LOGTAG,"ConversationsActivity.onActivityResult() - attaching image to conversations. CHOOSE_IMAGE"); attachImageToConversation(getSelectedConversation(), uri); } else { for (Iterator<Uri> i = mPendingImageUris.iterator(); i.hasNext(); i.remove()) { + Log.d(Config.LOGTAG,"ConversationsActivity.onActivityResult() - attaching images to conversations. CHOOSE_IMAGES"); attachImagesToConversation(getSelectedConversation(), i.next()); } } @@ -1636,6 +1650,7 @@ public class ConversationActivity extends XmppActivity mPendingFileUris.addAll(uris); if (xmppConnectionServiceBound) { for (Iterator<Uri> 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()); } } @@ -1658,6 +1673,7 @@ public class ConversationActivity extends XmppActivity mPendingVideoUris.addAll(uris); if (xmppConnectionServiceBound) { for (Iterator<Uri> i = mPendingVideoUris.iterator(); i.hasNext(); i.remove()) { + Log.d(Config.LOGTAG,"ConversationsActivity.onActivityResult() - attaching video to conversations. CHOOSE_VIDEO"); attachVideoToConversation(c, i.next()); } } @@ -1674,7 +1690,8 @@ public class ConversationActivity extends XmppActivity if (mPendingPhotoUris.size() == 1) { Uri uri = mPendingPhotoUris.get(0); if (xmppConnectionServiceBound) { - attachPhotoToConversation(getSelectedConversation(), uri); + Log.d(Config.LOGTAG,"ConversationsActivity.onActivityResult() - attaching photo to conversations. TAKE_PHOTO"); + attachPhotoToConversation(getSelectedConversation(), uri); mPendingPhotoUris.clear(); } Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); |