Patch from CalyxOS to make AOSP less spyware

Signed-off-by: Tad <tad@spotco.us>
This commit is contained in:
Tad 2023-07-24 14:13:51 -04:00
parent 3708cee48a
commit c8d3354113
No known key found for this signature in database
GPG Key ID: B286E9F57A07424B
3 changed files with 45 additions and 1 deletions

View File

@ -0,0 +1,40 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Luca Stefani <luca.stefani.ge1@gmail.com>
Date: Thu, 20 Jan 2022 18:43:00 +0530
Subject: [PATCH] Delay FCM registration until it's actually required
Most users / carriers don't need this, so let's avoid registering it for everyone.
Change-Id: I3f57ce0a1184a510d09638c703236989f8596c5f
---
.../fcm/FcmRegistrationService.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/com/android/imsserviceentitlement/fcm/FcmRegistrationService.java b/src/com/android/imsserviceentitlement/fcm/FcmRegistrationService.java
index 184740d..cb777a3 100644
--- a/src/com/android/imsserviceentitlement/fcm/FcmRegistrationService.java
+++ b/src/com/android/imsserviceentitlement/fcm/FcmRegistrationService.java
@@ -30,6 +30,7 @@ import com.android.imsserviceentitlement.R;
import com.android.imsserviceentitlement.job.JobManager;
import com.android.imsserviceentitlement.utils.TelephonyUtils;
+import com.google.common.collect.ImmutableSet;
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;
import com.google.firebase.iid.FirebaseInstanceId;
@@ -110,8 +111,14 @@ public class FcmRegistrationService extends JobService {
* The token changes when the InstanceID becomes invalid (e.g. app data is deleted).
*/
protected void onHandleWork(JobParameters params) {
+ ImmutableSet<Integer> subIds = TelephonyUtils.getSubIdsWithFcmSupported(this);
+ if (subIds.size() == 0 && mFakeInstanceID == null) {
+ jobFinished(params, false);
+ return;
+ }
+
boolean wantsReschedule = false;
- for (int subId : TelephonyUtils.getSubIdsWithFcmSupported(this)) {
+ for (int subId : subIds) {
if (!updateFcmToken(getFirebaseInstanceId(), subId)) {
wantsReschedule = true;
}

View File

@ -727,7 +727,7 @@ deblobDevice() {
sed -i 's/bluetooth.emb_wp_mode=true/bluetooth.emb_wp_mode=false/' *.prop *.mk &>/dev/null || true; #Disable WiPower
sed -i 's/bluetooth.wipower=true/bluetooth.wipower=false/' *.prop *.mk &>/dev/null || true; #Disable WiPower
sed -i 's/wfd.enable=1/wfd.enable=0/' *.prop *.mk &>/dev/null || true; #Disable Wi-Fi display
sed -i '/vendor.camera.extensions/d' *.prop *.mk &>/dev/null || true; fi; #Disable camera extensions
sed -i '/vendor.camera.extensions/d' *.prop *.mk &>/dev/null || true; #Disable camera extensions
if [ -f system.prop ]; then
if ! grep -q "drm.service.enabled=false" system.prop; then echo "drm.service.enabled=false" >> system.prop; fi; #Disable DRM server
if [ "$DOS_DEBLOBBER_REMOVE_GRAPHICS" = true ]; then

View File

@ -276,6 +276,10 @@ applyPatch "$DOS_PATCHES/android_packages_apps_Dialer/0001-Not_Private_Banner.pa
sed -i 's/>true/>false/' java/com/android/incallui/res/values/lineage_config.xml; #XXX: temporary workaround for black screen on incoming calls https://gitlab.com/LineageOS/issues/android/-/issues/4632
fi;
if enterAndClear "packages/apps/ImsServiceEntitlement"; then
applyPatch "$DOS_PATCHES/android_packages_apps_ImsServiceEntitlement/0001-delay-fcm.patch"; #Delay FCM registration until it's actually required (CalyxOS)
fi;
if enterAndClear "packages/apps/LineageParts"; then
rm -rf src/org/lineageos/lineageparts/lineagestats/ res/xml/anonymous_stats.xml res/xml/preview_data.xml; #Nuke part of the analytics
applyPatch "$DOS_PATCHES/android_packages_apps_LineageParts/0001-Remove_Analytics.patch"; #Remove analytics (DivestOS)