Commit 921be3d9 authored by Maria Khomenko's avatar Maria Khomenko Committed by Commit Bot

Don't bind to SsbService on low-end devices.

We only use SsbService to pass signed in account data for Icing. On
low-end devices, Icing is disabled, so we don't need this data.

BUG=750365

Change-Id: I00d9faa3a592de4b5471ec5226508facbd48c637
Reviewed-on: https://chromium-review.googlesource.com/592487
Commit-Queue: Maria Khomenko <mariakhomenko@chromium.org>
Reviewed-by: default avatarBenoit L <lizeb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491105}
parent 07b66041
......@@ -802,11 +802,14 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
UpdateMenuItemHelper.getInstance().onStart();
ChromeActivitySessionTracker.getInstance().onStartWithNative();
if (GSAState.getInstance(this).isGsaAvailable()) {
GSAAccountChangeListener.getInstance().connect();
createContextReporterIfNeeded();
} else {
ContextReporter.reportStatus(ContextReporter.STATUS_GSA_NOT_AVAILABLE);
if (!SysUtils.isLowEndDevice()) {
if (GSAState.getInstance(this).isGsaAvailable()) {
// GSA connection is not needed on low-end devices because Icing is disabled.
GSAAccountChangeListener.getInstance().connect();
createContextReporterIfNeeded();
} else {
ContextReporter.reportStatus(ContextReporter.STATUS_GSA_NOT_AVAILABLE);
}
}
// postDeferredStartupIfNeeded() is called in TabModelSelectorTabObsever#onLoadStopped(),
......@@ -925,7 +928,7 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
if (tab != null && !hasWindowFocus()) tab.onActivityHidden();
if (mAppMenuHandler != null) mAppMenuHandler.hideAppMenu();
if (GSAState.getInstance(this).isGsaAvailable()) {
if (GSAState.getInstance(this).isGsaAvailable() && !SysUtils.isLowEndDevice()) {
GSAAccountChangeListener.getInstance().disconnect();
if (mSyncStateChangedListener != null) {
ProfileSyncService syncService = ProfileSyncService.get();
......
......@@ -16,6 +16,7 @@ import android.os.Process;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.Callback;
import org.chromium.base.ContextUtils;
import org.chromium.base.SysUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.metrics.RecordHistogram;
......@@ -67,6 +68,7 @@ public class GSAAccountChangeListener {
/** @return the instance of GSAAccountChangeListener. */
public static GSAAccountChangeListener getInstance() {
if (sInstance == null) {
assert !SysUtils.isLowEndDevice();
Context context = ContextUtils.getApplicationContext();
sInstance = new GSAAccountChangeListener(context);
}
......
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