When adding website to homes screen, no notification of success/failure is presented

VERIFIED FIXED in Firefox 52

Status

()

Firefox for Android
Web Apps
VERIFIED FIXED
2 years ago
8 months ago

People

(Reporter: barbara, Assigned: nechen, Mentored)

Tracking

(Blocks: 1 bug)

unspecified
Firefox 53
Points:
---

Firefox Tracking Flags

(firefox52+ verified, firefox-esr52 fixed, firefox53 verified)

Details

(Whiteboard: [lang=java][good next bug])

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(4 attachments)

I tried adding a few sites on my Nexus 9 tablet to my home screen.

Clicked, Settings-Page-Add to Home Screen, but after that no notification showed up if it actually added it to the home screen. I would assume a little snackbar or toast to indicate that the site was added to my home screen.
(Reporter)

Updated

2 years ago
Summary: When adding website to homes creen, no notification of success/failure is presented → When adding website to homes screen, no notification of success/failure is presented

Comment 1

2 years ago
This sounds like a good progressive apps enhancement.
Blocks: 1212648
See Also: → bug 1232706
For the promotion in bug 1232706 we are considering switching from the app to the home screen when creating a shortcut.

@antlam: I guess we should do the same when creating the shortcut from the menu?

Showing a toast or snackbar might not be suitable because some versions of Android already show a toast if a shortcut is created - see bug 1260143. This would require that we carefully investigate what versions do show the toast and only show our visual feedback on the others.
Flags: needinfo?(alam)
See Also: → bug 1260143

Comment 4

2 years ago
(In reply to Sebastian Kaspari (:sebastian) from comment #3)

> Showing a toast or snackbar might not be suitable because some versions of
> Android already show a toast if a shortcut is created - see bug 1260143.
> This would require that we carefully investigate what versions do show the
> toast and only show our visual feedback on the others.

This sounds fragile and difficult to get right.
(In reply to Sebastian Kaspari (:sebastian) from comment #3)
> For the promotion in bug 1232706 we are considering switching from the app
> to the home screen when creating a shortcut.
> 
> @antlam: I guess we should do the same when creating the shortcut from the
> menu?

yes!
Flags: needinfo?(alam)
Mentor: s.kaspari
Whiteboard: [lang=java][good next bug]
(Assignee)

Updated

2 years ago
Assignee: nobody → cnevinchen
(Assignee)

Comment 6

2 years ago
After a day of investigation , I found that there are couple of reasons why sometimes the toast is shown on some device/OS version combination :

1. Each manufacturer (HTC, Samsung ,Sony...) they all have their own launcher app. And some of them will response to "com.android.launcher.action.INSTALL_SHORTCUT" intent. Take HTC M7 for example , if you trace logact using `adb logcat -b main -b events | egrep -i "toast"` , you'll find that they'll send out toast from their Launcher app (toast_enqueue: [com.htc.launcher,0])

2. Even in the sample Launcher app in AOSP have different implementation. (Launcher, Launcher2, Launcher3 )
e.g. Launcher in AOSP , adding shortcut will toast
https://android.googlesource.com/platform/packages/apps/Launcher/+/master/src/com/android/launcher/InstallShortcutReceiver.java#26
e.g. Launcher2 in 5 & 6, there's only toast for duplicated and no space use case
http://androidxref.com/5.0.0_r2/xref/packages/apps/Launcher2/src/com/android/launcher2/InstallShortcutReceiver.java#174
http://androidxref.com/6.0.0_r5//xref/packages/apps/Launcher2/src/com/android/launcher2/InstallShortcutReceiver.java#256
e.g. Launcher3 in 6.0 there's no toast at all
http://androidxref.com/6.0.0_r5/xref/packages/apps/Launcher3/src/com/android/launcher3/InstallShortcutReceiver.java#144

3. In Chrome, a toast will always be shown when the user create a shortcut (although it will cause duplicated toast for some brand/OS combination)
https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java?q=ShortcutHelper.java&sq=package:chromium&dr&l=213


In brief, I suggest not sending any toast since we don't have the control of shortcut creation. Take Chrome on HTC for example, if you don't have enough space on mobile desktop, although you see a "shortcut was added to your Home screen" toast, the HTC device will toast and tell you "No more room for your Home screens". That will confuse the user(Please see the screen shots in the attachment)
Flags: needinfo?(s.kaspari)
(Assignee)

Comment 7

2 years ago
Created attachment 8813083 [details]
Screenshot_20161122-172145.png
Attachment #8813083 - Flags: review?(s.kaspari)
(Assignee)

Comment 8

2 years ago
Created attachment 8813086 [details]
Screenshot_20161122-172155.png
Attachment #8813086 - Flags: review?(s.kaspari)
Yeah, I agree, a toast might not be a good idea if some home launchers already show a toast.

In the "Add to home screen" prompt experiment we just send the user to the home screen and then the launcher icon usually just appears (or a toast in the case of an error) - What do you think, might this be an option there too? Would be interesting to know whether this works with the different launchers.

https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/promotion/HomeScreenPrompt.java#131-142
Flags: needinfo?(s.kaspari)
Attachment #8813083 - Flags: review?(s.kaspari)
Attachment #8813086 - Flags: review?(s.kaspari)
(Assignee)

Comment 10

2 years ago
That's a good idea. I'll test your approach on different devices tomorrow
Flags: needinfo?(s.kaspari)
I guess adding the flag was an accident or did you have a question? :)
Flags: needinfo?(s.kaspari)
(Assignee)

Comment 12

2 years ago
(In reply to Sebastian Kaspari (:sebastian) from comment #11)
> I guess adding the flag was an accident or did you have a question? :)

Sorry. Just an accident. :P
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 15

2 years ago
mozreview-review
Comment on attachment 8813937 [details]
Bug 1240560 - Extract goToHomeScreen() method to AcitvityUtils

https://reviewboard.mozilla.org/r/95238/#review95486

::: mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ActivityUtils.java:70
(Diff revision 1)
> +
> +        activity.finish();

I think the call to finish() should not be part of the helper method:

* When showing the prompt we want to "close" it as soon as the launcher icon has been created.
* For BrowserApp we just want to switch to the home screen but do not need to finish the activity.
Attachment #8813937 - Flags: review?(s.kaspari)

Comment 16

2 years ago
mozreview-review
Comment on attachment 8813938 [details]
Bug 1240560 - After shortcut is created, show the mobile desktop.

https://reviewboard.mozilla.org/r/95240/#review95488
Attachment #8813938 - Flags: review?(s.kaspari) → review+
Comment hidden (mozreview-request)

Comment 18

2 years ago
mozreview-review
Comment on attachment 8813937 [details]
Bug 1240560 - Extract goToHomeScreen() method to AcitvityUtils

https://reviewboard.mozilla.org/r/95238/#review95498

Okay, this makes sense now. But looking at the individual commits is a bit confusing. The first one moves the finish call to the utility method and the second one removes it again. Would have been more clear to update the first commit. However I r+ already. :)
Attachment #8813937 - Flags: review+
(Assignee)

Comment 19

2 years ago
Thank you for the reminder. I'll be more careful in the future.
(Assignee)

Updated

2 years ago
Keywords: checkin-needed

Comment 20

2 years ago
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/df6b2f629500
Extract goToHomeScreen() method to AcitvityUtils r=sebastian
https://hg.mozilla.org/integration/autoland/rev/c08d0aa688dc
After shortcut is created, show the mobile desktop. r=sebastian
Keywords: checkin-needed

Comment 21

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/df6b2f629500
https://hg.mozilla.org/mozilla-central/rev/c08d0aa688dc
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox53: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 53
Hello, I've verified this on a Nexus 9 tablet (Android 7.0) and it is indeed taking me to the home screen where the shortcut is created.
status-firefox53: fixed → verified
I'm seeing this on 52.0b4 too(lack of notifications when adding to home screen). Should an uplift be performed to beta too(is it too risky) or should we let it ride the train?
Flags: needinfo?(s.kaspari)
[Tracking Requested - why for this release]: we have a fix, uplifting it may make sense
status-firefox52: --- → affected
tracking-firefox52: --- → ?
(Assignee)

Comment 25

a year ago
Comment on attachment 8813937 [details]
Bug 1240560 - Extract goToHomeScreen() method to AcitvityUtils

Approval Request Comment
[Feature/Bug causing the regression]: We should let the user knows adding to home screen is completed.
[User impact if declined]: Users may be confused if anything is added to home screen.
[Is this code covered by automated tests?]: no
[Has the fix been verified in Nightly?]: yes
[Needs manual test from QE? If yes, steps to reproduce]: no
[List of other uplifts needed for the feature/fix]: yes
https://bugzilla.mozilla.org/attachment.cgi?id=8813938
[Is the change risky?]: no
[Why is the change risky/not risky?]: It's a simple fix.
[String changes made/needed]: no
Attachment #8813937 - Flags: approval-mozilla-beta?
(Assignee)

Comment 26

a year ago
Comment on attachment 8813938 [details]
Bug 1240560 - After shortcut is created, show the mobile desktop.

Approval Request Comment
[Feature/Bug causing the regression]:
[User impact if declined]:
[Is this code covered by automated tests?]:
[Has the fix been verified in Nightly?]:
[Needs manual test from QE? If yes, steps to reproduce]: 
[List of other uplifts needed for the feature/fix]:
[Is the change risky?]:
[Why is the change risky/not risky?]:
[String changes made/needed]:

Approval Request Comment
[Feature/Bug causing the regression]: We should let the user knows adding to home screen is completed.
[User impact if declined]: Users may be confused if anything is added to home screen.
[Is this code covered by automated tests?]: no
[Has the fix been verified in Nightly?]: yes
[Needs manual test from QE? If yes, steps to reproduce]: no
[List of other uplifts needed for the feature/fix]: yes
https://bugzilla.mozilla.org/attachment.cgi?id=8813937
[Is the change risky?]: no
[Why is the change risky/not risky?]: It's a simple fix.
[String changes made/needed]: no
Attachment #8813938 - Flags: approval-mozilla-beta?
tracking-firefox52: ? → +
Comment on attachment 8813937 [details]
Bug 1240560 - Extract goToHomeScreen() method to AcitvityUtils

prerequisite for next patch, beta52+
Attachment #8813937 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Comment on attachment 8813938 [details]
Bug 1240560 - After shortcut is created, show the mobile desktop.

visual clue when adding a shortcut to home screen, beta52+
Attachment #8813938 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Hello, 

I've verified this on 52.0b5 using a Galaxy Note 4 (Android 5.0.1).
status-firefox52: fixed → verified
Flags: needinfo?(s.kaspari)

Updated

8 months ago
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.