Commit 73911c56 authored by Conley Owens's avatar Conley Owens Committed by Commit Bot

Do not run Nearby on low end devices

This change checks if we are running on a low-end device before making
a call to Nearby.

BUG=736138

Change-Id: Ic3848725e752306c774a61a1cc9e26dd750e7a24
Reviewed-on: https://chromium-review.googlesource.com/567699Reviewed-by: default avatarMaria Khomenko <mariakhomenko@chromium.org>
Commit-Queue: Conley Owens <cco3@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486032}
parent 9b394e80
......@@ -14,6 +14,7 @@ import android.os.AsyncTask;
import android.os.Build;
import org.chromium.base.ContextUtils;
import org.chromium.base.SysUtils;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.UrlConstants;
......@@ -97,7 +98,9 @@ public class PhysicalWeb {
// In the case that the user has disabled our flag and restarted, this is a minimal code
// path to disable our subscription to Nearby.
if (!featureIsEnabled()) {
new NearbyBackgroundSubscription(NearbySubscription.UNSUBSCRIBE).run();
if (!SysUtils.isLowEndDevice()) {
new NearbyBackgroundSubscription(NearbySubscription.UNSUBSCRIBE).run();
}
return;
}
......@@ -131,7 +134,8 @@ public class PhysicalWeb {
return locationUtils.isSystemLocationSettingEnabled()
&& locationUtils.hasAndroidLocationPermission()
&& TemplateUrlService.getInstance().isDefaultSearchEngineGoogle()
&& !Profile.getLastUsedProfile().isOffTheRecord();
&& !Profile.getLastUsedProfile().isOffTheRecord()
&& !SysUtils.isLowEndDevice();
}
/**
......
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