Closed Bug 1155855 Opened 6 years ago Closed 5 years ago

Can't dismiss share overlay after launching browser

Categories

(Firefox for Android :: General, defect)

All
Android
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 43
Tracking Status
firefox43 --- fixed

People

(Reporter: canuckistani, Assigned: mcomella)

References

Details

Attachments

(2 files)

Using today's nightly, if I try to send the current site from the HN app [1] to Nightly I am no longer able to dismiss the share intent overlay UI, see attached screenshot.

Phone is OPO running CM11 / Android 4.4.4

[1] https://play.google.com/store/apps/details?id=com.manuelmaly.hn
CC'ing mcomella here too. 

Mike, we should figure out what's happening here.
Flags: needinfo?(michael.l.comella)
I can't repro this using the same app & version of nightly on Roland's nexus 6 running Lollipop.
This is likely a regression on one of the share overlay bugs, perhaps bug 1122302, so this is likely on 38.

NI antlam to test on another non-CM OPO.
Assignee: nobody → michael.l.comella
Flags: needinfo?(alam)
Flags: needinfo?(alam)
Clearing my NI for now cause I can't repo.
Flaviu, do you have any Cyanogenmod or OPO devices you can repro on?
Flags: needinfo?(michael.l.comella) → needinfo?(flaviu.cos)
I installed Cyanogenmod 11 (Android 4.4.4) on Motorola Razr XT910 and the bug is not reproducible. Tapping outside or the back button will dismiss the share overlay.
Flags: needinfo?(flaviu.cos)
Jeff, is this only from the HN app? Is this still reproducable, and are there any other steps in the process? (e.g. use recent apps switcher)
Flags: needinfo?(jgriffiths)
(In reply to Michael Comella (:mcomella) from comment #7)
> Jeff, is this only from the HN app? Is this still reproducable, and are
> there any other steps in the process? (e.g. use recent apps switcher)

I can still repro on my device. This is not limited to the HN app, I can do it on others. STR with something more common like Feedly is the same:

* in feedly, view an article then open feeldy's custom 'share' menu. 
* avoid hitting 'browser' and instead hit 'android' with the typical share icon
* when the share intent menu comes up, select 'Add to Nightly'

At this point, the menu comes up. Hitting the transparent space where the url appears ( title as well, sometimes ) opens the link immediately in Firefox, which is what I want. Returning to feedly from the app switching menu, I notice that there is still a part opacity layer applied to the feedly ui, and then an animation starts bringing up Nightly's share menu.

Happy to demo this to antlam IRL or loan out the device for short periods of time if that helps. I'm also going to see if Roland has a vanilla 4.4.4 device around - this could definitely be just CM weirdness.
Flags: needinfo?(jgriffiths)
This sounds like the share overlay activity is topmost in Feedly's task stack; when you tap the Browse action, you're actually launching the Fennec task, which is separate.

When you use the task switcher it brings Feedly's task stack to the front. The share overlay is still at the top.

launchBrowser is *supposed* to trigger an animation for slideout, which finishes the activity when done.

So two hypotheses:

* You have animations turned off in CM, and as a result our animation never runs.
* The app switch is happening soon enough that the activity is paused before the animation runs, and it resumes when we come back.
OS: Mac OS X → Android
Hardware: x86 → All
Summary: Can't dismiss share overlay from HN app → Can't dismiss share overlay after launching browser (Cyanogen?)
I can repro this on a N7 running 4.4 on the 6/29 Nightly.

STR:
1. Long-press a link and share to another Fennec.
2. Click on the url section of the overlay options and open in the other browser.
3. Switch back to the original app.

Expected:
Overlay is gone because it animated away.

Actual:
Share overlay reappears and can not be dismissed by tapping in the black area, or by hitting back. Switching apps will constantly bring the overlay back.
NI self to check this out.
Flags: needinfo?(michael.l.comella)
(Assigned – don't need the NI)
Flags: needinfo?(michael.l.comella)
I just ran into this on a stock Nexus 5 on Lollipop 5.1.1 with the Play Store Firefox 41 Beta. After I was done with the page in Firefox I hit "back" and was taken to the "Add to Firefox" activity instead of my Twitter app. Symptoms were as described in comment 10. I recovered by dismissing the activity from the Android task switcher.
We launch the new activity and slide out [1]. The issue is that finish() gets called onAnimationEnd but I believe the animation is getting killed before the onAnimationEnd handler can get called, thus preventing finish from getting called.

I think the ideal solution would be to restore the system app-switch animations and call finish() directly but I'm having difficulty restoring the standard window animations – I'll see what I can do.

[1]: https://mxr.mozilla.org/mozilla-central/source/mobile/android/base/overlays/ui/ShareDialog.java?rev=4fcf2f94a591#416
Bug 1155855 - Don't override animations when opening the browser from the share overlay. r=liuche

When used to do our own animation when opening the browser from the
share overlay. That caused this bug: we didn't call `finish` until
`onAnimationEnd` but since `startActivity` was called, the application
was switched before `onAnimationEnd`, and thus `finish`, could be
called. When we returned to the share overlay, it was in an unexpected
state (`isAnimating` was true) and the user could no longer interact
with it, blocking access to the app the ShareOverlay was opened from.

We fix this by not doing our custom animations and just calling `finish`.

Note: in any case, overriding the animation when opening the browser
could be unintuitive to users because they might expect a consistent
app-switch animation throughout the system.
Attachment #8654442 - Flags: review?(liuche)
Comment on attachment 8654442 [details]
MozReview Request: Bug 1155855 - Don't override animations when opening the browser from the share overlay. r=liuche

https://reviewboard.mozilla.org/r/17693/#review16579

::: mobile/android/base/overlays/ui/ShareDialog.java:354
(Diff revision 1)
> +    public void finish(final boolean shouldOverrideAnimations) {

Does this need to be public? You're already overriding ShareDialog.finish().
Attachment #8654442 - Flags: review?(liuche) → review+
https://reviewboard.mozilla.org/r/17693/#review16579

> Does this need to be public? You're already overriding ShareDialog.finish().

No – fixed.
https://hg.mozilla.org/mozilla-central/rev/663c51b44b99
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 43
Summary: Can't dismiss share overlay after launching browser (Cyanogen?) → Can't dismiss share overlay after launching browser
Duplicate of this bug: 1231409
You need to log in before you can comment on or make changes to this bug.