WebLayer: hook up MediaSession.
This adds the glue code for MediaSession to work in WebLayer. A new Service class is required in the client library to display the notification. This service proxies lifetime events to WebLayer implementation, which then glues together componentized code. Of note: 1. notifications displayed with Service#startForeground cannot have a tag, so the ID must be unique across all application notifications. There's a default ID for the MediaSession notification, but an API is also added to WebLayer to allow setting a different ID, in case this one conflicts. 2. favicons are not supported (normally they'd be used as fallbacks for iconography/images not provided by the system) 3. Extra handling is required for the action button icons to work, see WebLayerNotificationBuilder. On L, we fall back to system icons, which look bad because of their low resolution, but are at least functional. https://googlechrome.github.io/samples/media-session/ Test: automated tests TODO; manual testing on Bug: 1066263 Change-Id: I5e2ae13a07315e73aae474251cb5c0424804a427 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2220551Reviewed-by:Scott Violet <sky@chromium.org> Reviewed-by:
Clark DuVall <cduvall@chromium.org> Commit-Queue: Evan Stade <estade@chromium.org> Cr-Commit-Position: refs/heads/master@{#782054}
Showing
Please register or sign in to comment