Closed Bug 1175532 Opened 5 years ago Closed 4 years ago

No visible action when choosing "Share" from Action Bar and Reader View toolbar

Categories

(Firefox for Android :: General, defect)

41 Branch
ARM
Android
defect
Not set

Tracking

()

VERIFIED FIXED
Firefox 42
Tracking Status
firefox40 --- unaffected
firefox41 --- unaffected
firefox42 + verified
fennec 42+ ---

People

(Reporter: TeoVermesan, Assigned: mcomella)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Tested with:
Build: Firefox for Android 41.0a1 (2015-06-17)
Device: Alcatel One Touch (Android 4.1.2) and Nexus 4 (Android 5.1)

Steps to reproduce
1. Go to https://en.m.wikipedia.org/wiki/Mozilla
2. Tap press-hold on a selected word such "software"
3. From action bar choose "Share"

Expected results:
- A screen is displayed with all shareable options - all apps that you can use to share the text. 

Actual results:
- The action bar is dismissed and the list with option is not displayed

Note:
- the same happens when choosing "Share" from reader view toolbar
tracking-fennec: --- → ?
[Tracking Requested - why for this release]: regression
(In reply to Mark Capella [:capella] from comment #1)
> Looks like this regressed here
> https://hg.mozilla.org/mozilla-central/rev/7299b8b5a8a1

That's a merge changeset... can we narrow this down to a specific bug?
Flags: needinfo?(markcapella)
Assignee: nobody → margaret.leibovic
Adding a tracking flag for FF41 and FF42 as this is a regression.
Regression window:
not affected build: 16-06
affected build: 17-06

pushlog: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=ce863f9d8864&tochange=d7c148c84594
tracking-fennec: ? → 41+
Going to guess this is another CATEGORY_BROWSABLE issue. CC'ing sebastian because he's also looked into this.
Duplicate of this bug: 1181830
We might need a hacky solution similar to bug 1100100. :\

NI self: this is probably my fault so it'd be efficient for me to look into.
Flags: needinfo?(michael.l.comella)
For the action bar, we share from GeckoApp.handleMessage [1]:

626         } else if ("Share:Text".equals(event)) {
627             String text = message.getString("text");
628             GeckoAppShell.openUriExternal(text, "text/plain", "", "", Intent.ACTION_SEND, "");

With openUriExternal, we put Category.BROWSABLE on the url so that's likely the issue.

[1]: https://mxr.mozilla.org/mozilla-central/source/mobile/android/base/GeckoApp.java?rev=fa4e7b0b946b#626
Assignee: margaret.leibovic → michael.l.comella
Flags: needinfo?(michael.l.comella)
Commented out where we add Category.BROWSABLE in getOpenURIIntent so that's definitely the issue:

https://mxr.mozilla.org/mozilla-central/source/mobile/android/base/GeckoAppShell.java#1203
So here's a fun one [1]:

1215     private static Intent getOpenURIIntentInner(final Context context,  final String targetURI,
1216             final String mimeType, final String action, final String title) {
1217 
1218         if (action.equalsIgnoreCase(Intent.ACTION_SEND)) {
1219             Intent shareIntent = getShareIntent(context, targetURI, mimeType, title);
1220             return Intent.createChooser(shareIntent,
1221                                         context.getResources().getString(R.string.share_title)); 
1222         }

getShareIntent sets the intent's data field to the mimeType argument. However, without certain flags specified, Intent.createChooser does not copy that field into the new intent. To be correct, I manually inserted the mimeType ("text/plain") into the returned Intent and we don't match any applications.

Wes, it seems the use of explicit mimeTypes is very inconsistent - do you know when they're used explicitly and implicitly? So far it seems "file" schemes have used mimeTypes and nothing else has.

[1]: https://mxr.mozilla.org/mozilla-central/source/mobile/android/base/GeckoAppShell.java?rev=3527e6013de9#1219
Flags: needinfo?(wjohnston)
As for the solution to this bug, I say we pass a flag into GeckoAppShell.openUriExternal to the effect of, "Don't add Category.BROWSABLE" until a better solution such as bug 1182140 can be reached.
Moved NI from comment 12 to bug 1182140 comment 1.
Flags: needinfo?(wjohnston)
Duplicate of this bug: 1183683
This should be fixed on 41 by bug 1182328 - NI self to verify.
tracking-fennec: 41+ → 42+
Flags: needinfo?(michael.l.comella)
(In reply to Michael Comella (:mcomella) from comment #16)
> This should be fixed on 41 by bug 1182328 - NI self to verify.

Fixed on the latest Aurora build [1].

[1]: ftp://ftp.mozilla.org/pub/mobile/nightly/2015-07-23-00-40-07-mozilla-aurora-android-api-11/
Flags: needinfo?(michael.l.comella)
What's needed to fix this on 42?
Flags: needinfo?(michael.l.comella)
(In reply to :Margaret Leibovic from comment #18)
> What's needed to fix this on 42?

Ideally we fix bug 1182140 but I probably won't get to that by merge since I'm focusing on the pb changes. I'll just apply bug 1182328 here as well.
Flags: needinfo?(michael.l.comella)
The patches that are about to land are from bug 1182328 and were r+'d there.
url:        https://hg.mozilla.org/integration/fx-team/rev/11ebe4ba54b5b74a3d05f264fc6095051089c702
changeset:  11ebe4ba54b5b74a3d05f264fc6095051089c702
user:       Michael Comella <michael.l.comella@gmail.com>
date:       Fri Jul 10 16:40:00 2015 -0700
description:
Bug 1175532 - Use Intent.parseUri for intent:// & android-app://. r=margaret

We now specify no flags to Intent.parseUri so it can accept and parse arbitrary
URIs.

This patch is originally from bug 1182328 and r+'d there.

url:        https://hg.mozilla.org/integration/fx-team/rev/3b696b49a755c6cb17f20fbbf5fc68c6302813c1
changeset:  3b696b49a755c6cb17f20fbbf5fc68c6302813c1
user:       Michael Comella <michael.l.comella@gmail.com>
date:       Fri Jul 10 16:42:00 2015 -0700
description:
Bug 1175532 - Only add CATEGORY_BROWSABLE to intent & android-app uris. r=margaret

This patch is originally from bug 1182328 and r+'d there.
https://hg.mozilla.org/mozilla-central/rev/11ebe4ba54b5
https://hg.mozilla.org/mozilla-central/rev/3b696b49a755
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 42
When choosing "Share" from Action Bar, Context Menu, or Reader View toolbar, "Share via" options pop-up is displayed and works correctly.
Verified as fixed using:
Device: Samsung S5 (Android 4.4.2)
Build: Firefox for Android 42.0a1 (2015-08-09)
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.