[Replicant] [PATCH] Remove analytics support

belgin belginstirbu at hotmail.com
Mon Nov 23 23:45:45 UTC 2020


Signed-off-by: belgin <belginstirbu at hotmail.com>
---
 host/migration/example-cm12.1-settings.txt                |  3 +--
 host/migration/src/CMSettings.java                        |  7 -------
 packages/CMSettingsProvider/res/values/defaults.xml       |  3 ---
 .../src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java  |  3 ---
 .../org/cyanogenmod/cmsettings/CMSettingsProvider.java    |  6 +-----
 .../cmsettings/tests/CMSettingsProviderDefaultsTest.java  |  3 ---
 sdk/src/java/cyanogenmod/providers/CMSettings.java        | 15 ---------------
 7 files changed, 2 insertions(+), 38 deletions(-)

diff --git a/host/migration/example-cm12.1-settings.txt b/host/migration/example-cm12.1-settings.txt
index 7534be3..9f454aa 100644
--- a/host/migration/example-cm12.1-settings.txt
+++ b/host/migration/example-cm12.1-settings.txt
@@ -64,7 +64,6 @@ Row: 60 name=swap_volume_keys_on_rotation, type=s, value=0, type=s
 Row: 61 name=status_bar_brightness_control, type=s, value=0, type=s
 Row: 62 name=status_bar_notif_count, type=s, value=1, type=s
 Row: 63 name=dev_force_show_navbar, type=s, value=0, type=s
-Row: 64 name=stats_collection, type=s, value=1, type=s
 Row: 65 name=advanced_mode, type=s, value=1, type=s
 Row: 66 name=default_theme_package, type=s, value=com.cyngn.hexo, type=s
 Row: 67 name=default_theme_components, type=s, value=mods_overlays|mods_status_bar|mods_navigation_bar|mods_icons|mods_homescreen|mods_fonts, type=s
@@ -118,4 +117,4 @@ Row: 114 name=ring_home_button_behavior, type=s, value=1, type=s
 Row: 115 name=show_alarm_icon, type=s, value=1, type=s
 Row: 116 name=status_bar_am_pm, type=s, value=1, type=s
 Row: 117 name=status_bar_quick_qs_pulldown, type=s, value=1, type=s
-Row: 118 name=t9_search_input_locale, type=s, value=enUS, type=s
\ No newline at end of file
+Row: 118 name=t9_search_input_locale, type=s, value=enUS, type=s
diff --git a/host/migration/src/CMSettings.java b/host/migration/src/CMSettings.java
index 07ef080..6b4b0ab 100644
--- a/host/migration/src/CMSettings.java
+++ b/host/migration/src/CMSettings.java
@@ -840,12 +840,6 @@ public final class CMSettings {
         public static final String QS_USE_MAIN_TILES = "sysui_qs_main_tiles";
 
         /**
-         * Global stats collection
-         * @hide
-         */
-        public static final String STATS_COLLECTION = "stats_collection";
-
-        /**
          * Boolean value whether to link ringtone and notification volume
          *
          * @hide
@@ -1028,7 +1022,6 @@ public final class CMSettings {
                 CMSettings.Secure.DEV_FORCE_SHOW_NAVBAR,
                 CMSettings.Secure.KEYBOARD_BRIGHTNESS,
                 CMSettings.Secure.POWER_MENU_ACTIONS,
-                CMSettings.Secure.STATS_COLLECTION,
                 CMSettings.Secure.QS_SHOW_BRIGHTNESS_SLIDER,
                 CMSettings.Secure.QS_TILES,
                 CMSettings.Secure.QS_USE_MAIN_TILES,
diff --git a/packages/CMSettingsProvider/res/values/defaults.xml b/packages/CMSettingsProvider/res/values/defaults.xml
index 0e14ceb..68f48a3 100644
--- a/packages/CMSettingsProvider/res/values/defaults.xml
+++ b/packages/CMSettingsProvider/res/values/defaults.xml
@@ -48,9 +48,6 @@
          Comma-delimited, quick settings tiles. See QSConstants.java for a list of all available tiles
     <string name="def_qs_tiles">wifi,bt,cell,airplane,rotation,flashlight,location,cast,hotspot,live_display</string> -->
 
-    <!-- Default for CMSettings.Secure.STATS_COLLECTION -->
-    <bool name="def_stats_collection">false</bool>
-
     <!-- Default for CMSettings.System.STATUS_BAR_BATTERY_STYLE
          * 0: Display the battery as icon in portrait mode
          * 2: Display the battery as a circle
diff --git a/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java b/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java
index 1242c1a..4ccd5f1 100644
--- a/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java
+++ b/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java
@@ -356,9 +356,6 @@ public class CMDatabaseHelper extends SQLiteOpenHelper{
             loadBooleanSetting(stmt, CMSettings.Secure.QS_USE_MAIN_TILES,
                     R.bool.def_sysui_qs_main_tiles);
 
-            loadBooleanSetting(stmt, CMSettings.Secure.STATS_COLLECTION,
-                    R.bool.def_stats_collection);
-
             loadBooleanSetting(stmt, CMSettings.Secure.LOCKSCREEN_VISUALIZER_ENABLED,
                     R.bool.def_lockscreen_visualizer);
 
diff --git a/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMSettingsProvider.java b/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMSettingsProvider.java
index a4630df..c867646 100644
--- a/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMSettingsProvider.java
+++ b/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMSettingsProvider.java
@@ -208,12 +208,8 @@ public class CMSettingsProvider extends ContentProvider {
             else if (tableName.equals(CMDatabaseHelper.CMTableNames.TABLE_SECURE)) {
                 settingsValue = Settings.Secure.getStringForUser(contentResolver, settingsKey,
                         userId);
-                if (settingsValue != null && settingsKey.equals(CMSettings.Secure.STATS_COLLECTION)
-                        && CMSettings.Secure.getStringForUser(contentResolver, settingsKey, userId)
+                if (settingsValue != null && CMSettings.Secure.getStringForUser(contentResolver, settingsKey, userId)
                         != null) {
-                    // incorrect migration from YOG4P -> YOG7D failed to remove
-                    // Settings.Secure.STATS_COLLECTION after migration; so it may exist in both
-                    // providers; so if it exists in the new database, prefer it.
                     continue;
                 }
 
diff --git a/packages/CMSettingsProvider/tests/src/org/cyanogenmod/cmsettings/tests/CMSettingsProviderDefaultsTest.java b/packages/CMSettingsProvider/tests/src/org/cyanogenmod/cmsettings/tests/CMSettingsProviderDefaultsTest.java
index 2ea0bf8..d2ed193 100644
--- a/packages/CMSettingsProvider/tests/src/org/cyanogenmod/cmsettings/tests/CMSettingsProviderDefaultsTest.java
+++ b/packages/CMSettingsProvider/tests/src/org/cyanogenmod/cmsettings/tests/CMSettingsProviderDefaultsTest.java
@@ -93,9 +93,6 @@ public class CMSettingsProviderDefaultsTest extends AndroidTestCase {
                 CMSettings.Secure.QS_USE_MAIN_TILES,
                 "R.bool.def_sysui_qs_main_tiles"));
         SECURE_SETTINGS_DEFAULTS.add(new Setting(
-                CMSettings.Secure.STATS_COLLECTION,
-                "R.bool.def_stats_collection"));
-        SECURE_SETTINGS_DEFAULTS.add(new Setting(
                 CMSettings.Secure.LOCKSCREEN_VISUALIZER_ENABLED,
                 "R.bool.def_lockscreen_visualizer"));
         SECURE_SETTINGS_DEFAULTS.add(new Setting(
diff --git a/sdk/src/java/cyanogenmod/providers/CMSettings.java b/sdk/src/java/cyanogenmod/providers/CMSettings.java
index cb1468c..8f72f05 100644
--- a/sdk/src/java/cyanogenmod/providers/CMSettings.java
+++ b/sdk/src/java/cyanogenmod/providers/CMSettings.java
@@ -2604,20 +2604,6 @@ public final class CMSettings {
         public static final String QS_USE_MAIN_TILES = "sysui_qs_main_tiles";
 
         /**
-         * Global stats collection
-         * @hide
-         */
-        public static final String STATS_COLLECTION = "stats_collection";
-
-        /**
-         * Whether the global stats collection setting has been successfully reported to server
-         * @hide
-         * @deprecated {@link org.cyanogenmod.cmparts.cmstats.AnonymousStats} no longer uses this
-         */
-        @Deprecated
-        public static final String STATS_COLLECTION_REPORTED = "stats_collection_reported";
-
-        /**
          * Whether newly installed apps should run with privacy guard by default
          * @hide
          */
@@ -2870,7 +2856,6 @@ public final class CMSettings {
                 CMSettings.Secure.DEV_FORCE_SHOW_NAVBAR,
                 CMSettings.Secure.KEYBOARD_BRIGHTNESS,
                 CMSettings.Secure.POWER_MENU_ACTIONS,
-                CMSettings.Secure.STATS_COLLECTION,
                 CMSettings.Secure.QS_SHOW_BRIGHTNESS_SLIDER,
                 CMSettings.Secure.QS_TILES,
                 CMSettings.Secure.QS_USE_MAIN_TILES,
-- 
2.11.0



More information about the Replicant mailing list