Closed Bug 1205597 Opened 9 years ago Closed 9 years ago

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

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mhaigh, Assigned: sebastian)

References

Details

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
Blocks: android-m
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
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"
Assignee: mhaigh → s.kaspari
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.
See Also: → 1205216
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
Closed: 9 years ago
Resolution: --- → FIXED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.