New issue
Advanced search Search tips

Issue 823341 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Task



Sign in to add a comment

Enable FLAG_RECEIVER_FOREGROUND for notification taps on Android N too

Project Member Reported by awdf@chromium.org, Mar 19 2018

Issue description

This flag ensures that the broadcast receiver for notification taps gets foreground priority upon receiving the broadcast intent, which should help with reports of Chrome being slow to open upon web notification clicks.

We set the flag in NotificationPlatformBridge.java in the makePendingIntent method, here:

https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java?l=343

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
        }

We ended up only setting the flag on Android O to reduce risk when merging the fix after branch point to M63 - see  Issue 764437 .

Now that the flag has been enabled for a while in stable with no issues observed, let's enable it on Android N too.

See discussion on  Issue 764437  and internal bug b/67675286 for more context.
 

Comment 1 by awdf@chromium.org, Mar 19 2018

Owner: rayankans@chromium.org
Status: Assigned (was: Available)
Status: Fixed (was: Assigned)

Comment 3 by awdf@chromium.org, Mar 22 2018

Looking at the JobStartDelay stats, O is currently much healthier than N - which is somewhat expected since O devices will probably be newer and faster, and there's a much smaller userbase, but such a big difference strongly suggests the flag is indeed having a big effect:

Android O - ~99% of notifications have a delay of <500ms
https://uma.googleplex.com/p/chrome/histograms/?endDate=20180320&dayCount=1&histograms=Notifications.Android.JobStartDelay&fixupData=true&showMax=true&filters=platform%2Ceq%2CA%2Cchannel%2Ceq%2C4%2Cosflavor%2Ceq%2CAndroid_N%2Cisofficial%2Ceq%2CTrue&implicitFilters=isofficial

vs

Android N - 15% of notifications on N have a delay of >3 min.
https://uma.googleplex.com/p/chrome/histograms/?endDate=20180320&dayCount=1&histograms=Notifications.Android.JobStartDelay&fixupData=true&showMax=true&filters=platform%2Ceq%2CA%2Cchannel%2Ceq%2C4%2Cosflavor%2Ceq%2CAndroid_O%2Cisofficial%2Ceq%2CTrue&implicitFilters=isofficial

we should see if we can cherry-pick r968872 to M66 if Canary stats shows that the delay decreases with the change Rayan made to enable the flag on N too.

Rayan can you go to go/chromium-dash and see which Canary build your change made it into?

Comment 4 by awdf@chromium.org, Mar 23 2018

Sign in to add a comment