2021-09-03 08:44:54 -04:00
|
|
|
From 91cdd8cfebafcbfd226800cfdef80ec9a943e38b Mon Sep 17 00:00:00 2001
|
2021-03-22 19:59:15 -04:00
|
|
|
From: Tad <tad@spotco.us>
|
2021-09-03 08:44:54 -04:00
|
|
|
Date: Fri, 3 Sep 2021 08:52:48 -0400
|
2021-03-22 19:59:15 -04:00
|
|
|
Subject: [PATCH] Remove analytics
|
|
|
|
|
2021-09-03 08:44:54 -04:00
|
|
|
Change-Id: I3f42646ba278ef6d0d4aa7565f8374047d599938
|
2021-03-22 19:59:15 -04:00
|
|
|
---
|
2021-09-03 08:44:54 -04:00
|
|
|
res/layout/setup_lineage_settings.xml | 29 -----------------
|
|
|
|
.../lineageos/setupwizard/FinishActivity.java | 13 --------
|
|
|
|
.../setupwizard/LineageSettingsActivity.java | 31 -------------------
|
2021-03-22 19:59:15 -04:00
|
|
|
.../lineageos/setupwizard/SetupWizardApp.java | 1 -
|
2021-09-03 08:44:54 -04:00
|
|
|
4 files changed, 74 deletions(-)
|
2021-03-22 19:59:15 -04:00
|
|
|
|
|
|
|
diff --git a/res/layout/setup_lineage_settings.xml b/res/layout/setup_lineage_settings.xml
|
2021-09-03 08:44:54 -04:00
|
|
|
index a222d5b..9645f95 100644
|
2021-03-22 19:59:15 -04:00
|
|
|
--- a/res/layout/setup_lineage_settings.xml
|
|
|
|
+++ b/res/layout/setup_lineage_settings.xml
|
2021-09-03 08:44:54 -04:00
|
|
|
@@ -53,35 +53,6 @@
|
|
|
|
android:text="@string/services_explanation"
|
|
|
|
android:clickable="true" />
|
2021-03-22 19:59:15 -04:00
|
|
|
|
2021-09-03 08:44:54 -04:00
|
|
|
- <!-- 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">
|
2021-03-22 19:59:15 -04:00
|
|
|
-
|
|
|
|
-
|
2021-09-03 08:44:54 -04:00
|
|
|
- <CheckBox
|
|
|
|
- android:id="@+id/enable_metrics_checkbox"
|
|
|
|
- android:layout_width="wrap_content"
|
|
|
|
- android:layout_height="wrap_content"
|
|
|
|
- android:duplicateParentState="true"
|
|
|
|
- android:clickable="false"
|
|
|
|
- style="@style/SudCheckBox.Multiline" />
|
2021-03-22 19:59:15 -04:00
|
|
|
-
|
2021-09-03 08:44:54 -04:00
|
|
|
- <TextView
|
|
|
|
- android:id="@+id/enable_metrics_summary"
|
|
|
|
- android:layout_width="wrap_content"
|
|
|
|
- android:layout_height="wrap_content"
|
|
|
|
- android:text="@string/services_metrics_label"
|
|
|
|
- style="@style/SudCheckBox.Multiline" />
|
2021-03-22 19:59:15 -04:00
|
|
|
-
|
2021-09-03 08:44:54 -04:00
|
|
|
- </LinearLayout>
|
2021-03-22 19:59:15 -04:00
|
|
|
-
|
2021-09-03 08:44:54 -04:00
|
|
|
<!-- Checkbox for using on-screen nav keys -->
|
|
|
|
<LinearLayout
|
|
|
|
android:id="@+id/nav_keys"
|
2021-03-22 19:59:15 -04:00
|
|
|
diff --git a/src/org/lineageos/setupwizard/FinishActivity.java b/src/org/lineageos/setupwizard/FinishActivity.java
|
2021-09-03 08:44:54 -04:00
|
|
|
index 12cda35..6248985 100644
|
2021-03-22 19:59:15 -04:00
|
|
|
--- a/src/org/lineageos/setupwizard/FinishActivity.java
|
|
|
|
+++ b/src/org/lineageos/setupwizard/FinishActivity.java
|
2021-09-03 08:44:54 -04:00
|
|
|
@@ -23,7 +23,6 @@ import static org.lineageos.setupwizard.Manifest.permission.FINISH_SETUP;
|
2021-03-22 19:59:15 -04:00
|
|
|
import static org.lineageos.setupwizard.SetupWizardApp.ACTION_SETUP_COMPLETE;
|
|
|
|
import static org.lineageos.setupwizard.SetupWizardApp.DISABLE_NAV_KEYS;
|
|
|
|
import static org.lineageos.setupwizard.SetupWizardApp.ENABLE_RECOVERY_UPDATE;
|
|
|
|
-import static org.lineageos.setupwizard.SetupWizardApp.KEY_SEND_METRICS;
|
|
|
|
import static org.lineageos.setupwizard.SetupWizardApp.LOGV;
|
|
|
|
import static org.lineageos.setupwizard.SetupWizardApp.UPDATE_RECOVERY_PROP;
|
|
|
|
|
2021-09-03 08:44:54 -04:00
|
|
|
@@ -176,7 +175,6 @@ public class FinishActivity extends BaseSetupWizardActivity {
|
2021-03-22 19:59:15 -04:00
|
|
|
if (mEnableAccessibilityController != null) {
|
|
|
|
mEnableAccessibilityController.onDestroy();
|
|
|
|
}
|
|
|
|
- handleEnableMetrics(mSetupWizardApp);
|
|
|
|
handleNavKeys(mSetupWizardApp);
|
|
|
|
handleRecoveryUpdate(mSetupWizardApp);
|
|
|
|
final WallpaperManager wallpaperManager =
|
2021-09-03 08:44:54 -04:00
|
|
|
@@ -188,17 +186,6 @@ public class FinishActivity extends BaseSetupWizardActivity {
|
2021-03-22 19:59:15 -04:00
|
|
|
startActivityForResult(intent, NEXT_REQUEST);
|
|
|
|
}
|
|
|
|
|
|
|
|
- private static void handleEnableMetrics(SetupWizardApp setupWizardApp) {
|
|
|
|
- Bundle privacyData = setupWizardApp.getSettingsBundle();
|
|
|
|
- if (privacyData != null
|
|
|
|
- && privacyData.containsKey(KEY_SEND_METRICS)) {
|
|
|
|
- LineageSettings.Secure.putInt(setupWizardApp.getContentResolver(),
|
2021-09-03 08:44:54 -04:00
|
|
|
- LineageSettings.Secure.STATS_COLLECTION,
|
|
|
|
- privacyData.getBoolean(KEY_SEND_METRICS)
|
2021-03-22 19:59:15 -04:00
|
|
|
- ? 1 : 0);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private static void handleNavKeys(SetupWizardApp setupWizardApp) {
|
|
|
|
if (setupWizardApp.getSettingsBundle().containsKey(DISABLE_NAV_KEYS)) {
|
|
|
|
writeDisableNavkeysOption(setupWizardApp,
|
|
|
|
diff --git a/src/org/lineageos/setupwizard/LineageSettingsActivity.java b/src/org/lineageos/setupwizard/LineageSettingsActivity.java
|
2021-09-03 08:44:54 -04:00
|
|
|
index 4f5519d..c1f3698 100644
|
2021-03-22 19:59:15 -04:00
|
|
|
--- a/src/org/lineageos/setupwizard/LineageSettingsActivity.java
|
|
|
|
+++ b/src/org/lineageos/setupwizard/LineageSettingsActivity.java
|
|
|
|
@@ -18,7 +18,6 @@
|
|
|
|
package org.lineageos.setupwizard;
|
|
|
|
|
|
|
|
import static org.lineageos.setupwizard.SetupWizardApp.DISABLE_NAV_KEYS;
|
|
|
|
-import static org.lineageos.setupwizard.SetupWizardApp.KEY_SEND_METRICS;
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
|
|
import android.content.Context;
|
2021-09-03 08:44:54 -04:00
|
|
|
@@ -50,17 +49,10 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
|
2021-03-22 19:59:15 -04:00
|
|
|
|
|
|
|
private SetupWizardApp mSetupWizardApp;
|
|
|
|
|
|
|
|
- private CheckBox mMetrics;
|
|
|
|
private CheckBox mNavKeys;
|
|
|
|
|
|
|
|
private boolean mSupportsKeyDisabler = false;
|
|
|
|
|
2021-09-03 08:44:54 -04:00
|
|
|
- private final View.OnClickListener mMetricsClickListener = view -> {
|
2021-03-22 19:59:15 -04:00
|
|
|
- boolean checked = !mMetrics.isChecked();
|
|
|
|
- mMetrics.setChecked(checked);
|
|
|
|
- mSetupWizardApp.getSettingsBundle().putBoolean(KEY_SEND_METRICS, checked);
|
|
|
|
- };
|
|
|
|
-
|
2021-09-03 08:44:54 -04:00
|
|
|
private final View.OnClickListener mNavKeysClickListener = view -> {
|
2021-03-22 19:59:15 -04:00
|
|
|
boolean checked = !mNavKeys.isChecked();
|
|
|
|
mNavKeys.setChecked(checked);
|
2021-09-03 08:44:54 -04:00
|
|
|
@@ -97,19 +89,6 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
|
2021-03-22 19:59:15 -04:00
|
|
|
privacyPolicy.setMovementMethod(LinkMovementMethod.getInstance());
|
|
|
|
privacyPolicy.setText(ss);
|
|
|
|
|
|
|
|
- View metricsRow = findViewById(R.id.metrics);
|
|
|
|
- metricsRow.setOnClickListener(mMetricsClickListener);
|
|
|
|
- String metricsHelpImproveLineage =
|
|
|
|
- getString(R.string.services_help_improve_cm, getString(R.string.os_name));
|
|
|
|
- String metricsSummary = getString(R.string.services_metrics_label,
|
|
|
|
- metricsHelpImproveLineage, getString(R.string.os_name));
|
|
|
|
- final SpannableStringBuilder metricsSpan = new SpannableStringBuilder(metricsSummary);
|
|
|
|
- metricsSpan.setSpan(new android.text.style.StyleSpan(android.graphics.Typeface.BOLD),
|
|
|
|
- 0, metricsHelpImproveLineage.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
|
|
|
- TextView metrics = (TextView) findViewById(R.id.enable_metrics_summary);
|
|
|
|
- metrics.setText(metricsSpan);
|
|
|
|
- mMetrics = (CheckBox) findViewById(R.id.enable_metrics_checkbox);
|
|
|
|
-
|
|
|
|
View navKeysRow = findViewById(R.id.nav_keys);
|
|
|
|
navKeysRow.setOnClickListener(mNavKeysClickListener);
|
|
|
|
mNavKeys = (CheckBox) findViewById(R.id.nav_keys_checkbox);
|
2021-09-03 08:44:54 -04:00
|
|
|
@@ -126,7 +105,6 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
|
2021-03-22 19:59:15 -04:00
|
|
|
public void onResume() {
|
|
|
|
super.onResume();
|
|
|
|
updateDisableNavkeysOption();
|
|
|
|
- updateMetricsOption();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-09-03 08:44:54 -04:00
|
|
|
@@ -150,15 +128,6 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
|
2021-03-22 19:59:15 -04: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 (mSupportsKeyDisabler) {
|
|
|
|
final Bundle myPageBundle = mSetupWizardApp.getSettingsBundle();
|
|
|
|
diff --git a/src/org/lineageos/setupwizard/SetupWizardApp.java b/src/org/lineageos/setupwizard/SetupWizardApp.java
|
2021-09-03 08:44:54 -04:00
|
|
|
index b1755c7..c299457 100644
|
2021-03-22 19:59:15 -04:00
|
|
|
--- a/src/org/lineageos/setupwizard/SetupWizardApp.java
|
|
|
|
+++ b/src/org/lineageos/setupwizard/SetupWizardApp.java
|
2021-09-03 08:44:54 -04:00
|
|
|
@@ -59,7 +59,6 @@ public class SetupWizardApp extends Application {
|
|
|
|
public static final String EXTRA_ENABLE_NEXT_ON_CONNECT = "wifi_enable_next_on_connect";
|
2021-03-22 19:59:15 -04: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 ENABLE_RECOVERY_UPDATE = "enable_recovery_update";
|
|
|
|
public static final String UPDATE_RECOVERY_PROP = "persist.vendor.recovery_update";
|
|
|
|
--
|
2021-09-03 08:44:54 -04:00
|
|
|
2.31.1
|
2021-03-22 19:59:15 -04:00
|
|
|
|