11.0: Remove the rest of CMStats

Hmm, I don't remember Dialer having stats.
Goddamn spyware.
This commit is contained in:
Tad 2018-12-18 23:39:29 -05:00
parent bae3092539
commit a652eb1e23
6 changed files with 362 additions and 15 deletions

View File

@ -0,0 +1,277 @@
From 69d632664ec7cc60d5f9037ae306c97b4abfbb6f Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Tue, 18 Dec 2018 23:35:40 -0500
Subject: [PATCH] Remove CMStats
Change-Id: I874c5b7eb571a0a2ac551dedd0da44eaa79af472
---
AndroidManifest.xml | 2 --
src/com/android/dialer/CallDetailActivity.java | 7 -----
src/com/android/dialer/CallDetailHeader.java | 4 ---
src/com/android/dialer/DialtactsActivity.java | 33 ----------------------
src/com/android/dialer/calllog/CallLogAdapter.java | 4 ---
.../android/dialer/dialpad/DialpadFragment.java | 3 --
.../android/dialer/list/AllContactsActivity.java | 4 ---
src/com/android/dialer/list/SearchFragment.java | 4 ---
8 files changed, 61 deletions(-)
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 0a36776..80e9939 100755
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -52,8 +52,6 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<!-- allow brodcasting across all users -->
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
- <!-- send analytic events through internal package -->
- <uses-permission android:name="com.cyngn.cmstats.SEND_ANALYTICS" />
<!-- This tells the activity manager to not delay any of our activity
start requests, even if they happen immediately after the user
presses home. -->
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java
index 711b616..89d723f 100755
--- a/src/com/android/dialer/CallDetailActivity.java
+++ b/src/com/android/dialer/CallDetailActivity.java
@@ -60,7 +60,6 @@ import com.android.dialer.calllog.ContactInfo;
import com.android.dialer.calllog.ContactInfoHelper;
import com.android.dialer.calllog.PhoneNumberDisplayHelper;
import com.android.dialer.calllog.PhoneNumberUtilsWrapper;
-import com.android.dialer.cmstats.DialerStats;
import com.android.dialer.util.AsyncTaskExecutor;
import com.android.dialer.util.AsyncTaskExecutors;
import com.android.dialer.util.CallRecordingPlayer;
@@ -453,12 +452,6 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware
isBusiness ? ContactPhotoManager.TYPE_BUSINESS :
ContactPhotoManager.TYPE_DEFAULT;
- // Track percentage of time that contact photo is present on details page
- String imageFound = firstDetails.photoUri != null ?
- "details_image_found" : "details_image_not_found";
- DialerStats.sendEvent(CallDetailActivity.this,
- DialerStats.Categories.DETAILS_CONTACT_IMAGE, imageFound);
-
mCallDetailHeader.loadContactPhotos(firstDetails.photoUri, displayNameForDefaultImage, lookupKey, contactType);
findViewById(R.id.call_detail).setVisibility(View.VISIBLE);
diff --git a/src/com/android/dialer/CallDetailHeader.java b/src/com/android/dialer/CallDetailHeader.java
index 1247b6d..6b36f1a 100644
--- a/src/com/android/dialer/CallDetailHeader.java
+++ b/src/com/android/dialer/CallDetailHeader.java
@@ -56,7 +56,6 @@ import com.android.dialer.calllog.PhoneNumberDisplayHelper;
import com.android.dialer.calllog.PhoneNumberUtilsWrapper;
import android.provider.ContactsContract.DisplayNameSources;
-import com.android.dialer.cmstats.DialerStats;
import com.android.internal.telephony.MSimConstants;
public class CallDetailHeader {
@@ -110,9 +109,6 @@ public class CallDetailHeader {
return;
}
Intent intent = ((ViewEntry) view.getTag()).primaryIntent;
- if (TextUtils.equals(intent.getAction(), Intent.ACTION_CALL_PRIVILEGED)) {
- DialerStats.sendEvent(mActivity, DialerStats.Categories.INITIATE_CALL, "call_from_detail_page");
- }
mActivity.startActivity(intent);
}
};
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index a26bc17..49c2427 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -71,7 +71,6 @@ import com.android.contacts.common.dialog.ClearFrequentsDialog;
import com.android.contacts.common.interactions.ImportExportDialogFragment;
import com.android.contacts.common.list.OnPhoneNumberPickerActionListener;
import com.android.dialer.calllog.CallLogActivity;
-import com.android.dialer.cmstats.DialerStats;
import com.android.dialer.database.DialerDatabaseHelper;
import com.android.dialer.dialpad.DialpadFragment;
import com.android.dialer.dialpad.SmartDialNameMatcher;
@@ -285,14 +284,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
new OnPhoneNumberPickerActionListener() {
@Override
public void onPickPhoneNumberAction(Uri dataUri) {
- if (mInDialpadSearch) {
- DialerStats.sendEvent(DialtactsActivity.this,
- DialerStats.Categories.INITIATE_CALL, "call_from_dialpad_search");
- } else if (mInRegularSearch) {
- DialerStats.sendEvent(DialtactsActivity.this,
- DialerStats.Categories.INITIATE_CALL, "call_from_regular_search");
- }
-
// Specify call-origin so that users will see the previous tab instead of
// CallLog screen (search UI will be automatically exited).
PhoneNumberInteraction.startInteractionForPhoneCall(
@@ -392,8 +383,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
setContentView(R.layout.dialtacts_activity);
- DialerStats.sendEvent(this, DialerStats.Categories.APP_LAUNCH, DialtactsActivity.class.getSimpleName());
-
// Add the favorites fragment, and the dialpad fragment, but only if savedInstanceState
// is null. Otherwise the fragment manager takes care of recreating these fragments.
if (savedInstanceState == null) {
@@ -594,7 +583,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
}
break;
case R.id.voice_search_button:
- DialerStats.sendEvent(DialtactsActivity.this, DialerStats.Categories.BUTTON_EVENT, "voice_clicked");
try {
startActivityForResult(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH),
ACTIVITY_REQUEST_CODE_VOICE_SEARCH);
@@ -646,7 +634,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
}
private void showDialpadFragment(boolean animate) {
- DialerStats.sendEvent(DialtactsActivity.this, DialerStats.Categories.BUTTON_EVENT, "dialer_shown");
mDialpadFragment.setAdjustTranslationForAnimation(animate);
final FragmentTransaction ft = getFragmentManager().beginTransaction();
if (animate) {
@@ -692,7 +679,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
mSearchView = (EditText) findViewById(R.id.search_view);
mSearchView.addTextChangedListener(mPhoneSearchQueryTextListener);
mSearchView.setHint(getString(R.string.dialer_hint_find_contact));
- setupEvent(mSearchViewContainer, R.id.search_view, DialerStats.Categories.BUTTON_EVENT, "search_clicked");
prepareVoiceSearchButton();
}
@@ -948,14 +934,12 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
new PhoneFavoriteFragment.Listener() {
@Override
public void onContactSelected(Uri contactUri) {
- DialerStats.sendEvent(DialtactsActivity.this, DialerStats.Categories.INITIATE_CALL, "call_from_favorite_tile");
PhoneNumberInteraction.startInteractionForPhoneCall(
DialtactsActivity.this, contactUri, getCallOrigin());
}
@Override
public void onCallNumberDirectly(String phoneNumber) {
- DialerStats.sendEvent(DialtactsActivity.this, DialerStats.Categories.INITIATE_CALL, "call_from_favorite_tile");
Intent intent = CallUtil.getCallIntent(phoneNumber, getCallOrigin());
startActivity(intent);
}
@@ -1173,7 +1157,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
}
public void allContactsClick(View v) {
- DialerStats.sendEvent(DialtactsActivity.this, DialerStats.Categories.BUTTON_EVENT, "contacts_clicked");
onShowAllContacts();
}
@@ -1245,20 +1228,4 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
return getResources().getBoolean(R.bool.config_show_onscreen_dial_button);
}
- /**
- * Add analytics event for view
- * @param v
- * @param buttonId
- * @param category
- * @param action
- */
- private void setupEvent(View v, int buttonId, final String category, final String action) {
- final View pageviewButton = v.findViewById(buttonId);
- pageviewButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- DialerStats.sendEvent(DialtactsActivity.this, category, action);
- }
- });
- }
}
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index 26664fd..1571d22 100755
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -44,7 +44,6 @@ import com.android.dialer.PhoneCallDetails;
import com.android.dialer.PhoneCallDetailsHelper;
import com.android.dialer.R;
import com.android.dialer.calllog.CallLogAdapterHelper.NumberWithCountryIso;
-import com.android.dialer.cmstats.DialerStats;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Objects;
@@ -123,9 +122,6 @@ public class CallLogAdapter extends GroupingListAdapter
final Intent intent = intentProvider.getIntent(mContext);
// See IntentProvider.getCallDetailIntentProvider() for why this may be null.
if (intent != null) {
- if (mStatsLabel != null) {
- DialerStats.sendEvent(mContext, DialerStats.Categories.INITIATE_CALL, mStatsLabel);
- }
mContext.startActivity(intent);
}
}
diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java
index 77cbb08..6edf4d2 100644
--- a/src/com/android/dialer/dialpad/DialpadFragment.java
+++ b/src/com/android/dialer/dialpad/DialpadFragment.java
@@ -84,7 +84,6 @@ import com.android.dialer.NeededForReflection;
import com.android.dialer.DialtactsActivity;
import com.android.dialer.R;
import com.android.dialer.SpecialCharSequenceMgr;
-import com.android.dialer.cmstats.DialerStats;
import com.android.dialer.SpeedDialUtils;
import com.android.dialer.SpeedDialListActivity;
import com.android.dialer.database.DialerDatabaseHelper;
@@ -1285,8 +1284,6 @@ public class DialpadFragment extends Fragment
if (isDigitsEmpty()) { // No number entered.
handleDialButtonClickWithEmptyDigits();
} else {
- DialerStats.sendEvent(getActivity(), DialerStats.Categories.INITIATE_CALL, "call_from_dialpad_direct");
-
final String number = mDigits.getText().toString();
// "persist.radio.otaspdial" is a temporary hack needed for one carrier's automated
diff --git a/src/com/android/dialer/list/AllContactsActivity.java b/src/com/android/dialer/list/AllContactsActivity.java
index 5773123..66a891b 100644
--- a/src/com/android/dialer/list/AllContactsActivity.java
+++ b/src/com/android/dialer/list/AllContactsActivity.java
@@ -32,7 +32,6 @@ import com.android.contacts.common.activity.TransactionSafeActivity;
import com.android.contacts.common.list.OnPhoneNumberPickerActionListener;
import com.android.dialer.DialtactsActivity;
import com.android.dialer.R;
-import com.android.dialer.cmstats.DialerStats;
import com.android.dialer.interactions.PhoneNumberInteraction;
public class AllContactsActivity extends TransactionSafeActivity {
@@ -45,9 +44,6 @@ public class AllContactsActivity extends TransactionSafeActivity {
new OnPhoneNumberPickerActionListener() {
@Override
public void onPickPhoneNumberAction(Uri dataUri) {
- DialerStats.sendEvent(AllContactsActivity.this,
- DialerStats.Categories.INITIATE_CALL, "call_from_all_contacts");
-
// Specify call-origin so that users will see the previous tab instead of
// CallLog screen (search UI will be automatically exited).
PhoneNumberInteraction.startInteractionForPhoneCall(
diff --git a/src/com/android/dialer/list/SearchFragment.java b/src/com/android/dialer/list/SearchFragment.java
index d7b0ef3..36871dc 100644
--- a/src/com/android/dialer/list/SearchFragment.java
+++ b/src/com/android/dialer/list/SearchFragment.java
@@ -30,7 +30,6 @@ import com.android.contacts.common.list.OnPhoneNumberPickerActionListener;
import com.android.contacts.common.list.PhoneNumberPickerFragment;
import com.android.dialer.DialtactsActivity;
import com.android.dialer.R;
-import com.android.dialer.cmstats.DialerStats;
import com.android.dialer.dialpad.DialpadFragment;
import com.android.dialer.list.OnListFragmentScrolledListener;
@@ -104,15 +103,12 @@ public class SearchFragment extends PhoneNumberPickerFragment {
(DirectoryPartition)adapter.getPartition(adapter.getPartitionForPosition(position));
if (TextUtils.equals(partition.getLabel(),
getResources().getString(R.string.nearby_places))) {
- DialerStats.sendEvent(getContext(), "lookup", "nearby_lookup");
}
super.onItemClick(position, id);
} else if (shortcutType == DialerPhoneNumberListAdapter.SHORTCUT_DIRECT_CALL) {
final OnPhoneNumberPickerActionListener listener =
getOnPhoneNumberPickerListener();
if (listener != null) {
- DialerStats.sendEvent(getContext(),
- DialerStats.Categories.INITIATE_CALL, "call_from_direct_dial_search");
listener.onCallNumberDirectly(getQueryString());
}
} else if (shortcutType == DialerPhoneNumberListAdapter.SHORTCUT_ADD_NUMBER_TO_CONTACTS) {
--
1.8.3.1

View File

@ -0,0 +1,36 @@
From ff9c00d3b29dfd10b3332625ebed85a46f56bac6 Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Tue, 18 Dec 2018 23:28:32 -0500
Subject: [PATCH] Remove CMStats
Change-Id: I5439906a93869efae9d294d3197e4ada80a0c248
---
src/com/android/incallui/ContactInfoCache.java | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/com/android/incallui/ContactInfoCache.java b/src/com/android/incallui/ContactInfoCache.java
index bccc7fc..4bbf8fa 100644
--- a/src/com/android/incallui/ContactInfoCache.java
+++ b/src/com/android/incallui/ContactInfoCache.java
@@ -29,7 +29,6 @@ import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import com.android.dialer.calllog.ContactInfo;
-import com.android.dialer.cmstats.DialerStats;
import com.android.dialer.lookup.ReverseLookupThread;
import com.android.incallui.service.PhoneNumberService;
import com.android.incalluibind.ServiceFactory;
@@ -350,10 +349,6 @@ public class ContactInfoCache implements ContactsAsyncHelper.OnImageLoadComplete
entry.photo = null;
}
- DialerStats.sendEvent(mContext,
- DialerStats.Categories.INCALL_CONTACT_IMAGE,
- entry.photo != null ? "incall_image_found" : "incall_image_not_found");
-
sendImageNotifications(callId, entry);
clearCallbacks(callId);
}
--
1.8.3.1

View File

@ -1,17 +1,17 @@
From 2abc960a4b866201eb63d86c8a6c2e21841e5500 Mon Sep 17 00:00:00 2001
From dec39e7972d1f57b07b924eb33c4ee6b00e78147 Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Tue, 18 Dec 2018 22:05:54 -0500
Date: Tue, 18 Dec 2018 23:27:04 -0500
Subject: [PATCH] Remove CMStats
Change-Id: Ibbe36242e304717c0ef6ce9d3fc566da91830b1a
Change-Id: Ia1d9157ab9091176d73bf603e49d8b444218cb16
---
AndroidManifest.xml | 8 --------
src/com/android/settings/Settings.java | 1 -
src/com/android/settings/cyanogenmod/PrivacySettings.java | 2 --
3 files changed, 11 deletions(-)
AndroidManifest.xml | 26 ----------------------
src/com/android/settings/Settings.java | 1 -
.../settings/cyanogenmod/PrivacySettings.java | 2 --
3 files changed, 29 deletions(-)
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index b562de2..6f61c21 100644
index b562de2..f7f9396 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1872,14 +1872,6 @@
@ -29,6 +29,31 @@ index b562de2..6f61c21 100644
<activity android:name=".cyanogenmod.ChangeLog" />
<activity android:name=".cyanogenmod.ContributorsCloud" />
@@ -2137,24 +2129,6 @@
</intent-filter>
</receiver>
- <!-- Anonymous Statistics -->
- <receiver android:name=".cmstats.ReportingServiceManager"
- android:enabled="true"
- android:exported="false"
- android:label="ReportingServiceManager">
- <intent-filter>
- <action android:name="android.intent.action.BOOT_COMPLETED" />
- <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
- </intent-filter>
- </receiver>
-
- <service android:label="ReportingService"
- android:enabled="true"
- android:exported="false"
- android:name=".cmstats.ReportingService">
- </service>
-
-
<!-- Watch for ContactsContract.Profile changes and update the user's photo. -->
<receiver android:name=".users.ProfileUpdateReceiver">
<intent-filter>
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index 81b8cf6..4642581 100644
--- a/src/com/android/settings/Settings.java

View File

@ -63,13 +63,14 @@ patchWorkspace() {
repopick -it asb-2018.11-cm11 -e 234695;
repopick -it cm.service.adb.root; #security fix for -userdebug
repopick -it asb-2018.12-cm11;
sed -i 's/2018-08-01/2018-12-01/' build/core/version_defaults.mk; #dirty lies! (kinda)
source "$DOS_SCRIPTS/Patch.sh";
source "$DOS_SCRIPTS/Defaults.sh";
source "$DOS_SCRIPTS/Rebrand.sh";
#if [ "$DOS_OVERCLOCKS_ENABLED" = true ]; then source "$DOS_SCRIPTS/Overclock.sh"; fi;
if [ "$DOS_OVERCLOCKS_ENABLED" = true ]; then source "$DOS_SCRIPTS_COMMON/Overclock.sh"; fi;
source "$DOS_SCRIPTS/Optimize.sh";
#source "$DOS_SCRIPTS_COMMON/Deblob.sh";
source "$DOS_SCRIPTS_COMMON/Deblob.sh";
source "$DOS_SCRIPTS_COMMON/Patch_CVE.sh";
source build/envsetup.sh;
}

View File

@ -83,6 +83,13 @@ if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then patch -p1 < "$DOS_PATCHES/android_f
changeDefaultDNS;
#patch -p1 < "$DOS_PATCHES/android_frameworks_base/0008-Disable_Analytics.patch"; #Disable/reduce functionality of various ad/analytics libraries #TODO
enterAndClear "packages/apps/Dialer";
rm -rf src/com/android/dialer/cmstats;
patch -p1 < "$DOS_PATCHES/android_packages_apps_Dialer/0001-Remove_Analytics.patch"; #Remove CMStats
enterAndClear "packages/apps/InCallUI";
patch -p1 < "$DOS_PATCHES/android_packages_apps_InCallUI/0001-Remove_Analytics.patch"; #Remove CMStats
enterAndClear "packages/apps/Settings";
sed -i 's/private int mPasswordMaxLength = 16;/private int mPasswordMaxLength = 48;/' src/com/android/settings/ChooseLockPassword.java; #Increase max password length
if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then sed -i 's/GSETTINGS_PROVIDER = "com.google.settings";/GSETTINGS_PROVIDER = "com.google.oQuae4av";/' src/com/android/settings/PrivacySettings.java; fi; #microG doesn't support Backup, hide the options
@ -121,14 +128,15 @@ if [ "$DOS_HOSTS_BLOCKING" = false ]; then echo "PRODUCT_PACKAGES += $DOS_HOSTS_
#START OF DEVICE CHANGES
#
enterAndClear "device/zte/nex"
sed -i 's/ro.sf.lcd_density=240/ro.sf.lcd_density=180/' system.prop;
echo "TARGET_DISPLAY_USE_RETIRE_FENCE := true" >> BoardConfig.mk;
sed -i 's/libm libc/libm libc libutils/' charger/Android.mk;
mv cm.mk lineage.mk;
sed -i 's/cm_/lineage_/' lineage.mk vendorsetup.sh;
awk -i inplace '!/WCNSS_qcom_wlan_nv_2.bin/' proprietary-files.txt;
echo "TARGET_DISPLAY_USE_RETIRE_FENCE := true" >> BoardConfig.mk;
sed -i 's/libm libc/libm libc libutils/' charger/Android.mk;
sed -i 's/ro.sf.lcd_density=240/ro.sf.lcd_density=180/' system.prop;
awk -i inplace '!/WCNSS_qcom_wlan_nv_2.bin/' proprietary-files.txt; #Missing
#In nex-vendor-blobs.mk
# "system/lib/libtime_genoff.so" -> "obj/lib/libtime_genoff.so"
# Add "camera.msm8960.so"
enterAndClear "kernel/zte/msm8930"
patch -p1 < "$DOS_PATCHES/android_kernel_zte_msm8930/0001-MDP-Fix.patch";

View File

@ -67,7 +67,7 @@ buildAll() {
brunch lineage_h850-user;
brunch lineage_hammerhead-user;
#brunch lineage_jfltexx-user; #still in bringup
brunch lineage_klte-userdebug; #TODO: TEST ME AGAIN
brunch lineage_klte-user; #broken
brunch lineage_m8-user;
brunch lineage_marlin-user;
brunch lineage_mata-user;