mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-12-25 07:29:24 -05:00
19.1+: Add the SUPL toggle setting from GrapheneOS
Will need some work to apply on 17.1/18.1 Signed-off-by: Tad <tad@spotco.us>
This commit is contained in:
parent
3047b3b269
commit
49f5f1c674
@ -56,6 +56,15 @@ nojit
|
||||
9 https://github.com/GrapheneOS/platform_build/commit/5b9927197e63593b9220d1a9280021252ef205e9
|
||||
9 https://github.com/GrapheneOS/platform_build/commit/e36c7aefaa78a1ed5b94c7f51d29277008eea232
|
||||
|
||||
[implemented] strict package verification
|
||||
13 https://github.com/GrapheneOS/platform_frameworks_base/commit/6cd9eb28a755c520a398f6ed7b0f2e58ff4ccff2
|
||||
13 https://github.com/GrapheneOS/platform_frameworks_base/commit/48f947b0466ce9646d590d5078802cac809460dd
|
||||
13 https://github.com/GrapheneOS/platform_frameworks_base/commit/3c5c8b61a114d89cb0bdb1b9e36f15e9b27c0f27
|
||||
|
||||
[implemented] supl toggle
|
||||
13 https://github.com/GrapheneOS/platform_frameworks_base/commit/3aeafd9e58435932fa81a9b71fea5f1dd4a73c6d
|
||||
13 https://github.com/GrapheneOS/platform_packages_apps_Settings/commit/7727734599ea166eca246094d859fe1ddc094139
|
||||
|
||||
[implemented] appops reset fix
|
||||
13 https://github.com/GrapheneOS/platform_frameworks_base/commit/41446b749e0851572e280f88b37db05f6283e0c3
|
||||
13 https://github.com/GrapheneOS/platform_frameworks_base/commit/e7022b12acbc1b87c07f9c4ed7b22bae9588c7ea
|
||||
|
@ -13,10 +13,10 @@ Subject: [PATCH] add auto-reboot setting
|
||||
create mode 100644 src/com/android/settings/security/AutoRebootPreferenceController.java
|
||||
|
||||
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
|
||||
index c2a7e7dacd..275d2a2fc0 100644
|
||||
index e1976fb5cf..4c45ded7fa 100644
|
||||
--- a/res/values/arrays.xml
|
||||
+++ b/res/values/arrays.xml
|
||||
@@ -170,6 +170,37 @@
|
||||
@@ -176,6 +176,37 @@
|
||||
<item>1800000</item>
|
||||
</string-array>
|
||||
|
||||
|
@ -12,7 +12,7 @@ Subject: [PATCH] add bluetooth auto-turn-off setting
|
||||
create mode 100644 src/com/android/settings/bluetooth/BluetoothTimeoutPreferenceController.java
|
||||
|
||||
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
|
||||
index 275d2a2fc0..3b0d93ad6f 100644
|
||||
index 4c45ded7fa..a36f468bfc 100644
|
||||
--- a/res/values/arrays.xml
|
||||
+++ b/res/values/arrays.xml
|
||||
@@ -39,6 +39,50 @@
|
||||
|
@ -12,7 +12,7 @@ Subject: [PATCH] add Wi-Fi timeout feature
|
||||
create mode 100644 src/com/android/settings/wifi/WifiTimeoutPreferenceController.java
|
||||
|
||||
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
|
||||
index 3b0d93ad6f..32acf323d3 100644
|
||||
index a36f468bfc..83345cbceb 100644
|
||||
--- a/res/values/arrays.xml
|
||||
+++ b/res/values/arrays.xml
|
||||
@@ -83,6 +83,50 @@
|
||||
|
@ -13,10 +13,10 @@ RANDOMIZATION_ALWAYS is set as the default option
|
||||
5 files changed, 56 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
|
||||
index 32acf323d3..710459c40e 100644
|
||||
index 83345cbceb..79e036a04c 100644
|
||||
--- a/res/values/arrays.xml
|
||||
+++ b/res/values/arrays.xml
|
||||
@@ -1356,7 +1356,8 @@
|
||||
@@ -1362,7 +1362,8 @@
|
||||
</string-array>
|
||||
|
||||
<string-array name="wifi_privacy_entries">
|
||||
@ -26,7 +26,7 @@ index 32acf323d3..710459c40e 100644
|
||||
<item>Use device MAC</item>
|
||||
</string-array>
|
||||
|
||||
@@ -1372,6 +1373,7 @@
|
||||
@@ -1378,6 +1379,7 @@
|
||||
</string-array>
|
||||
|
||||
<string-array name="wifi_privacy_values" translatable="false">
|
||||
|
@ -11,10 +11,10 @@ Subject: [PATCH] add LTE only setting
|
||||
4 files changed, 39 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
|
||||
index 710459c40e..3611b883c3 100644
|
||||
index 79e036a04c..5907f3a52e 100644
|
||||
--- a/res/values/arrays.xml
|
||||
+++ b/res/values/arrays.xml
|
||||
@@ -1417,6 +1417,9 @@
|
||||
@@ -1423,6 +1423,9 @@
|
||||
<item>4</item> <!-- AutofillManager.FLAG_ADD_CLIENT_VERBOSE -->
|
||||
</string-array>
|
||||
|
||||
@ -24,7 +24,7 @@ index 710459c40e..3611b883c3 100644
|
||||
<string-array name="enabled_networks_choices" translatable="false">
|
||||
<item>@string/network_lte</item>
|
||||
<item>@string/network_3G</item>
|
||||
@@ -1506,7 +1509,7 @@
|
||||
@@ -1512,7 +1515,7 @@
|
||||
<item>CDMA + LTE/EvDo</item>
|
||||
<item>GSM/WCDMA/LTE</item>
|
||||
<item>LTE/CDMA/EvDo/GSM/WCDMA</item>
|
||||
|
@ -0,0 +1,108 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Muhomor <muhomor.dmitry@gmail.com>
|
||||
Date: Fri, 10 Feb 2023 12:54:21 +0200
|
||||
Subject: [PATCH] add a setting for forcibly disabling SUPL
|
||||
|
||||
Change-Id: I5c31c319d198f09ace493e601278f8224a259f05
|
||||
---
|
||||
core/java/android/provider/Settings.java | 9 +++++++++
|
||||
.../server/location/gnss/GnssConfiguration.java | 16 ++++++++++++++++
|
||||
.../location/gnss/GnssLocationProvider.java | 15 +++++++++++++++
|
||||
3 files changed, 40 insertions(+)
|
||||
|
||||
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
|
||||
index 72e6362c0a96..123738e812b4 100644
|
||||
--- a/core/java/android/provider/Settings.java
|
||||
+++ b/core/java/android/provider/Settings.java
|
||||
@@ -16429,6 +16429,15 @@ public final class Settings {
|
||||
* @hide
|
||||
*/
|
||||
public static final String SETTINGS_REBOOT_AFTER_TIMEOUT = "settings_reboot_after_timeout";
|
||||
+
|
||||
+ /**
|
||||
+ * Force disable Secure User Plane Location (SUPL), 0 or 1.
|
||||
+ * @hide
|
||||
+ */
|
||||
+ public static final String FORCE_DISABLE_SUPL = "force_disable_supl";
|
||||
+
|
||||
+ /** @hide */
|
||||
+ public static final int FORCE_DISABLE_SUPL_DEFAULT = 0;
|
||||
|
||||
/**
|
||||
* The amount of time in milliseconds before bluetooth is turned off
|
||||
diff --git a/services/core/java/com/android/server/location/gnss/GnssConfiguration.java b/services/core/java/com/android/server/location/gnss/GnssConfiguration.java
|
||||
index 7db234a29942..1bf84aed7803 100644
|
||||
--- a/services/core/java/com/android/server/location/gnss/GnssConfiguration.java
|
||||
+++ b/services/core/java/com/android/server/location/gnss/GnssConfiguration.java
|
||||
@@ -19,10 +19,12 @@ package com.android.server.location.gnss;
|
||||
import android.content.Context;
|
||||
import android.os.PersistableBundle;
|
||||
import android.os.SystemProperties;
|
||||
+import android.provider.Settings;
|
||||
import android.telephony.CarrierConfigManager;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
+import android.util.Slog;
|
||||
|
||||
import com.android.internal.util.FrameworkStatsLog;
|
||||
|
||||
@@ -226,6 +228,9 @@ public class GnssConfiguration {
|
||||
* Overlay carrier properties from a debug configuration file.
|
||||
*/
|
||||
loadPropertiesFromGpsDebugConfig(mProperties);
|
||||
+
|
||||
+ applyConfigOverrides(mContext, mProperties);
|
||||
+
|
||||
mEsExtensionSec = getRangeCheckedConfigEsExtensionSec();
|
||||
|
||||
logConfigurations();
|
||||
@@ -411,4 +416,15 @@ public class GnssConfiguration {
|
||||
private static native boolean native_set_satellite_blocklist(int[] constellations, int[] svIds);
|
||||
|
||||
private static native boolean native_set_es_extension_sec(int emergencyExtensionSeconds);
|
||||
+
|
||||
+ private static void applyConfigOverrides(Context ctx, Properties props) {
|
||||
+ String key = Settings.Global.FORCE_DISABLE_SUPL;
|
||||
+ int def = Settings.Global.FORCE_DISABLE_SUPL_DEFAULT;
|
||||
+ if (Settings.Global.getInt(ctx.getContentResolver(), key, def) == 1) {
|
||||
+ props.setProperty(CONFIG_SUPL_MODE, "0");
|
||||
+ Slog.d(TAG, "SUPL is force disabled");
|
||||
+ } else {
|
||||
+ Slog.d(TAG, "SUPL is not force disabled");
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
diff --git a/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java b/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java
|
||||
index 65f5b836bfcf..4a3f25eae6af 100644
|
||||
--- a/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java
|
||||
+++ b/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java
|
||||
@@ -90,6 +90,7 @@ import android.telephony.gsm.GsmCellLocation;
|
||||
import android.text.TextUtils;
|
||||
import android.text.format.DateUtils;
|
||||
import android.util.Log;
|
||||
+import android.util.Slog;
|
||||
import android.util.TimeUtils;
|
||||
|
||||
import com.android.internal.annotations.GuardedBy;
|
||||
@@ -445,6 +446,20 @@ public class GnssLocationProvider extends AbstractLocationProvider implements
|
||||
mGnssNative.setNotificationCallbacks(this);
|
||||
mGnssNative.setLocationRequestCallbacks(this);
|
||||
mGnssNative.setTimeCallbacks(this);
|
||||
+
|
||||
+ mContext.getContentResolver().registerContentObserver(
|
||||
+ Settings.Global.getUriFor(Settings.Global.FORCE_DISABLE_SUPL),
|
||||
+ false, new ContentObserver(mHandler) {
|
||||
+ @Override
|
||||
+ public void onChange(boolean selfChange) {
|
||||
+ var cr = mContext.getContentResolver();
|
||||
+ String key = Settings.Global.FORCE_DISABLE_SUPL;
|
||||
+ int def = Settings.Global.FORCE_DISABLE_SUPL_DEFAULT;
|
||||
+
|
||||
+ Slog.d(TAG, "FORCE_DISABLE_SUPL changed, value: " + Settings.Global.getInt(cr, key, def));
|
||||
+ mGnssConfiguration.reloadGpsProperties();
|
||||
+ }
|
||||
+ });
|
||||
}
|
||||
|
||||
/** Called when system is ready. */
|
@ -0,0 +1,93 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Muhomor <muhomor.dmitry@gmail.com>
|
||||
Date: Fri, 10 Feb 2023 12:44:30 +0200
|
||||
Subject: [PATCH] add a toggle for forcibly disabling SUPL
|
||||
|
||||
---
|
||||
res/values/strings.xml | 3 ++
|
||||
res/xml/location_settings.xml | 7 +++
|
||||
.../ForceDisableSuplPrefController.java | 45 +++++++++++++++++++
|
||||
3 files changed, 55 insertions(+)
|
||||
create mode 100644 src/com/android/settings/location/ForceDisableSuplPrefController.java
|
||||
|
||||
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
||||
index 3d44ae6ca6..d2ffb91417 100644
|
||||
--- a/res/values/strings.xml
|
||||
+++ b/res/values/strings.xml
|
||||
@@ -13706,4 +13706,7 @@
|
||||
|
||||
<string name="connectivity_check_title">Internet connectivity check</string>
|
||||
<string name="connectivity_check_summary">HTTP endpoints to use for performing internet connectivity checks.</string>
|
||||
+
|
||||
+ <string name="force_disable_supl_title">Force disable Secure User Plane Location (SUPL)</string>
|
||||
+ <string name="force_disable_supl_summary">Always disable SUPL assisted location support regardless of carrier configuration (does not disable control plane A-GNSS and DivestOS does not send IMSI to the SUPL)</string>
|
||||
</resources>
|
||||
diff --git a/res/xml/location_settings.xml b/res/xml/location_settings.xml
|
||||
index fe87efd73d..74502a7d58 100644
|
||||
--- a/res/xml/location_settings.xml
|
||||
+++ b/res/xml/location_settings.xml
|
||||
@@ -66,6 +66,13 @@
|
||||
android:title="@string/location_services_preference_title"
|
||||
settings:controller="com.android.settings.location.LocationServicesPreferenceController"/>
|
||||
|
||||
+
|
||||
+ <com.android.settingslib.RestrictedSwitchPreference
|
||||
+ android:key="force_disable_supl"
|
||||
+ android:title="@string/force_disable_supl_title"
|
||||
+ android:summary="@string/force_disable_supl_summary"
|
||||
+ settings:controller="com.android.settings.location.ForceDisableSuplPrefController"/>
|
||||
+
|
||||
</PreferenceCategory>
|
||||
|
||||
<com.android.settingslib.widget.FooterPreference
|
||||
diff --git a/src/com/android/settings/location/ForceDisableSuplPrefController.java b/src/com/android/settings/location/ForceDisableSuplPrefController.java
|
||||
new file mode 100644
|
||||
index 0000000000..3a44261cc5
|
||||
--- /dev/null
|
||||
+++ b/src/com/android/settings/location/ForceDisableSuplPrefController.java
|
||||
@@ -0,0 +1,45 @@
|
||||
+package com.android.settings.location;
|
||||
+
|
||||
+import android.content.Context;
|
||||
+import android.os.Process;
|
||||
+import android.provider.Settings;
|
||||
+
|
||||
+import com.android.settings.core.TogglePreferenceController;
|
||||
+
|
||||
+public class ForceDisableSuplPrefController extends TogglePreferenceController {
|
||||
+
|
||||
+ public ForceDisableSuplPrefController(Context ctx, String key) {
|
||||
+ super(ctx, key);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getAvailabilityStatus() {
|
||||
+ if (!Process.myUserHandle().isSystem()) {
|
||||
+ return DISABLED_FOR_USER;
|
||||
+ }
|
||||
+
|
||||
+ return AVAILABLE;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isChecked() {
|
||||
+ var cr = mContext.getContentResolver();
|
||||
+ String key = Settings.Global.FORCE_DISABLE_SUPL;
|
||||
+ int def = Settings.Global.FORCE_DISABLE_SUPL_DEFAULT;
|
||||
+
|
||||
+ return Settings.Global.getInt(cr, key, def) == 1;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean setChecked(boolean isChecked) {
|
||||
+ var cr = mContext.getContentResolver();
|
||||
+ String key = Settings.Global.FORCE_DISABLE_SUPL;
|
||||
+
|
||||
+ return Settings.Global.putInt(cr, key, isChecked ? 1 : 0);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getSliceHighlightMenuRes() {
|
||||
+ return NO_RES;
|
||||
+ }
|
||||
+}
|
@ -0,0 +1,109 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Muhomor <muhomor.dmitry@gmail.com>
|
||||
Date: Fri, 10 Feb 2023 12:54:21 +0200
|
||||
Subject: [PATCH] add a setting for forcibly disabling SUPL
|
||||
|
||||
Change-Id: I5c31c319d198f09ace493e601278f8224a259f05
|
||||
---
|
||||
core/java/android/provider/Settings.java | 9 +++++++++
|
||||
.../server/location/gnss/GnssConfiguration.java | 16 ++++++++++++++++
|
||||
.../location/gnss/GnssLocationProvider.java | 15 +++++++++++++++
|
||||
3 files changed, 40 insertions(+)
|
||||
|
||||
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
|
||||
index e12274516a55..1ccb146429f2 100644
|
||||
--- a/core/java/android/provider/Settings.java
|
||||
+++ b/core/java/android/provider/Settings.java
|
||||
@@ -17245,6 +17245,15 @@ public final class Settings {
|
||||
*/
|
||||
public static final String SETTINGS_REBOOT_AFTER_TIMEOUT = "settings_reboot_after_timeout";
|
||||
|
||||
+ /**
|
||||
+ * Force disable Secure User Plane Location (SUPL), 0 or 1.
|
||||
+ * @hide
|
||||
+ */
|
||||
+ public static final String FORCE_DISABLE_SUPL = "force_disable_supl";
|
||||
+
|
||||
+ /** @hide */
|
||||
+ public static final int FORCE_DISABLE_SUPL_DEFAULT = 0;
|
||||
+
|
||||
/**
|
||||
* The amount of time in milliseconds before a disconnected Wi-Fi adapter is turned off
|
||||
* @hide
|
||||
diff --git a/services/core/java/com/android/server/location/gnss/GnssConfiguration.java b/services/core/java/com/android/server/location/gnss/GnssConfiguration.java
|
||||
index 1435016fc55a..db8131729555 100644
|
||||
--- a/services/core/java/com/android/server/location/gnss/GnssConfiguration.java
|
||||
+++ b/services/core/java/com/android/server/location/gnss/GnssConfiguration.java
|
||||
@@ -19,11 +19,13 @@ package com.android.server.location.gnss;
|
||||
import android.content.Context;
|
||||
import android.os.PersistableBundle;
|
||||
import android.os.SystemProperties;
|
||||
+import android.provider.Settings;
|
||||
import android.telephony.CarrierConfigManager;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
+import android.util.Slog;
|
||||
|
||||
import com.android.internal.util.FrameworkStatsLog;
|
||||
|
||||
@@ -274,6 +276,9 @@ public class GnssConfiguration {
|
||||
* Overlay carrier properties from a debug configuration file.
|
||||
*/
|
||||
loadPropertiesFromGpsDebugConfig(mProperties);
|
||||
+
|
||||
+ applyConfigOverrides(mContext, mProperties);
|
||||
+
|
||||
mEsExtensionSec = getRangeCheckedConfigEsExtensionSec();
|
||||
|
||||
logConfigurations();
|
||||
@@ -476,4 +481,15 @@ public class GnssConfiguration {
|
||||
private static native boolean native_set_satellite_blocklist(int[] constellations, int[] svIds);
|
||||
|
||||
private static native boolean native_set_es_extension_sec(int emergencyExtensionSeconds);
|
||||
+
|
||||
+ private static void applyConfigOverrides(Context ctx, Properties props) {
|
||||
+ String key = Settings.Global.FORCE_DISABLE_SUPL;
|
||||
+ int def = Settings.Global.FORCE_DISABLE_SUPL_DEFAULT;
|
||||
+ if (Settings.Global.getInt(ctx.getContentResolver(), key, def) == 1) {
|
||||
+ props.setProperty(CONFIG_SUPL_MODE, "0");
|
||||
+ Slog.d(TAG, "SUPL is force disabled");
|
||||
+ } else {
|
||||
+ Slog.d(TAG, "SUPL is not force disabled");
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
diff --git a/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java b/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java
|
||||
index 6ddd57c1ff11..2ccdb9e14507 100644
|
||||
--- a/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java
|
||||
+++ b/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java
|
||||
@@ -100,6 +100,7 @@ import android.telephony.TelephonyManager;
|
||||
import android.text.TextUtils;
|
||||
import android.text.format.DateUtils;
|
||||
import android.util.Log;
|
||||
+import android.util.Slog;
|
||||
import android.util.TimeUtils;
|
||||
|
||||
import com.android.internal.annotations.GuardedBy;
|
||||
@@ -481,6 +482,20 @@ public class GnssLocationProvider extends AbstractLocationProvider implements
|
||||
mGnssNative.setNotificationCallbacks(this);
|
||||
mGnssNative.setLocationRequestCallbacks(this);
|
||||
mGnssNative.setTimeCallbacks(this);
|
||||
+
|
||||
+ mContext.getContentResolver().registerContentObserver(
|
||||
+ Settings.Global.getUriFor(Settings.Global.FORCE_DISABLE_SUPL),
|
||||
+ false, new ContentObserver(mHandler) {
|
||||
+ @Override
|
||||
+ public void onChange(boolean selfChange) {
|
||||
+ var cr = mContext.getContentResolver();
|
||||
+ String key = Settings.Global.FORCE_DISABLE_SUPL;
|
||||
+ int def = Settings.Global.FORCE_DISABLE_SUPL_DEFAULT;
|
||||
+
|
||||
+ Slog.d(TAG, "FORCE_DISABLE_SUPL changed, value: " + Settings.Global.getInt(cr, key, def));
|
||||
+ mGnssConfiguration.reloadGpsProperties();
|
||||
+ }
|
||||
+ });
|
||||
}
|
||||
|
||||
/** Called when system is ready. */
|
@ -0,0 +1,92 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Muhomor <muhomor.dmitry@gmail.com>
|
||||
Date: Fri, 10 Feb 2023 12:44:30 +0200
|
||||
Subject: [PATCH] add a toggle for forcibly disabling SUPL
|
||||
|
||||
---
|
||||
res/values/strings.xml | 2 +
|
||||
res/xml/location_settings.xml | 7 +++
|
||||
.../ForceDisableSuplPrefController.java | 45 +++++++++++++++++++
|
||||
3 files changed, 54 insertions(+)
|
||||
create mode 100644 src/com/android/settings/location/ForceDisableSuplPrefController.java
|
||||
|
||||
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
||||
index 3ca2c3f273..a2b4120e12 100644
|
||||
--- a/res/values/strings.xml
|
||||
+++ b/res/values/strings.xml
|
||||
@@ -14465,4 +14465,6 @@
|
||||
<string name="connectivity_check_title">Internet connectivity check</string>
|
||||
<string name="connectivity_check_summary">HTTP endpoints to use for performing internet connectivity checks.</string>
|
||||
|
||||
+ <string name="force_disable_supl_title">Force disable Secure User Plane Location (SUPL)</string>
|
||||
+ <string name="force_disable_supl_summary">Always disable SUPL assisted location support regardless of carrier configuration (does not disable control plane A-GNSS and DivestOS does not send IMSI to the SUPL)</string>
|
||||
</resources>
|
||||
diff --git a/res/xml/location_settings.xml b/res/xml/location_settings.xml
|
||||
index fe87efd73d..74502a7d58 100644
|
||||
--- a/res/xml/location_settings.xml
|
||||
+++ b/res/xml/location_settings.xml
|
||||
@@ -66,6 +66,13 @@
|
||||
android:title="@string/location_services_preference_title"
|
||||
settings:controller="com.android.settings.location.LocationServicesPreferenceController"/>
|
||||
|
||||
+
|
||||
+ <com.android.settingslib.RestrictedSwitchPreference
|
||||
+ android:key="force_disable_supl"
|
||||
+ android:title="@string/force_disable_supl_title"
|
||||
+ android:summary="@string/force_disable_supl_summary"
|
||||
+ settings:controller="com.android.settings.location.ForceDisableSuplPrefController"/>
|
||||
+
|
||||
</PreferenceCategory>
|
||||
|
||||
<com.android.settingslib.widget.FooterPreference
|
||||
diff --git a/src/com/android/settings/location/ForceDisableSuplPrefController.java b/src/com/android/settings/location/ForceDisableSuplPrefController.java
|
||||
new file mode 100644
|
||||
index 0000000000..3a44261cc5
|
||||
--- /dev/null
|
||||
+++ b/src/com/android/settings/location/ForceDisableSuplPrefController.java
|
||||
@@ -0,0 +1,45 @@
|
||||
+package com.android.settings.location;
|
||||
+
|
||||
+import android.content.Context;
|
||||
+import android.os.Process;
|
||||
+import android.provider.Settings;
|
||||
+
|
||||
+import com.android.settings.core.TogglePreferenceController;
|
||||
+
|
||||
+public class ForceDisableSuplPrefController extends TogglePreferenceController {
|
||||
+
|
||||
+ public ForceDisableSuplPrefController(Context ctx, String key) {
|
||||
+ super(ctx, key);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getAvailabilityStatus() {
|
||||
+ if (!Process.myUserHandle().isSystem()) {
|
||||
+ return DISABLED_FOR_USER;
|
||||
+ }
|
||||
+
|
||||
+ return AVAILABLE;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isChecked() {
|
||||
+ var cr = mContext.getContentResolver();
|
||||
+ String key = Settings.Global.FORCE_DISABLE_SUPL;
|
||||
+ int def = Settings.Global.FORCE_DISABLE_SUPL_DEFAULT;
|
||||
+
|
||||
+ return Settings.Global.getInt(cr, key, def) == 1;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean setChecked(boolean isChecked) {
|
||||
+ var cr = mContext.getContentResolver();
|
||||
+ String key = Settings.Global.FORCE_DISABLE_SUPL;
|
||||
+
|
||||
+ return Settings.Global.putInt(cr, key, isChecked ? 1 : 0);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getSliceHighlightMenuRes() {
|
||||
+ return NO_RES;
|
||||
+ }
|
||||
+}
|
@ -786,7 +786,8 @@ changeDefaultDNS() {
|
||||
echo "You must first set a preset via the DOS_DEFAULT_DNS_PRESET variable in init.sh!";
|
||||
fi;
|
||||
|
||||
local files="bionic/libc/dns/net/getaddrinfo.c frameworks/base/core/java/android/net/util/DnsUtils.java frameworks/base/core/java/com/android/internal/net/VpnProfile.java frameworks/base/core/res/res/values/config.xml frameworks/base/packages/SettingsLib/res/values/strings.xml frameworks/base/packages/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java frameworks/base/services/core/java/com/android/server/connectivity/NetworkDiagnostics.java frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java frameworks/base/services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java frameworks/base/services/java/com/android/server/connectivity/Tethering.java packages/apps/Dialer/java/com/android/voicemail/impl/sync/VvmNetworkRequestCallback.java packages/modules/Connectivity/framework/src/android/net/util/DnsUtils.java packages/modules/Connectivity/service/native/libs/libclat/clatutils_test.cpp packages/modules/Connectivity/service/ServiceConnectivityResources/res/values/config.xml packages/modules/Connectivity/service/src/com/android/server/connectivity/ClatCoordinator.java packages/modules/Connectivity/service/src/com/android/server/connectivity/NetworkDiagnostics.java packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java packages/modules/DnsResolver/DnsResolver/doh.rs packages/modules/DnsResolver/DnsResolver/getaddrinfo.cpp packages/modules/DnsResolver/getaddrinfo.cpp packages/modules/DnsResolver/PrivateDnsConfiguration.h";
|
||||
local files="bionic/libc/dns/net/getaddrinfo.c frameworks/base/core/java/android/net/util/DnsUtils.java frameworks/base/core/java/com/android/internal/net/VpnProfile.java frameworks/base/core/res/res/values/config.xml frameworks/base/packages/SettingsLib/res/values/strings.xml frameworks/base/packages/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java frameworks/base/services/core/java/com/android/server/connectivity/NetworkDiagnostics.java frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java frameworks/base/services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java frameworks/base/services/java/com/android/server/connectivity/Tethering.java packages/apps/Dialer/java/com/android/voicemail/impl/sync/VvmNetworkRequestCallback.java packages/modules/Connectivity/framework/src/android/net/util/DnsUtils.java packages/modules/Connectivity/service/native/libs/libclat/clatutils_test.cpp packages/modules/Connectivity/service/ServiceConnectivityResources/res/values/config.xml packages/modules/Connectivity/service/src/com/android/server/connectivity/ClatCoordinator.java packages/modules/Connectivity/service/src/com/android/server/connectivity/NetworkDiagnostics.java packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java packages/modules/DnsResolver/DnsResolver/doh.rs packages/modules/DnsResolver/DnsResolver/getaddrinfo.cpp packages/modules/DnsResolver/getaddrinfo.cpp";
|
||||
#TODO: handle packages/modules/DnsResolver/PrivateDnsConfiguration.h maybe? or just leave as is
|
||||
sed -i "s/8\.8\.8\.8/$dnsPrimary/g" $files &>/dev/null || true;
|
||||
sed -i "s/2001:4860:4860::8888/$dnsPrimaryV6/g" $files &>/dev/null || true;
|
||||
sed -i "s/8\.8\.4\.4/$dnsSecondary/g" $files &>/dev/null || true;
|
||||
|
@ -78,6 +78,7 @@ patchWorkspace() {
|
||||
#repopick -ift twelve-bt-sbc-hd-dualchannel;
|
||||
#repopick -it twelve-colors;
|
||||
repopick -if 330099; #Updater: Add prop for allowing major updates
|
||||
#repopick -it S_asb_2023-02;
|
||||
|
||||
sh "$DOS_SCRIPTS/Patch.sh";
|
||||
sh "$DOS_SCRIPTS_COMMON/Enable_Verity.sh";
|
||||
|
@ -171,6 +171,7 @@ applyPatch "$DOS_PATCHES/android_frameworks_base/0025-Monet_Toggle.patch"; #Make
|
||||
applyPatch "$DOS_PATCHES/android_frameworks_base/0026-Crash_Details.patch"; #Add an option to show the details of an application error to the user (GrapheneOS)
|
||||
applyPatch "$DOS_PATCHES/android_frameworks_base/0027-appops_reset_fix-1.patch"; #Revert "Null safe package name in AppOps writeState" (GrapheneOS)
|
||||
applyPatch "$DOS_PATCHES/android_frameworks_base/0027-appops_reset_fix-2.patch"; #appops: skip ops for invalid null package during state serialization (GrapheneOS)
|
||||
applyPatch "$DOS_PATCHES/android_frameworks_base/0028-SUPL_Toggle.patch"; #Add a setting for forcibly disabling SUPL (GrapheneOS)
|
||||
applyPatch "$DOS_PATCHES_COMMON/android_frameworks_base/0007-ABI_Warning.patch"; #Warn when running activity from 32 bit app on ARM64 devices. (AOSP)
|
||||
hardenLocationConf services/core/java/com/android/server/location/gnss/gps_debug.conf; #Harden the default GPS config
|
||||
sed -i 's/DEFAULT_USE_COMPACTION = false;/DEFAULT_USE_COMPACTION = true;/' services/core/java/com/android/server/am/CachedAppOptimizer.java; #Enable app compaction by default (GrapheneOS)
|
||||
@ -293,6 +294,7 @@ applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0009-Install_Restriction
|
||||
applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0012-hosts_toggle.patch"; #Add a toggle to disable /etc/hosts lookup (heavily based off of a GrapheneOS patch)
|
||||
applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0013-Captive_Portal_Toggle.patch"; #Add option to disable captive portal checks (GrapheneOS)
|
||||
applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0014-LTE_Only_Mode.patch"; #Add LTE only setting (GrapheneOS)
|
||||
applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0015-SUPL_Toggle.patch"; #Add a toggle for forcibly disabling SUPL (GrapheneOS)
|
||||
sed -i 's/if (isFullDiskEncrypted()) {/if (false) {/' src/com/android/settings/accessibility/*AccessibilityService*.java; #Never disable secure start-up when enabling an accessibility service
|
||||
fi;
|
||||
|
||||
|
@ -180,6 +180,7 @@ applyPatch "$DOS_PATCHES/android_frameworks_base/0029-Strict_Package_Checks-2.pa
|
||||
applyPatch "$DOS_PATCHES/android_frameworks_base/0030-agnss.goog_override.patch"; #Replace agnss.goog with the Broadcom PSDS server (heavily based off of a GrapheneOS patch)
|
||||
applyPatch "$DOS_PATCHES/android_frameworks_base/0031-appops_reset_fix-1.patch"; #Revert "Null safe package name in AppOps writeState" (GrapheneOS)
|
||||
applyPatch "$DOS_PATCHES/android_frameworks_base/0031-appops_reset_fix-2.patch"; #appops: skip ops for invalid null package during state serialization (GrapheneOS)
|
||||
applyPatch "$DOS_PATCHES/android_frameworks_base/0032-SUPL_Toggle.patch"; #Add a setting for forcibly disabling SUPL (GrapheneOS)
|
||||
hardenLocationConf services/core/java/com/android/server/location/gnss/gps_debug.conf; #Harden the default GPS config
|
||||
sed -i 's/DEFAULT_USE_COMPACTION = false;/DEFAULT_USE_COMPACTION = true;/' services/core/java/com/android/server/am/CachedAppOptimizer.java; #Enable app compaction by default (GrapheneOS)
|
||||
sed -i 's/DEFAULT_MAX_FILES = 1000;/DEFAULT_MAX_FILES = 0;/' services/core/java/com/android/server/DropBoxManagerService.java; #Disable DropBox internal logging service
|
||||
@ -301,6 +302,7 @@ applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0012-hosts_toggle.patch"
|
||||
applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0013-Captive_Portal_Toggle.patch"; #Add option to disable captive portal checks (GrapheneOS)
|
||||
applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0014-LTE_Only_Mode-1.patch"; #LTE Only Mode (GrapheneOS)
|
||||
applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0014-LTE_Only_Mode-2.patch"; #Fix LTE Only mode on World Mode (GrapheneOS)
|
||||
applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0015-SUPL_Toggle.patch"; #Add a toggle for forcibly disabling SUPL (GrapheneOS)
|
||||
fi;
|
||||
|
||||
if enterAndClear "packages/apps/SetupWizard"; then
|
||||
|
Loading…
Reference in New Issue
Block a user