Commit 431585e3 authored by Daniel Park's avatar Daniel Park Committed by Commit Bot

[Chrome Home Survey] Prevent any action for tablets

Bug: 783991
Change-Id: I3ba066c89f8733e2b20acc71e2103f467749cae4
Reviewed-on: https://chromium-review.googlesource.com/772800Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Daniel Park <danielpark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517186}
parent 3b9d4219
......@@ -20,6 +20,7 @@ import org.chromium.chrome.browser.preferences.PrefServiceBridge;
import org.chromium.chrome.browser.survey.SurveyController;
import org.chromium.components.minidump_uploader.util.CrashReportingPermissionManager;
import org.chromium.components.minidump_uploader.util.NetworkPermissionUtil;
import org.chromium.ui.base.DeviceFormFactor;
/**
* Reads, writes, and migrates preferences related to network usage and privacy.
......@@ -225,7 +226,7 @@ public class PrivacyPreferencesManager implements CrashReportingPermissionManage
public void setUsageAndCrashReporting(boolean enabled) {
mSharedPreferences.edit().putBoolean(PREF_METRICS_REPORTING, enabled).apply();
syncUsageAndCrashReportingPrefs();
if (!enabled) {
if (!enabled && !DeviceFormFactor.isTablet()) {
SurveyController.getInstance().clearCache(ContextUtils.getApplicationContext());
}
}
......
......@@ -29,6 +29,7 @@ import org.chromium.chrome.browser.util.FeatureUtilities;
import org.chromium.components.variations.VariationsAssociatedData;
import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.browser.WebContentsObserver;
import org.chromium.ui.base.DeviceFormFactor;
/**
* Class that controls if and when to show surveys related to the Chrome Home experiment.
......@@ -88,6 +89,7 @@ public class ChromeHomeSurveyController {
if (CommandLine.getInstance().hasSwitch(ChromeSwitches.CHROME_HOME_FORCE_ENABLE_SURVEY)) {
return true;
}
if (DeviceFormFactor.isTablet()) return false;
if (!isUMAEnabled()) return false;
if (AccessibilityUtil.isAccessibilityEnabled()) return false;
if (hasInfoBarBeenDisplayed()) return false;
......
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