Commit a125b086 authored by Paul Miller's avatar Paul Miller Committed by Commit Bot

Work around null JobScheduler in WebView service

BUG=968636

Change-Id: Ic838ed2cbb1c0725cc7c579c10c77e7a5323428e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1639106
Commit-Queue: Paul Miller <paulmiller@chromium.org>
Reviewed-by: default avatarTao Bai <michaelbai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#665587}
parent 092b8500
...@@ -76,12 +76,15 @@ public class AwVariationsSeedFetcher extends JobService { ...@@ -76,12 +76,15 @@ public class AwVariationsSeedFetcher extends JobService {
private static JobScheduler getScheduler() { private static JobScheduler getScheduler() {
if (sMockJobScheduler != null) return sMockJobScheduler; if (sMockJobScheduler != null) return sMockJobScheduler;
// This may be null due to vendor framework bugs. https://crbug.com/968636
return (JobScheduler) ContextUtils.getApplicationContext().getSystemService( return (JobScheduler) ContextUtils.getApplicationContext().getSystemService(
Context.JOB_SCHEDULER_SERVICE); Context.JOB_SCHEDULER_SERVICE);
} }
public static void scheduleIfNeeded() { public static void scheduleIfNeeded() {
JobScheduler scheduler = getScheduler(); JobScheduler scheduler = getScheduler();
if (scheduler == null) return;
// Check if it's already scheduled. // Check if it's already scheduled.
if (getPendingJob(scheduler, JOB_ID) != null) { if (getPendingJob(scheduler, JOB_ID) != null) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment