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

Issue 679972 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Component Updater Should use GcmNetworkManager on Android

Project Member Reported by agrieve@chromium.org, Jan 11 2017

Issue description

Component Updater currently uses in-app timers to schedule update checks. This is not ideal on Android because it would be better to do such checks during OS maintenance windows.

References:
CrxUpdateService::Start()
https://cs.chromium.org/chromium/src/components/component_updater/component_updater_service.cc
https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmNetworkManager
 

Comment 1 by bauerb@chromium.org, Jan 13 2017

Cc: bauerb@chromium.org
Owner: waff...@chromium.org
If GcmNetworkManager does not fit, see if we want to use JobScheduler instead, which is available on Android L+.
Cc: sorin@chromium.org
See issue 680757 for some extra information.

Comment 5 by sorin@chromium.org, Jan 13 2017

I only glanced at this request but it seems to me that Chrome needs to be redesigned to allow for these background services and have the component updater somehow subscribe to some kind of notification that it is appropriate to initiate an update check.

I think that having the component updater invoke or depend on Android features directly would be a non-starter.
Cc: yfried...@chromium.org
"I think that having the component updater invoke or depend on Android features directly would be a non-starter."

I disagree. Tons of chrome on android functionality depends directly on Android features (e.g. sync, invalidations, push message just to name a few that involve background data/triggering). In this case it's about reasonable battery, network and resource utilization on a constrained device and that's something we should prioritize.

Comment 7 by sorin@chromium.org, Jan 17 2017

In reply to #6, the component updater code lives inside the Chrome browser process. Could you please suggest a concrete way of triggering an update check or an example we could follow? Thank you!
If you want to target Android L+ as a special case, you could also depend directly on JobScheduler. See https://codereview.chromium.org/2611333002/ for an example for such a conversion from startService() to JobScheduler.

Comment 10 by sorin@chromium.org, Jan 23 2017

Cc: gab@chromium.org
+gab

We agree that this feature is desirable and we would look for a way to make it happen. 

Gab, would it be possible to extend the new Lucky Luke task scheduler to support triggering execution on JobScheduler or equivalent?

As I said above, in the component updater we prefer to depend on abstractions instead of specific platform APIs. The Chrome component updater is mostly a platform neutral component, and we like it this way.
Cc: jkrcal@chromium.org
It should be possible to abstract something relatively generic, like "call me back in X seconds" and have that be implemented with a base::Timer on desktop and GcmNetworkManager / JobScheduler on Android. Zine (Content Suggestions) lives in a platform-independent component but calls out to Android for scheduling its updates in the background. Also, +jkrcal, as this seems relevant to his interests :)
Note that for JobScheduler, it would be more appropriate to have Component Update request:
"call me after a minimum of 10 minutes, and only when there is network connectivity and device is charging. If the device does not get plugged in within 5 hours, call me back regardless (but still only while there's a network connection."

It's also the case that to use JobScheduler, you have to be able to survive a process restart, so you can't just use a regular callback as the interface.

Comment 13 by gab@chromium.org, Jan 23 2017

Cc: brucedaw...@chromium.org
Components: Internals>TaskScheduler
Having TaskTraits that allows posting delayed tasks with such level of detail would be a great fit for base/task_scheduler/post_task.h. Any idea how prominent such tasks are and how having a generic base API for this could help improve power and data usage across platforms?
I don't know how common such tasks are, and it's hard to estimate how much power would be saved - sorry, no guesses.
Cc: tiborg@chromium.org
Status: Assigned (was: Available)

Sign in to add a comment