2021-10-16 14:05:45 -04:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-02-12 04:57:49 -05:00
|
|
|
From: Tad <tad@spotco.us>
|
2018-02-28 08:13:34 -05:00
|
|
|
Date: Wed, 28 Feb 2018 08:12:03 -0500
|
2018-02-12 04:57:49 -05:00
|
|
|
Subject: [PATCH] Remove analytics
|
|
|
|
|
2022-03-05 12:24:18 -05:00
|
|
|
Change-Id: I044dd6b137b8a1d4a6dde3a63c0aaa454309341f
|
2018-02-12 04:57:49 -05:00
|
|
|
---
|
2018-08-04 09:15:22 -04:00
|
|
|
res/layout/setup_lineage_settings.xml | 36 -------------------
|
|
|
|
.../lineageos/setupwizard/FinishActivity.java | 12 -------
|
|
|
|
.../setupwizard/LineageSettingsActivity.java | 31 ----------------
|
|
|
|
.../lineageos/setupwizard/SetupWizardApp.java | 1 -
|
|
|
|
4 files changed, 80 deletions(-)
|
2018-02-12 04:57:49 -05:00
|
|
|
|
|
|
|
diff --git a/res/layout/setup_lineage_settings.xml b/res/layout/setup_lineage_settings.xml
|
|
|
|
index 42b4c2d..5792c06 100644
|
|
|
|
--- a/res/layout/setup_lineage_settings.xml
|
|
|
|
+++ b/res/layout/setup_lineage_settings.xml
|
|
|
|
@@ -51,42 +51,6 @@
|
|
|
|
android:text="@string/services_explanation"
|
|
|
|
android:clickable="true"/>
|
|
|
|
|
|
|
|
- <!-- Whether or not to enable metrics -->
|
|
|
|
- <LinearLayout
|
|
|
|
- android:id="@+id/metrics"
|
|
|
|
- android:orientation="horizontal"
|
|
|
|
- android:layout_width="match_parent"
|
|
|
|
- android:layout_height="wrap_content"
|
|
|
|
- android:paddingLeft="@dimen/location_margin_left"
|
|
|
|
- android:paddingRight="@dimen/content_margin_right"
|
|
|
|
- android:background="?android:attr/selectableItemBackground"
|
|
|
|
- android:clickable="true">
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- <CheckBox
|
|
|
|
- android:id="@+id/enable_metrics_checkbox"
|
|
|
|
- android:layout_width="wrap_content"
|
|
|
|
- android:layout_height="wrap_content"
|
|
|
|
- android:layout_gravity="top"
|
|
|
|
- android:layout_marginTop="5dp"
|
|
|
|
- android:duplicateParentState="true"
|
|
|
|
- android:clickable="false"/>
|
|
|
|
-
|
|
|
|
- <TextView
|
|
|
|
- android:id="@+id/enable_metrics_summary"
|
|
|
|
- android:layout_width="0px"
|
|
|
|
- android:layout_height="wrap_content"
|
|
|
|
- android:layout_weight="1"
|
|
|
|
- android:textSize="15sp"
|
|
|
|
- android:lineSpacingExtra="@dimen/setup_line_spacing"
|
|
|
|
- android:gravity="top"
|
|
|
|
- android:layout_marginLeft="@dimen/location_text_margin_left"
|
|
|
|
- android:layout_marginRight="@dimen/location_text_margin_right"
|
|
|
|
- android:paddingBottom="@dimen/content_margin_bottom"
|
|
|
|
- android:text="@string/services_metrics_label"/>
|
|
|
|
-
|
|
|
|
- </LinearLayout>
|
|
|
|
-
|
|
|
|
<!-- Checkbox for using on-screen nav keys -->
|
|
|
|
<LinearLayout
|
|
|
|
android:id="@+id/nav_keys"
|
2018-02-28 08:13:34 -05:00
|
|
|
diff --git a/src/org/lineageos/setupwizard/FinishActivity.java b/src/org/lineageos/setupwizard/FinishActivity.java
|
2018-08-04 09:15:22 -04:00
|
|
|
index 463e67d..74b0dba 100644
|
2018-02-28 08:13:34 -05:00
|
|
|
--- a/src/org/lineageos/setupwizard/FinishActivity.java
|
|
|
|
+++ b/src/org/lineageos/setupwizard/FinishActivity.java
|
|
|
|
@@ -20,7 +20,6 @@ package org.lineageos.setupwizard;
|
|
|
|
import static org.lineageos.setupwizard.SetupWizardApp.DISABLE_NAV_KEYS;
|
|
|
|
import static org.lineageos.setupwizard.SetupWizardApp.KEY_BUTTON_BACKLIGHT;
|
|
|
|
import static org.lineageos.setupwizard.SetupWizardApp.KEY_PRIVACY_GUARD;
|
|
|
|
-import static org.lineageos.setupwizard.SetupWizardApp.KEY_SEND_METRICS;
|
|
|
|
import static org.lineageos.setupwizard.SetupWizardApp.LOGV;
|
2018-02-12 04:57:49 -05:00
|
|
|
|
|
|
|
import android.animation.Animator;
|
2018-08-04 09:15:22 -04:00
|
|
|
@@ -170,7 +169,6 @@ public class FinishActivity extends BaseSetupWizardActivity {
|
2018-02-12 04:57:49 -05:00
|
|
|
mEnableAccessibilityController.onDestroy();
|
|
|
|
}
|
|
|
|
handlePrivacyGuard(mSetupWizardApp);
|
|
|
|
- handleEnableMetrics(mSetupWizardApp);
|
|
|
|
handleNavKeys(mSetupWizardApp);
|
|
|
|
final WallpaperManager wallpaperManager =
|
|
|
|
WallpaperManager.getInstance(mSetupWizardApp);
|
2018-08-04 09:15:22 -04:00
|
|
|
@@ -181,16 +179,6 @@ public class FinishActivity extends BaseSetupWizardActivity {
|
2018-02-12 04:57:49 -05:00
|
|
|
startActivityForResult(intent, NEXT_REQUEST);
|
|
|
|
}
|
|
|
|
|
|
|
|
- private static void handleEnableMetrics(SetupWizardApp setupWizardApp) {
|
|
|
|
- Bundle privacyData = setupWizardApp.getSettingsBundle();
|
|
|
|
- if (privacyData != null
|
|
|
|
- && privacyData.containsKey(KEY_SEND_METRICS)) {
|
2018-02-28 08:13:34 -05:00
|
|
|
- LineageSettings.Secure.putInt(setupWizardApp.getContentResolver(),
|
|
|
|
- LineageSettings.Secure.STATS_COLLECTION, privacyData.getBoolean(KEY_SEND_METRICS)
|
2018-02-12 04:57:49 -05:00
|
|
|
- ? 1 : 0);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private static void handlePrivacyGuard(SetupWizardApp setupWizardApp) {
|
|
|
|
Bundle mPrivacyData = setupWizardApp.getSettingsBundle();
|
|
|
|
if (mPrivacyData != null && mPrivacyData.containsKey(KEY_PRIVACY_GUARD)) {
|
2018-02-28 08:13:34 -05:00
|
|
|
diff --git a/src/org/lineageos/setupwizard/LineageSettingsActivity.java b/src/org/lineageos/setupwizard/LineageSettingsActivity.java
|
2021-10-16 14:05:45 -04:00
|
|
|
index 6735202..8d62fca 100644
|
2018-02-28 08:13:34 -05:00
|
|
|
--- a/src/org/lineageos/setupwizard/LineageSettingsActivity.java
|
|
|
|
+++ b/src/org/lineageos/setupwizard/LineageSettingsActivity.java
|
|
|
|
@@ -19,7 +19,6 @@ package org.lineageos.setupwizard;
|
|
|
|
|
|
|
|
import static org.lineageos.setupwizard.SetupWizardApp.DISABLE_NAV_KEYS;
|
|
|
|
import static org.lineageos.setupwizard.SetupWizardApp.KEY_PRIVACY_GUARD;
|
|
|
|
-import static org.lineageos.setupwizard.SetupWizardApp.KEY_SEND_METRICS;
|
2018-02-12 04:57:49 -05:00
|
|
|
|
|
|
|
import android.app.Activity;
|
|
|
|
import android.content.Context;
|
2018-08-04 09:15:22 -04:00
|
|
|
@@ -55,18 +54,11 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
|
2018-02-12 04:57:49 -05:00
|
|
|
|
|
|
|
private SetupWizardApp mSetupWizardApp;
|
|
|
|
|
|
|
|
- private CheckBox mMetrics;
|
|
|
|
private CheckBox mNavKeys;
|
|
|
|
private CheckBox mPrivacyGuard;
|
|
|
|
|
|
|
|
private boolean mHideNavKeysRow = false;
|
|
|
|
|
2018-08-04 09:15:22 -04:00
|
|
|
- private View.OnClickListener mMetricsClickListener = view -> {
|
|
|
|
- boolean checked = !mMetrics.isChecked();
|
|
|
|
- mMetrics.setChecked(checked);
|
|
|
|
- mSetupWizardApp.getSettingsBundle().putBoolean(KEY_SEND_METRICS, checked);
|
2018-02-12 04:57:49 -05:00
|
|
|
- };
|
|
|
|
-
|
2018-08-04 09:15:22 -04:00
|
|
|
private View.OnClickListener mNavKeysClickListener = view -> {
|
|
|
|
boolean checked = !mNavKeys.isChecked();
|
|
|
|
mNavKeys.setChecked(checked);
|
2021-10-16 14:05:45 -04:00
|
|
|
@@ -110,19 +102,6 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
|
2018-02-12 04:57:49 -05:00
|
|
|
privacyPolicy.setMovementMethod(LinkMovementMethod.getInstance());
|
|
|
|
privacyPolicy.setText(ss);
|
|
|
|
|
2018-08-04 09:15:22 -04:00
|
|
|
- View metricsRow = findViewById(R.id.metrics);
|
|
|
|
- metricsRow.setOnClickListener(mMetricsClickListener);
|
2018-02-28 08:13:34 -05:00
|
|
|
- String metricsHelpImproveLineage =
|
2018-02-12 04:57:49 -05:00
|
|
|
- getString(R.string.services_help_improve_cm, getString(R.string.os_name));
|
|
|
|
- String metricsSummary = getString(R.string.services_metrics_label,
|
2018-02-28 08:13:34 -05:00
|
|
|
- metricsHelpImproveLineage, getString(R.string.os_name));
|
2018-02-12 04:57:49 -05:00
|
|
|
- final SpannableStringBuilder metricsSpan = new SpannableStringBuilder(metricsSummary);
|
|
|
|
- metricsSpan.setSpan(new android.text.style.StyleSpan(android.graphics.Typeface.BOLD),
|
2018-02-28 08:13:34 -05:00
|
|
|
- 0, metricsHelpImproveLineage.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
2018-02-12 04:57:49 -05:00
|
|
|
- TextView metrics = (TextView) findViewById(R.id.enable_metrics_summary);
|
|
|
|
- metrics.setText(metricsSpan);
|
|
|
|
- mMetrics = (CheckBox) findViewById(R.id.enable_metrics_checkbox);
|
|
|
|
-
|
2018-08-04 09:15:22 -04:00
|
|
|
View navKeysRow = findViewById(R.id.nav_keys);
|
|
|
|
navKeysRow.setOnClickListener(mNavKeysClickListener);
|
2018-02-12 04:57:49 -05:00
|
|
|
mNavKeys = (CheckBox) findViewById(R.id.nav_keys_checkbox);
|
2021-10-16 14:05:45 -04:00
|
|
|
@@ -151,7 +130,6 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
|
2018-02-12 04:57:49 -05:00
|
|
|
public void onResume() {
|
|
|
|
super.onResume();
|
|
|
|
updateDisableNavkeysOption();
|
|
|
|
- updateMetricsOption();
|
|
|
|
updatePrivacyGuardOption();
|
|
|
|
}
|
|
|
|
|
2021-10-16 14:05:45 -04:00
|
|
|
@@ -186,15 +164,6 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
|
2018-02-12 04:57:49 -05:00
|
|
|
return R.drawable.ic_features;
|
|
|
|
}
|
|
|
|
|
|
|
|
- private void updateMetricsOption() {
|
|
|
|
- final Bundle myPageBundle = mSetupWizardApp.getSettingsBundle();
|
|
|
|
- boolean metricsChecked =
|
|
|
|
- !myPageBundle.containsKey(KEY_SEND_METRICS) || myPageBundle
|
|
|
|
- .getBoolean(KEY_SEND_METRICS);
|
|
|
|
- mMetrics.setChecked(metricsChecked);
|
|
|
|
- myPageBundle.putBoolean(KEY_SEND_METRICS, metricsChecked);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private void updateDisableNavkeysOption() {
|
|
|
|
if (!mHideNavKeysRow) {
|
|
|
|
final Bundle myPageBundle = mSetupWizardApp.getSettingsBundle();
|
2018-02-28 08:13:34 -05:00
|
|
|
diff --git a/src/org/lineageos/setupwizard/SetupWizardApp.java b/src/org/lineageos/setupwizard/SetupWizardApp.java
|
2018-08-04 09:15:22 -04:00
|
|
|
index 1a9318d..e362841 100644
|
2018-02-28 08:13:34 -05:00
|
|
|
--- a/src/org/lineageos/setupwizard/SetupWizardApp.java
|
|
|
|
+++ b/src/org/lineageos/setupwizard/SetupWizardApp.java
|
2018-08-04 09:15:22 -04:00
|
|
|
@@ -60,7 +60,6 @@ public class SetupWizardApp extends Application {
|
2018-02-28 08:13:34 -05:00
|
|
|
public static final String EXTRA_PREFS_SET_BACK_TEXT = "extra_prefs_set_back_text";
|
2018-02-12 04:57:49 -05:00
|
|
|
|
|
|
|
public static final String KEY_DETECT_CAPTIVE_PORTAL = "captive_portal_detection_enabled";
|
|
|
|
- public static final String KEY_SEND_METRICS = "send_metrics";
|
|
|
|
public static final String DISABLE_NAV_KEYS = "disable_nav_keys";
|
|
|
|
public static final String KEY_BUTTON_BACKLIGHT = "pre_navbar_button_backlight";
|
2018-02-28 08:13:34 -05:00
|
|
|
public static final String KEY_PRIVACY_GUARD = "privacy_guard_default";
|