LauncherActivity shows in recent task list on Android 4.4

RESOLVED FIXED in Firefox 50

Status

()

defect
P1
normal
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: sunhaitao, Assigned: sebastian)

Tracking

50 Branch
Firefox 52
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox48 unaffected, firefox49 unaffected, firefox50 fixed, firefox51 verified, firefox52 verified)

Details

Attachments

(2 attachments, 1 obsolete attachment)

Reporter

Description

3 years ago
An extra recent task list item appears on Android 4.4 since org.mozilla.gecko.LauncherActivity is introduced.
Reporter

Updated

3 years ago
Assignee: nobody → sunhaitao
I'm surprised that the LauncherActivity is still in recents even though we always finish() it. I assume this happens *only* on 4.4 and not on newer devices?
Reporter

Comment 3

3 years ago
The current behavior on Android 5.1 is fine. I presume this is a 4.x-only problem.
Comment on attachment 8774371 [details]
Bug 1289140 - Make LauncherActivity use the main taskAffinity;

Sebastian, do you mind taking a look at this (or passing it on)? I think you might have more context.
Attachment #8774371 - Flags: review?(michael.l.comella) → review?(s.kaspari)
Comment on attachment 8774371 [details]
Bug 1289140 - Make LauncherActivity use the main taskAffinity;

https://reviewboard.mozilla.org/r/66848/#review64424

I wonder if we actually want android:excludeFromRecents="true" here. I was afraid that attaching the LauncherActivity to a specific task will break custom tabs support; which will open the launcher activity from different tasks. But testing this on Android 4.4 and Android N it seems to work just fine.
Attachment #8774371 - Flags: review?(s.kaspari) → review+
Reporter

Comment 6

3 years ago
My early attempt suggests that adding android:excludeFromRecents="true" to the LauncherActivity doesn't solve this problem.
(In reply to SUN Haitao from comment #6)
> My early attempt suggests that adding android:excludeFromRecents="true" to
> the LauncherActivity doesn't solve this problem.

It did help in my tests as far as I remember. With the added taskAffinity entry it seems like bug 1280112 is unfixable. With the taskAffinity attribute set I'm unable to resume the existing activity - no matter what flags I use.
Reporter

Comment 8

3 years ago
I find the whole situation is:. 

0. Using android:excludeFromRecents="true" DO hide the LauncherActivity. 
1. But it also make the main activity disappear (This is why I didn't pick it earlier).

So I'm afraid it is not a practical solution.
Reporter

Comment 9

3 years ago
Should we land this or wait a while?
Flags: needinfo?(s.kaspari)
I would like to investiage if we can find a different solution. With this patch applied I can't fix bug 1280112 anymore.

(In reply to SUN Haitao from comment #8)
> 0. Using android:excludeFromRecents="true" DO hide the LauncherActivity. 
> 1. But it also make the main activity disappear (This is why I didn't pick
> it earlier).

I didn't see this on a 4.4 emulator, I think. What device have you been using?
Reporter

Comment 11

3 years ago
In that case, let's finish bug 1280112 first.

(In reply to Sebastian Kaspari (:sebastian) from comment #10)
> I didn't see this on a 4.4 emulator, I think. What device have you been
> using?

I found this on a Huawei Che1-CL10.
Reporter

Updated

3 years ago
Depends on: 1280112
Flags: needinfo?(s.kaspari)
Priority: -- → P1
(In reply to SUN Haitao from comment #11)
> I found this on a Huawei Che1-CL10.

Can you test on this device a patch that:
* Uses a different taskAffinity (pick randomly)
* And uses excludeFromRecents

And can you test a patch that:
* Uses a different askAffinity (or none!)
* And call finishAffinity() instead of finish() in LauncherActivity
Flags: needinfo?(sunhaitao)
Reporter

Comment 13

3 years ago
I'll do this as soon as possible, but it may be a couple of days later for I am extraordinary busy recently.
Flags: needinfo?(sunhaitao)
Reporter

Comment 14

3 years ago
The former method hides both. The latter one hides none.
(In reply to SUN Haitao from comment #14)
> The latter one hides none.

No matter if different or no taskAffinity in manifest?
Reporter

Comment 16

3 years ago
> No matter if different or no taskAffinity in manifest?

Yes. But removing the taskAffinity property of the main activity does work.
Flags: needinfo?(s.kaspari)
Comment on attachment 8789699 [details]
Bug 1289140 - LauncherActivity: Exclude from recents and filter flags.

Can you test this patch on your device for me? It works with an Android 4 emulator and bug 1280112 is still fixed with it too.
Flags: needinfo?(s.kaspari)
Attachment #8789699 - Flags: feedback?(sunhaitao)
I cannot confirm whether bug 1280112 remains fixed or not, but the superfluous launcher entry is no longer present on my phone (S3 Mini, Android 4.1.2).
Reporter

Comment 20

3 years ago
Comment on attachment 8789699 [details]
Bug 1289140 - LauncherActivity: Exclude from recents and filter flags.

It works well.
Attachment #8789699 - Flags: feedback?(sunhaitao) → feedback+
Reporter

Comment 21

3 years ago
We may need test this on Android 6 before landing. Due to a regression, using "@android:style/Theme.NoDisplay" cause crash sometimes.
Thanks for testing! I'll create a patch for landing. I'll remove the theme change from the patch too. This was an optimization that is not needed for this bug fix.
Assignee: sunhaitao → s.kaspari
Status: NEW → ASSIGNED
Attachment #8774371 - Attachment is obsolete: true
Comment hidden (mozreview-request)

Comment 24

3 years ago
mozreview-review
Comment on attachment 8789699 [details]
Bug 1289140 - LauncherActivity: Exclude from recents and filter flags.

https://reviewboard.mozilla.org/r/77836/#review79498
Attachment #8789699 - Flags: review?(ahunt) → review+

Comment 25

3 years ago
Pushed by s.kaspari@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/75416b1f0938
LauncherActivity: Exclude from recents and filter flags. r=ahunt
Comment on attachment 8789699 [details]
Bug 1289140 - LauncherActivity: Exclude from recents and filter flags.

Approval Request Comment

[Feature/regressing bug #]: Regression introduced in bug 1276696.

[User impact if declined]: On some Android versions, when starting Firefox, users will see an additional, black app in the list of recent apps.

[Describe test coverage new/current, TreeHerder]: Local testing on devices / emulator.

[Risks and why]: Low - this should only affect the startup behavior and there's no obvious problem. After a couple of days in Nightly we should be sure that there is no issue.

[String/UUID change made/needed]: -
Attachment #8789699 - Flags: approval-mozilla-beta?
Attachment #8789699 - Flags: approval-mozilla-aurora?

Comment 27

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/75416b1f0938
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Comment on attachment 8789699 [details]
Bug 1289140 - LauncherActivity: Exclude from recents and filter flags.

Let's stabilize this on Aurora51 and uplift to Beta50 in a few days.
Attachment #8789699 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Hello SUN, could you please verify this issue is fixed as expected on a latest Nightly build? Thanks!
Flags: needinfo?(sunhaitao)
Comment on attachment 8789699 [details]
Bug 1289140 - LauncherActivity: Exclude from recents and filter flags.

Stabilized on Aurora for a few days, Beta50+
Attachment #8789699 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Needs rebasing for Beta.
Flags: needinfo?(s.kaspari)
This is the updated patch for Beta. I can't build beta locally currently, so I triggered a try build (see comment 33).
Flags: needinfo?(s.kaspari)
Reporter

Comment 35

3 years ago
Recent nightly builds do work as expected on this subject.
Flags: needinfo?(sunhaitao)
Trying the steps from Bug 1204424, I see only one Nightly instance in task manager, so:
Verified as fixed using:
Device: Moto X (Android 4.4.4)
Build: Firefox for Android 52.0a1 (2016-10-02)
Hello, tried to reproduce this issue using a Motorola RAZR XT910 (Android 4.4.4) and I was not able to reproduce the issue.

Build: Firefox for Android 51.0b2
You need to log in before you can comment on or make changes to this bug.