Browse Source

Remove dependency on Google Play GCM library

tags/75.0.3770.142-2
wchen342 2 years ago
parent
commit
cb331f5cdb
Signed by: wchen342 GPG Key ID: 720B70365E800508
3 changed files with 487 additions and 21 deletions
  1. +1
    -1
      android_flags.debug.gn
  2. +19
    -9
      misc/android_studio_setup.sh
  3. +467
    -11
      patches/ungoogled-chromium-android/remove_gms_gcm.patch

+ 1
- 1
android_flags.debug.gn View File

@ -16,7 +16,7 @@ enable_reporting=false
enable_service_discovery=false
enable_swiftshader=false
enable_widevine=true
exclude_unwind_tables=true
exclude_unwind_tables=false
fatal_linker_warnings=false
fieldtrial_testing_like_official_build=true
google_api_key=""


+ 19
- 9
misc/android_studio_setup.sh View File

@ -14,21 +14,31 @@ pushd third_party
ln -s ../../depot_tools
popd
# Need different GN flags than a release build
mkdir -p out/Debug
cat ../android_flags.debug.gn ../android_flags.gn > out/Debug/args.gn
# Run gn first
tools/gn/out/gn gen out/Debug --fail-on-unused-args
## Set compiler flags
export AR=${AR:=llvm-ar}
export NM=${NM:=llvm-nm}
export CC=${CC:=clang}
export CXX=${CXX:=clang++}
# Need different GN flags than a release build
output_folder=out/Debug_apk
mkdir -p ${output_folder}
cat ../android_flags.debug.gn ../android_flags.gn > ${output_folder}/args.gn
# Run gn first
tools/gn/out/gn gen ${output_folder} --fail-on-unused-args
# Compile apk
ninja -C out/Debug ${target}
ninja -C ${output_folder} ${target}
###
# Develop folder
output_folder=out/Debug
mkdir -p ${output_folder}
cat ../android_flags.debug.gn ../android_flags.gn > ${output_folder}/args.gn
# Run gn first
tools/gn/out/gn gen ${output_folder} --fail-on-unused-args
# Generate gradle files
python build/android/gradle/generate_gradle.py --target //chrome/android:${target} --output-directory out/Debug
python build/android/gradle/generate_gradle.py --target //chrome/android:${target} --output-directory ${output_folder}

+ 467
- 11
patches/ungoogled-chromium-android/remove_gms_gcm.patch View File

@ -1,13 +1,19 @@
Remove dependency on com.google.android.gms.gcm (play-services-gcm-15.0.1.aar).
It also disalbes Snippets, auto-update of offline pages and launching browser from background service.
The snippets are already disabled in native codes, this will disable it on Java level.
author: Wengling Chen <[email protected]>
---
chrome/android/BUILD.gn | 2 -
chrome/android/java/AndroidManifest.xml | 60 --------
.../chrome/browser/BackgroundSyncLauncher.java | 64 +-------
.../chrome/browser/ChromeBackgroundService.java | 96 +-----------
.../invalidation/InvalidationController.java | 8 +-
.../services/gcm/ChromeGcmListenerService.java | 57 +------
.../browser/ntp/snippets/SnippetsLauncher.java | 59 +-------
.../services/gcm/ChromeGcmListenerService.java | 58 +-------
components/background_task_scheduler/BUILD.gn | 3 -
.../BackgroundTaskGcmTaskService.java | 53 +------
.../BackgroundTaskSchedulerFactory.java | 2 +-
.../BackgroundTaskSchedulerFactory.java | 6 +-
.../BackgroundTaskSchedulerGcmNetworkManager.java | 164 +--------------------
third_party/android_deps/BUILD.gn | 20 ---
third_party/cacheinvalidation/BUILD.gn | 1 -
@ -15,7 +21,7 @@ author: Wengling Chen <[email protected]>
.../android2/channel/AndroidGcmController.java | 42 +-----
.../channel/AndroidInstanceIDListenerService.java | 13 +-
.../channel/GcmRegistrationTaskService.java | 89 +----------
13 files changed, 11 insertions(+), 463 deletions(-)
17 files changed, 21 insertions(+), 737 deletions(-)
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
--- a/chrome/android/BUILD.gn
@ -36,6 +42,348 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
"$google_play_services_package:google_play_services_iid_java",
"$google_play_services_package:google_play_services_tasks_java",
"//base:base_java",
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -83,22 +83,17 @@ by a child template that "extends" this file.
<permission android:name="{{ manifest_package }}.permission.CHILD_SERVICE" android:protectionLevel="signature" />
<permission android:name="{{ manifest_package }}.permission.READ_WRITE_BOOKMARK_FOLDERS" android:protectionLevel="signatureOrSystem" />
<permission android:name="{{ manifest_package }}.TOS_ACKED" android:protectionLevel="signatureOrSystem" />
- <!-- Only chrome can receive the messages and registration result -->
- <permission android:name="{{ manifest_package }}.permission.C2D_MESSAGE"
- android:protectionLevel="signature" />
<permission android:name="{{ manifest_package }}.permission.DEBUG"
android:label="Debug web pages"
android:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS"
android:protectionLevel="signature" />
- <uses-permission android:name="{{ manifest_package }}.permission.C2D_MESSAGE" />
<uses-permission android:name="{{ manifest_package }}.permission.READ_WRITE_BOOKMARK_FOLDERS" />
<uses-permission android:name="{{ manifest_package }}.TOS_ACKED" />
<uses-permission android:name="com.chrome.permission.DEVICE_EXTRAS" />
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
<uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>
- <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="com.google.android.apps.now.CURRENT_ACCOUNT_ACCESS" />
@@ -1079,43 +1074,6 @@ by a child template that "extends" this file.
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize"
android:hardwareAccelerated="false" />
- <!-- Receiver for GCM messages. -->
- <receiver android:name="com.google.android.gms.gcm.GcmReceiver"
- android:exported="true"
- android:permission="com.google.android.c2dm.permission.SEND">
- <intent-filter>
- <action android:name="com.google.android.c2dm.intent.RECEIVE" />
- <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
- <category android:name="{{ manifest_package }}"/>
- </intent-filter>
- </receiver>
- <!-- GcmTaskService for registration for Invalidations. -->
- <service android:name="com.google.ipc.invalidation.ticl.android2.channel.GcmRegistrationTaskService"
- android:exported="true"
- android:permission="com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE" >
- <intent-filter>
- <action android:name="com.google.android.gms.gcm.ACTION_TASK_READY"/>
- </intent-filter>
- </service>
- <!-- InstanceIDListenerService for token refresh events from GCM. -->
- <service android:name="com.google.ipc.invalidation.ticl.android2.channel.AndroidInstanceIDListenerService"
- android:exported="false">
- <intent-filter>
- <action android:name="com.google.android.gms.iid.InstanceID"/>
- </intent-filter>
- </service>
- <!-- GcmListenerService for messages from GCM. -->
- <service android:name="org.chromium.chrome.browser.services.gcm.ChromeGcmListenerService"
- android:exported="false" >
- <intent-filter>
- <action android:name="com.google.android.c2dm.intent.RECEIVE" />
- </intent-filter>
- </service>
- <meta-data android:name="ipc.invalidation.ticl.gcm_upstream_service_class"
- android:value="org.chromium.chrome.browser.services.gcm.InvalidationGcmUpstreamSender" />
- <service android:name="org.chromium.chrome.browser.services.gcm.InvalidationGcmUpstreamSender"
- android:exported="false"/>
-
<!-- Notification service for sync. -->
<meta-data android:name="ipc.invalidation.ticl.listener_service_class"
android:value="org.chromium.chrome.browser.invalidation.ChromeInvalidationClientService"/>
@@ -1155,24 +1113,6 @@ by a child template that "extends" this file.
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE"/>
- <!-- Background Task Scheduler GCM task service -->
- <service android:name="org.chromium.components.background_task_scheduler.BackgroundTaskGcmTaskService"
- android:permission="com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE"
- android:exported="true">
- <intent-filter>
- <action android:name="com.google.android.gms.gcm.ACTION_TASK_READY" />
- </intent-filter>
- </service>
-
- <!-- GcmTaskService implementation to wake Chrome on scheduled events -->
- <service android:name="org.chromium.chrome.browser.ChromeBackgroundService"
- android:permission="com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE"
- android:exported="true">
- <intent-filter>
- <action android:name="com.google.android.gms.gcm.ACTION_TASK_READY" />
- </intent-filter>
- </service>
-
<service android:name="org.chromium.chrome.browser.prerender.ChromePrerenderService"
android:exported="true"
tools:ignore="ExportedService" />
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java b/chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java
@@ -8,10 +8,6 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.os.StrictMode;
-import com.google.android.gms.gcm.GcmNetworkManager;
-import com.google.android.gms.gcm.OneoffTask;
-import com.google.android.gms.gcm.Task;
-
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.VisibleForTesting;
@@ -37,8 +33,6 @@ public class BackgroundSyncLauncher {
// BackgroundSyncLauncherAndroid, if any. If it is non-null then the browser is running.
private static BackgroundSyncLauncher sInstance;
- private GcmNetworkManager mScheduler;
-
/**
* Disables the automatic use of the GCMNetworkManager. When disabled, the methods which
* interact with GCM can still be used, but will not be called automatically on creation, or by
@@ -47,7 +41,7 @@ public class BackgroundSyncLauncher {
* Automatic GCM use is disabled by tests, and also by this class if it is determined on
* creation that the installed Play Services library is out of date.
*/
- private static boolean sGCMEnabled = true;
+ private static boolean sGCMEnabled;
@VisibleForTesting
protected AsyncTask<Void> mLaunchBrowserIfStoppedTask;
@@ -135,15 +129,6 @@ public class BackgroundSyncLauncher {
@Override
protected void onPostExecute(Void params) {
if (sGCMEnabled) {
- if (shouldLaunch) {
- RecordHistogram.recordBooleanHistogram(
- "BackgroundSync.LaunchTask.ScheduleSuccess",
- scheduleLaunchTask(mScheduler, minDelayMs));
- } else {
- RecordHistogram.recordBooleanHistogram(
- "BackgroundSync.LaunchTask.CancelSuccess",
- removeScheduledTasks(mScheduler));
- }
}
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
@@ -158,7 +143,7 @@ public class BackgroundSyncLauncher {
}
protected BackgroundSyncLauncher() {
- mScheduler = GcmNetworkManager.getInstance(ContextUtils.getApplicationContext());
+ sGCMEnabled = false;
launchBrowserIfStopped(false, 0);
}
@@ -187,49 +172,6 @@ public class BackgroundSyncLauncher {
return !sGCMEnabled;
}
- private static boolean scheduleLaunchTask(GcmNetworkManager scheduler, long minDelayMs) {
- // Google Play Services may not be up to date, if the application was not installed through
- // the Play Store. In this case, scheduling the task will fail silently.
- final long minDelaySecs = minDelayMs / 1000;
- OneoffTask oneoff = new OneoffTask.Builder()
- .setService(ChromeBackgroundService.class)
- .setTag(TASK_TAG)
- // We have to set a non-zero execution window here
- .setExecutionWindow(minDelaySecs, minDelaySecs + 1)
- .setRequiredNetwork(Task.NETWORK_STATE_CONNECTED)
- .setPersisted(true)
- .setUpdateCurrent(true)
- .build();
- try {
- scheduler.schedule(oneoff);
- } catch (IllegalArgumentException e) {
- // Disable GCM for the remainder of this session.
- setGCMEnabled(false);
- // Return false so that the failure will be logged.
- return false;
- }
- return true;
- }
-
- private static boolean removeScheduledTasks(GcmNetworkManager scheduler) {
- // Third-party code causes broadcast to touch disk. http://crbug.com/614679
- StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
- try {
- scheduler.cancelTask(TASK_TAG, ChromeBackgroundService.class);
- } catch (IllegalArgumentException e) {
- // This occurs when BackgroundSyncLauncherService is not found in the application
- // manifest. This should not happen in code that reaches here, but has been seen in
- // the past. See https://crbug.com/548314
- // Disable GCM for the remainder of this session.
- setGCMEnabled(false);
- // Return false so that the failure will be logged.
- return false;
- } finally {
- StrictMode.setThreadPolicy(oldPolicy);
- }
- return true;
- }
-
/**
* Reschedule any required background sync tasks, if they have been removed due to an
* application upgrade.
@@ -240,14 +182,12 @@ public class BackgroundSyncLauncher {
* BackgroundSyncLauncher.
*/
protected static void rescheduleTasksOnUpgrade(final Context context) {
- final GcmNetworkManager scheduler = GcmNetworkManager.getInstance(context);
BackgroundSyncLauncher.ShouldLaunchCallback callback = shouldLaunch -> {
if (shouldLaunch) {
// It's unclear what time the sync event was supposed to fire, so fire
// without delay and let the browser reschedule if necessary.
// TODO(iclelland): If this fails, report the failure via UMA (not now,
// since the browser is not running, but on next startup.)
- scheduleLaunchTask(scheduler, 0);
}
};
BackgroundSyncLauncher.shouldLaunchBrowserIfStopped(callback);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java
@@ -6,10 +6,6 @@ package org.chromium.chrome.browser;
import android.content.Context;
-import com.google.android.gms.gcm.GcmNetworkManager;
-import com.google.android.gms.gcm.GcmTaskService;
-import com.google.android.gms.gcm.TaskParams;
-
import org.chromium.base.Log;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.library_loader.ProcessInitException;
@@ -27,67 +23,9 @@ import org.chromium.content_public.browser.UiThreadTaskTraits;
* browser needs to be launched for scheduled tasks, or in response to changing network or power
* conditions.
*/
-public class ChromeBackgroundService extends GcmTaskService {
+public class ChromeBackgroundService {
private static final String TAG = "BackgroundService";
- @Override
- @VisibleForTesting
- public int onRunTask(final TaskParams params) {
- final String taskTag = params.getTag();
- final Context context = this;
- PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> {
- switch (taskTag) {
- case BackgroundSyncLauncher.TASK_TAG:
- handleBackgroundSyncEvent(context, taskTag);
- break;
-
- case OfflinePageUtils.TASK_TAG:
- // Offline pages are migrating to BackgroundTaskScheduler, therefore getting
- // a task through ChromeBackgroundSerivce should cause a rescheduling using
- // the new component.
- rescheduleOfflinePages();
- break;
-
- case SnippetsLauncher.TASK_TAG_WIFI:
- case SnippetsLauncher.TASK_TAG_FALLBACK:
- handleSnippetsOnPersistentSchedulerWakeUp(context, taskTag);
- break;
-
- // This is only for tests.
- case ServiceManagerStartupUtils.TASK_TAG:
- handleServicificationStartupTask(context, taskTag);
- break;
-
- default:
- Log.i(TAG, "Unknown task tag " + taskTag);
- break;
- }
- });
-
- return GcmNetworkManager.RESULT_SUCCESS;
- }
-
- private void handleBackgroundSyncEvent(Context context, String tag) {
- 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
- // wake lock, but has a three minute timeout, so we need to start the browser in its
- // own task.
- // TODO(jkarlin): Protect the browser sync event with a wake lock.
- // See crbug.com/486020.
- launchBrowser(context, tag);
- }
- }
-
- private void handleSnippetsOnPersistentSchedulerWakeUp(Context context, String tag) {
- if (!SnippetsLauncher.hasInstance()) launchBrowser(context, tag);
- snippetsOnPersistentSchedulerWakeUp();
- }
-
- private void handleServicificationStartupTask(Context context, String tag) {
- launchBrowser(context, tag);
- }
-
@VisibleForTesting
protected void snippetsOnPersistentSchedulerWakeUp() {
SnippetsBridge.onPersistentSchedulerWakeUp();
@@ -98,41 +36,9 @@ public class ChromeBackgroundService extends GcmTaskService {
SnippetsBridge.onBrowserUpgraded();
}
- @VisibleForTesting
- protected void launchBrowser(Context context, String tag) {
- Log.i(TAG, "Launching browser");
- try {
- ChromeBrowserInitializer.getInstance(this).handleSynchronousStartup();
- } catch (ProcessInitException e) {
- Log.e(TAG, "ProcessInitException while starting the browser process");
- // Since the library failed to initialize nothing in the application
- // can work, so kill the whole application not just the activity.
- System.exit(-1);
- }
- }
-
- @VisibleForTesting
- protected void rescheduleBackgroundSyncTasksOnUpgrade() {
- BackgroundSyncLauncher.rescheduleTasksOnUpgrade(this);
- }
-
- private void handleSnippetsOnBrowserUpgraded() {
- if (SnippetsLauncher.shouldNotifyOnBrowserUpgraded()) {
- if (!SnippetsLauncher.hasInstance()) {
- launchBrowser(this, /*tag=*/""); // The |tag| doesn't matter here.
- }
- snippetsOnBrowserUpgraded();
- }
- }
-
/** Reschedules offline pages (using appropriate version of Background Task Scheduler). */
protected void rescheduleOfflinePages() {
BackgroundScheduler.getInstance().reschedule();
}
- @Override
- public void onInitializeTasks() {
- rescheduleBackgroundSyncTasksOnUpgrade();
- handleSnippetsOnBrowserUpgraded();
- }
}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationController.java b/chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationController.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationController.java
@ -61,6 +409,109 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/invalidation/In
}
@VisibleForTesting
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java
@@ -7,15 +7,10 @@ package org.chromium.chrome.browser.ntp.snippets;
import android.content.Context;
import android.net.ConnectivityManager;
-import com.google.android.gms.gcm.GcmNetworkManager;
-import com.google.android.gms.gcm.PeriodicTask;
-import com.google.android.gms.gcm.Task;
-
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.CalledByNative;
-import org.chromium.chrome.browser.ChromeBackgroundService;
import org.chromium.chrome.browser.externalauth.ExternalAuthUtils;
/**
@@ -40,9 +35,7 @@ public class SnippetsLauncher {
// If it is non-null then the browser is running.
private static SnippetsLauncher sInstance;
- private GcmNetworkManager mScheduler;
-
- private boolean mGCMEnabled = true;
+ private boolean mGCMEnabled;
/**
* Create a SnippetsLauncher object, which is owned by C++.
@@ -77,8 +70,8 @@ public class SnippetsLauncher {
}
protected SnippetsLauncher() {
+ mGCMEnabled = false;
checkGCM();
- mScheduler = GcmNetworkManager.getInstance(ContextUtils.getApplicationContext());
}
private void checkGCM() {
@@ -89,34 +82,6 @@ public class SnippetsLauncher {
}
}
- private static PeriodicTask buildFetchTask(
- String tag, long periodSeconds, int requiredNetwork) {
- // Add a bit of "flex" around the target period. This achieves the following:
- // - It makes sure the task doesn't run (significantly) before its initial period has
- // elapsed. In practice, the scheduler seems to behave like that anyway, but it doesn't
- // guarantee that, so we shouldn't rely on it.
- // - It gives the scheduler a bit of room to optimize for battery life.
- long effectivePeriodSeconds = (long) (periodSeconds * (1.0 + FLEX_FACTOR));
- long flexSeconds = (long) (periodSeconds * (2.0 * FLEX_FACTOR));
- return new PeriodicTask.Builder()
- .setService(ChromeBackgroundService.class)
- .setTag(tag)
- .setPeriod(effectivePeriodSeconds)
- .setFlex(flexSeconds)
- .setRequiredNetwork(requiredNetwork)
- .setPersisted(true)
- .setUpdateCurrent(true)
- .build();
- }
-
- private void scheduleOrCancelFetchTask(String taskTag, long period, int requiredNetwork) {
- if (period > 0) {
- mScheduler.schedule(buildFetchTask(taskTag, period, requiredNetwork));
- } else {
- mScheduler.cancelTask(taskTag, ChromeBackgroundService.class);
- }
- }
-
@CalledByNative
private boolean schedule(long periodWifiSeconds, long periodFallbackSeconds) {
if (!mGCMEnabled) return false;
@@ -128,22 +93,12 @@ public class SnippetsLauncher {
.putBoolean(PREF_IS_SCHEDULED, isScheduled)
.apply();
- // Google Play Services may not be up to date, if the application was not installed through
- // the Play Store. In this case, scheduling the task will fail silently.
- try {
- scheduleOrCancelFetchTask(
- TASK_TAG_WIFI, periodWifiSeconds, Task.NETWORK_STATE_UNMETERED);
- scheduleOrCancelFetchTask(
- TASK_TAG_FALLBACK, periodFallbackSeconds, Task.NETWORK_STATE_CONNECTED);
- } catch (IllegalArgumentException e) {
- // Disable GCM for the remainder of this session.
- mGCMEnabled = false;
+ // Disable GCM for the remainder of this session.
+ mGCMEnabled = false;
- ContextUtils.getAppSharedPreferences().edit().remove(PREF_IS_SCHEDULED).apply();
- // Return false so that the failure will be logged.
- return false;
- }
- return true;
+ ContextUtils.getAppSharedPreferences().edit().remove(PREF_IS_SCHEDULED).apply();
+ // Return false so that the failure will be logged.
+ return false;
}
@CalledByNative
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java
@ -136,14 +587,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/Ch
/**
* If Chrome is backgrounded, messages coming from lazy subscriptions are
* persisted on disk and replayed next time Chrome is forgrounded. If Chrome is forgrounded or
@@ -149,7 +95,6 @@ public class ChromeGcmListenerService extends GcmListenerService {
@@ -149,8 +95,6 @@ public class ChromeGcmListenerService extends GcmListenerService {
try {
ChromeBrowserInitializer.getInstance(applicationContext).handleSynchronousStartup();
- GCMDriver.dispatchMessage(message);
-
} catch (ProcessInitException e) {
Log.e(TAG, "ProcessInitException while starting the browser process");
diff --git a/components/background_task_scheduler/BUILD.gn b/components/background_task_scheduler/BUILD.gn
--- a/components/background_task_scheduler/BUILD.gn
+++ b/components/background_task_scheduler/BUILD.gn
@ -251,15 +703,19 @@ diff --git a/components/background_task_scheduler/android/java/src/org/chromium/
diff --git a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerFactory.java b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerFactory.java
--- a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerFactory.java
+++ b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerFactory.java
@@ -19,7 +19,7 @@ public final class BackgroundTaskSchedulerFactory {
if (sdkInt >= Build.VERSION_CODES.M) {
return new BackgroundTaskSchedulerJobService();
} else {
@@ -16,11 +16,7 @@ public final class BackgroundTaskSchedulerFactory {
private static BackgroundTaskScheduler sInstance;
static BackgroundTaskSchedulerDelegate getSchedulerDelegateForSdk(int sdkInt) {
- if (sdkInt >= Build.VERSION_CODES.M) {
- return new BackgroundTaskSchedulerJobService();
- } else {
- return new BackgroundTaskSchedulerGcmNetworkManager();
+ return null; /* minSDK is 24 */
}
- }
+ return new BackgroundTaskSchedulerJobService(); /* minSDK is 24 */
}
/**
diff --git a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerGcmNetworkManager.java b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerGcmNetworkManager.java
--- a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerGcmNetworkManager.java
+++ b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerGcmNetworkManager.java


Loading…
Cancel
Save