[SPIKE] See if we can get heads up notifications working with tab queue

RESOLVED FIXED

Status

()

RESOLVED FIXED
3 years ago
2 years ago

People

(Reporter: mhaigh, Assigned: sebastian)

Tracking

(Blocks: 2 bugs)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
Because Android M makes it more difficult to use "Draw over" permissions (see bug 1205216) we need to try and find alternate ways of conveying the same info. One possible approach is to use "heads up" notifications which were introduced in Android 5 (http://developer.android.com/guide/topics/ui/notifiers/notifications.html#Heads-up)

One issue with "heads up" notifications are the restrictions:
* the current app must be full screen (we can't count on that)
* the notification must be high priority and use vibration or ringtone (we could try using a vibration)

Let's see if we can get a working prototype

Updated

3 years ago
Blocks: 1169425
(Reporter)

Comment 1

3 years ago
Here's an early prototype demonstrating the heads up notification.  This one has a short vibration set to fire when adding a link : https://dl.dropboxusercontent.com/u/7163922/Work/1205597-vibration.apk

Note - this only demonstrates that we can are able to wrangle the system to display the notification in a 'heads up' style, but this doesn't guarantee that it will happen.    Looking at [1] and [2] the documentation uses phrases such as "A notification that is noisy is more likely to be presented as a heads-up notification" - hence we can make it more likely by adding a vibrate pattern and audio, but not guarantee this functionality.

Note: the audio in this example is a 0.1 second silent notification.  Because this technically is still audio, this example will work without the vibrate pattern.

Also note that this isn't a fully functioning demo, tab queues doesn't work and the action button on the notification doesn't do anything.

1, http://developer.android.com/reference/android/app/Notification.Builder.html#setVibrate%28long[]%29
2, http://developer.android.com/reference/android/app/Notification.Builder.html#setSound%28android.net.Uri%29
(Reporter)

Comment 2

3 years ago
Here's a version which doesn't vibrate: https://dl.dropboxusercontent.com/u/7163922/Work/1205597-no-vibrate.apk
Some of the relevant comments via email:

 - How reliable is this workaround?
 - Another possible solution to addressing this would be working on better linking to System Settings for users to "Permit drawing over other apps"

Updated

3 years ago
Blocks: 1158260
(Reporter)

Updated

3 years ago
Assignee: mhaigh → s.kaspari
(Assignee)

Comment 4

3 years ago
I recently played with Facebook (Messenger) because they already set targetSdkVersion=23. Interestingly they completely hide all "chat heads" settings and just use heads-up notifications on Android 6. If you actually go deep into Android's settings and enable "Draw over other apps" for Facebook then "chat heads" are used again and all settings for them appear. Either they are transitioning away from overlays or they have not solved the on-boarding problem yet.
(Assignee)

Updated

3 years ago
See Also: → bug 1205216
(Assignee)

Comment 5

3 years ago
I'm closing this now: We did our research. We could use Heads Up notifications (with some tricks though) for tab queues. But our current plan is to use the overlay on all Android versions and use notifications and other mechanisms for getting the user to opt-in. (-> bug 1205216).
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
(Assignee)

Updated

2 years ago
Duplicate of this bug: 1369295
You need to log in before you can comment on or make changes to this bug.