New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 711730 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Android MediaRouter only (left Chro...
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

Android crashes because of Chrome's media notification

Reported by timmy14...@gmail.com, Apr 14 2017

Issue description

Steps to reproduce the problem:
1. Create and play an audio element which source is a stream
2. Constantly change the title (by appending to it)

What is the expected behavior?

What went wrong?
As chrome on android wants to keep the media notification's title the same as the site's title it will slow down the app, fill the device's ram, and eventually crash the device.

Did this work before? N/A 

Chrome version: 57.0.2987.132  Channel: stable
OS Version: 4.4.2
Flash Version: 

I figured out that you can actually prevent your device from crashing by terminating chrome as long as you can.
 
I have a minimalistic working example at playground.timmyrs.de/rip
Components: -Blink Blink>Media
Status: Untriaged (was: Unconfirmed)
Works on Android 6, too. However, not on iPhone, as they don't seem to have that notification.
Cc: mlamouri@chromium.org
Components: -Blink>Media Internals>Media>UI
Labels: -Pri-2 M-59 Pri-1
Owner: zqzh...@chromium.org
Status: Assigned (was: Untriaged)
We should throttle the frequency of notification update. Otherwise System UI is refreshing all the time causing this failure.
Status: Started (was: Assigned)
1. It could be something Issue 346215?
2. Second I think we should just sanitize the title (and other fields we use in the notification) somewhere so we don't allocate too much ram to store it?

Throttling notification updates sounds like just delaying the OOM issue and also something I haven't heard of any other app/browser doing?
Chrome is slowed down heavily just by 10 notification updates per seconds, even if they do not occupy as much RAM, so I think limiting the notification updates would be the best to prevent chrome from crashing.
> 1. It could be something Issue 346215?

Could be similar, but this time it's Android who didn't GC the memory properly

> 2. Second I think we should just sanitize the title (and other fields we use in the notification) somewhere so we don't allocate too much ram to store it?

It is actually limited to 4096 but we can sanitize a second time. Also I don't think long title is the real cause, it should be related to GC'ing RemoteViews.

> Throttling notification updates sounds like just delaying the OOM issue and also something I haven't heard of any other app/browser doing?

I think ideally this should be fixed by the Android framework, but throttling on our side makes sense as it also reduces the UI jankiness. Updating the notification in such a frequency already makes the System UI unusable.
Also, when the notification is updated so frequently, the media buttons is unclickable on some Android versions
Filed b/37536584 for tracking by the Android framework team
Owner: mlamouri@chromium.org
Project Member

Comment 14 by bugdroid1@chromium.org, Apr 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bf4103d69a0d7e289266c9671c2b980d585c0d5a

commit bf4103d69a0d7e289266c9671c2b980d585c0d5a
Author: zqzhang <zqzhang@chromium.org>
Date: Mon Apr 24 16:28:56 2017

[Media>UI] Apply throttling if the notification is updated too frequently

There's a issue where the notification is updated too frequently
(especially when the media metadata or fallback media metadata changes),
which can cause the system UI to be very janky or even a system crash.
This CL throttles the notification update if the notification has been
updated during the previous 500ms.

BUG= 711730 

Review-Url: https://codereview.chromium.org/2833493002
Cr-Commit-Position: refs/heads/master@{#466651}

[modify] https://crrev.com/bf4103d69a0d7e289266c9671c2b980d585c0d5a/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java
[modify] https://crrev.com/bf4103d69a0d7e289266c9671c2b980d585c0d5a/chrome/android/java_sources.gni
[modify] https://crrev.com/bf4103d69a0d7e289266c9671c2b980d585c0d5a/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationActionsUpdatedTest.java
[modify] https://crrev.com/bf4103d69a0d7e289266c9671c2b980d585c0d5a/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationManagerTestBase.java
[add] https://crrev.com/bf4103d69a0d7e289266c9671c2b980d585c0d5a/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationManagerThrottlerTest.java
[modify] https://crrev.com/bf4103d69a0d7e289266c9671c2b980d585c0d5a/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationTitleUpdatedTest.java
[modify] https://crrev.com/bf4103d69a0d7e289266c9671c2b980d585c0d5a/content/browser/media/session/media_session_impl.cc

Cc: avayvod@chromium.org
Owner: zqzh...@chromium.org
Status: Fixed (was: Started)
verified in M60 -60.0.3086.0 build

Sign in to add a comment