Commit 7ebe5955 authored by Mugdha Lakhani's avatar Mugdha Lakhani Committed by Commit Bot

[Background Sync] Revert changes to ChromeBackgroundService.

A recent CL added some logic based on a feature being enabled
in ChromeBackgroundService:
https://chromium-review.googlesource.com/c/chromium/src/+/1432840

However, since the native JNI library might not be loaded at this point,
the feature check can't be done -- it causes a crash.
This CL takes out logic to ChromeBackgroundService, to be re-introduced
when BackgroundTaskSchedulerForBackgroundSync feature is enabled
everywhere.

Bug: 924490, 932468
Change-Id: Ia1930c76a36e88a2a2bc53be96582123118ddc97
Reviewed-on: https://chromium-review.googlesource.com/c/1474655
Commit-Queue: Tommy Nyquist <nyquist@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Reviewed-by: default avatarTommy Nyquist <nyquist@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632720}
parent 989ca932
......@@ -14,7 +14,6 @@ import org.chromium.base.Log;
import org.chromium.base.ThreadUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.library_loader.ProcessInitException;
import org.chromium.chrome.browser.background_sync.BackgroundSyncBackgroundTaskScheduler;
import org.chromium.chrome.browser.init.ChromeBrowserInitializer;
import org.chromium.chrome.browser.init.ServiceManagerStartupUtils;
import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge;
......@@ -71,14 +70,6 @@ public class ChromeBackgroundService extends GcmTaskService {
}
private void handleBackgroundSyncEvent(Context context, String tag) {
if (ChromeFeatureList.isEnabled(
ChromeFeatureList.BACKGROUND_TASK_SCHEDULER_FOR_BACKGROUND_SYNC)) {
// If BackgroundTaskScheduler has been used to schedule a background
// task for Background Sync, we simply reschedule the existing task(s).
BackgroundSyncBackgroundTaskScheduler.getInstance().reschedule();
return;
}
if (!BackgroundSyncLauncher.hasInstance()) {
// Start the browser. The browser's BackgroundSyncManager (for the active profile) will
// start, check the network, and run any necessary sync events. This task runs with a
......
......@@ -23,8 +23,6 @@ import org.chromium.base.test.util.RetryOnFailure;
import org.chromium.chrome.browser.ntp.snippets.SnippetsLauncher;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import java.util.HashMap;
/**
* Tests {@link ChromeBackgroundService}.
*/
......@@ -80,13 +78,9 @@ public class ChromeBackgroundServiceTest {
@Before
public void setUp() throws Exception {
HashMap<String, Boolean> features = new HashMap<String, Boolean>();
features.put(ChromeFeatureList.BACKGROUND_TASK_SCHEDULER_FOR_BACKGROUND_SYNC, false);
ChromeFeatureList.setTestFeatures(features);
BackgroundSyncLauncher.setGCMEnabled(false);
mSyncLauncher = BackgroundSyncLauncher.create();
RecordHistogram.setDisabledForTests(true);
mSyncLauncher = BackgroundSyncLauncher.create();
mSnippetsLauncher = SnippetsLauncher.create();
mTaskService = new MockTaskService();
}
......
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