Signal-Android icon indicating copy to clipboard operation
Signal-Android copied to clipboard

Attachments cannot be sent from gallery - on certain phones sometimes

Open horstschimanski opened this issue 12 years ago • 25 comments

When trying to add an attachment, e.g. a picture, the dialog "Open" will only show the folder "Recent" and "Downloads". Sending pictures or videos that are stored in the gallery would be really nice.

horstschimanski avatar Jul 25 '14 21:07 horstschimanski

When I tap the menu in the top-left in the attachment view, I see Recent, Images, Downloads, and Internal storage. Images shows me the pictures from my camera in the same order that I see them in the Gallery. This works regardless of whether I have "Display advanced devices" checked in the file selector Settings (available in the menu on the top right).

This file selector isn't actually a part of TextSecure. It's the same file selector that is used by any application requesting file upload functionality.

What version of Android are you using, and can you check whether or not you can see your photos/videos if you try to attach a picture from inside another application like Gmail?

jlund avatar Jul 26 '14 02:07 jlund

Here are three screenshots. The first two show the Textsecure attachment menu with "Display advanced devices" on and off while the last one was taken while attaching something in K-9 Mail. I am using Android 4.4.2 on a Galaxy S4 (GT-I9505, Baseband version I9505XXUFNC4). screenshot_2014-07-26-10-38-38 screenshot_2014-07-26-10-38-28 screenshot_2014-07-26-10-42-04

horstschimanski avatar Jul 26 '14 08:07 horstschimanski

+1; same problem.

icyfyer avatar Aug 20 '14 20:08 icyfyer

This is super-annoying. It lists my Downloads folder, Box account and google drive and "recent" which are from those accounts. I don't know how it determines what is recent, but nothing in recent is recent!

jeremymasters avatar Aug 21 '14 16:08 jeremymasters

Is this stock Android? Or some custom ROM?

tinloaf avatar Aug 21 '14 17:08 tinloaf

Stock. I have the Samsung Galaxy S4 from ATT. SHG-I337, version 4.4.2, Baseband I337UCUFNB1, Kernel 3.4.0-505595.

icyfyer avatar Aug 21 '14 19:08 icyfyer

Mine is bone stock Verizon Galaxy S4 4.4.2. Could it be a Touchwiz thing?

jeremymasters avatar Aug 21 '14 21:08 jeremymasters

I have two Verizon Galaxy S4 devices.

One, running the stock Android 4.4.2 VRUFNC5 software image, exhibits the same problem described here.

The other, running Android 4.4.4 CM 11 Milestone 10 (11-20140916-SNAPSHOT-M10-jflte), does not.

tgies avatar Sep 19 '14 15:09 tgies

We've been through at least 3 updates since this thread started, each said that it had more MMS fixes, but none of the problems have been resolved. It makes it too inconvenient to use this app until it's fixed.

icyfyer avatar Sep 19 '14 18:09 icyfyer

Although I will continue to use TS because of security, the lack of "Gallery" in the attachment window is rather puzzling.

jeremymasters avatar Sep 19 '14 20:09 jeremymasters

@icyfyer This issue has nothing to do with the MMS problems that are being fixed.

Aside from that, the problem is really that none of the people who work on TS can reproduce this..

tinloaf avatar Sep 20 '14 03:09 tinloaf

I could try to provide what is needed to troubleshoot this issue. It sounds like anyone who has a Verizon Galaxy S4 on Android 4.4.2 can reproduce as well?

jeremymasters avatar Oct 06 '14 21:10 jeremymasters

I am also willing to provide logs or screenshots to help troubleshoot this issue.

icyfyer avatar Oct 06 '14 21:10 icyfyer

Would be nice if I could use Quickpic to select the pic.. now displaying pictures is very slow (android 4.4.4, cyanogenmod). Also, the list of images does not update if I use "adb push", and "Rescan media" crashes. (Quickpic would show new pics in any case.)

Safari77 avatar Nov 27 '14 16:11 Safari77

I went from the stock ATT Galaxy S4 to a T-Mobile S4 running Cyanogenmod and the problem is gone. There are other problems, but this particular one disappeared.

icyfyer avatar Dec 13 '14 01:12 icyfyer

Reproduced on a stock Nexus 5:

  • Google Nexus 5 D820
  • Android 5.1 LMY47I stock; no superuser
  • TextSecure 2.9.3
  • AOSP Gallery2 1.1.40030 (com.android.gallery3d)
  • Google Photos DISABLED

side-by-each Left: TextSecure, after tapping "Add Attachment", then "Picture", then the hamburger menu. Right: An app in development, after sending an Intent to choose images.

Please forgive the Korean; I've been trying to cut down. From the top, the text in the navigation drawer reads as follows:

  • Open:
  • Recent
  • Images
  • Download
  • Gallery (only in the right screenshot)

Relevant log entries:

TextSecure

05-12 18:47:52.500     752-1170/? I/ActivityManager﹕ START u0 {act=android.intent.action.OPEN_DOCUMENT typ=image/* cmp=com.android.documentsui/.DocumentsActivity} from uid 10093 on display 0

App in development

05-12 18:48:54.624     752-9970/? I/ActivityManager﹕ START u0 {act=android.intent.action.GET_CONTENT typ=image/* cmp=com.android.documentsui/.DocumentsActivity (has extras)} from uid 10096 on display 0

The ACTION_OPEN_DOCUMENT Intent action was added relatively recently, in API 19 (Android 4.4 KitKat). Apps which haven't added this action to an intent-filter, like AOSP Gallery2, will not be listed in a DocumentsActivity started with this action.

From Storage Access Framework | Android Developers:

ACTION_OPEN_DOCUMENT is not intended to be a replacement for ACTION_GET_CONTENT. The one you should use depends on the needs of your app:

  • Use ACTION_GET_CONTENT if you want your app to simply read/import data. With this approach, the app imports a copy of the data, such as an image file.
  • Use ACTION_OPEN_DOCUMENT if you want your app to have long term, persistent access to documents owned by a document provider. An example would be a photo-editing app that lets users edit images stored in a document provider.

From AttachmentManager.java

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
      intent.setAction(Intent.ACTION_OPEN_DOCUMENT);
      try {
        activity.startActivityForResult(intent, requestCode);
        return;
      } catch (ActivityNotFoundException anfe) {
        Log.w(TAG, "couldn't complete ACTION_OPEN_DOCUMENT, no activity found. falling back.");
      }
    }

    intent.setAction(Intent.ACTION_GET_CONTENT);
    try {
      activity.startActivityForResult(intent, requestCode);
    } catch (ActivityNotFoundException anfe) {
      Log.w(TAG, "couldn't complete ACTION_GET_CONTENT intent, no activity found. falling back.");
      Toast.makeText(activity, R.string.AttachmentManager_cant_open_media_selection, Toast.LENGTH_LONG).show();
    }

Is there any reason not to remove the first block and just default to ACTION_GET_CONTENT? It will better fit the guidelines from Google, have more backward compatibility, and media apps going forward should be supporting both.

PR incoming.

unrulygnu avatar May 12 '15 10:05 unrulygnu

Correction: PR was incoming, but the CLA page is broken.

Cue sadness. ㅠㅠ

See also OpenWhisper Systems | Can't use the Contributor License Agreement.

unrulygnu avatar May 12 '15 11:05 unrulygnu

I registered just to comment on this. I recently installed TextSecure on Galaxy S4 v.4.4.2. and I have the same problem: you can't add videos, pictures or anything from Gallery! This has been reported OVER A YEAR AGO, and yet nothing has been done! I had to remove the whole bloody application. I'm so disappointed! Seems that nobody cares about fixing this.

TextSucks avatar Jul 17 '15 17:07 TextSucks

I haven't seen this issue in more than 4 updates. I am also running the Samsung Galaxy S4, but with Android version 4.4.4 and Cyanogenmod 11-20141112-Snapshot-M12-jflte.

icyfyer avatar Jul 17 '15 18:07 icyfyer

You should provide a log file so that they can troubleshoot your specific issue.

icyfyer avatar Jul 17 '15 18:07 icyfyer