From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 26 Nov 2017 22:51:43 +0100
Subject: Skip the first run and metrics

---
 .../chrome/browser/firstrun/FirstRunStatus.java        |  8 ++++----
 .../chrome/browser/firstrun/FirstRunUtils.java         | 16 ++++++----------
 .../browser/firstrun/ToSAndUMAFirstRunFragment.java    | 18 ++++++------------
 3 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java
@@ -36,11 +36,11 @@ public class FirstRunStatus {
      * includes ToS and Sign In pages if necessary.
      */
     public static boolean getFirstRunFlowComplete() {
-        if (ContextUtils.getAppSharedPreferences().getBoolean(FIRST_RUN_FLOW_COMPLETE, false)) {
-            return true;
+        boolean complete = ContextUtils.getAppSharedPreferences().getBoolean(FIRST_RUN_FLOW_COMPLETE, false);
+        if (!complete) {
+             setFirstRunFlowComplete(true);
         }
-        return CommandLine.getInstance().hasSwitch(
-                ChromeSwitches.FORCE_FIRST_RUN_FLOW_COMPLETE_FOR_TESTING);
+        return true;
     }
 
     /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java
@@ -30,16 +30,12 @@ public class FirstRunUtils {
         //   - checkAnyUserHasSeenToS() may be true which needs to sync its state to the prefs.
         boolean javaPrefValue = javaPrefs.getBoolean(CACHED_TOS_ACCEPTED_PREF, false);
         boolean nativePrefValue = prefsBridge.isFirstRunEulaAccepted();
-        boolean userHasSeenTos =
-                ToSAckedReceiver.checkAnyUserHasSeenToS();
-        boolean isFirstRunComplete = FirstRunStatus.getFirstRunFlowComplete();
-        if (javaPrefValue || nativePrefValue || userHasSeenTos || isFirstRunComplete) {
-            if (!javaPrefValue) {
-                javaPrefs.edit().putBoolean(CACHED_TOS_ACCEPTED_PREF, true).apply();
-            }
-            if (!nativePrefValue) {
-                prefsBridge.setEulaAccepted();
-            }
+
+        if (!javaPrefValue) {
+            javaPrefs.edit().putBoolean(CACHED_TOS_ACCEPTED_PREF, true).apply();
+        }
+        if (!nativePrefValue) {
+            prefsBridge.setEulaAccepted();
         }
     }
 
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java
@@ -74,20 +74,14 @@ public class ToSAndUMAFirstRunFragment extends Fragment implements FirstRunFragm
             }
         });
 
-        if (ChromeVersionInfo.isOfficialBuild()) {
-            int paddingStart = getResources().getDimensionPixelSize(
-                    R.dimen.fre_tos_checkbox_padding);
-            ApiCompatibilityUtils.setPaddingRelative(mSendReportCheckBox,
-                    ApiCompatibilityUtils.getPaddingStart(mSendReportCheckBox) + paddingStart,
-                    mSendReportCheckBox.getPaddingTop(),
-                    ApiCompatibilityUtils.getPaddingEnd(mSendReportCheckBox),
-                    mSendReportCheckBox.getPaddingBottom());
-
-            mSendReportCheckBox.setChecked(FirstRunActivity.DEFAULT_METRICS_AND_CRASH_REPORTING);
-        } else {
-            mSendReportCheckBox.setVisibility(View.GONE);
+        int paddingStart = getResources().getDimensionPixelSize(R.dimen.fre_tos_checkbox_padding);
+        if (paddingStart != 0) {
+            mSendReportCheckBox.setChecked(false);
         }
 
+        mSendReportCheckBox.setChecked(false);
+        mSendReportCheckBox.setVisibility(View.GONE);
+
         mTosAndPrivacy.setMovementMethod(LinkMovementMethod.getInstance());
 
         NoUnderlineClickableSpan clickableTermsSpan = new NoUnderlineClickableSpan() {
-- 
2.7.4

