18.1 Updates

- Update Settings and SetupWizard patches after the big SetupWizard UI update
- Use the latest captive portal patch, was also previously partially broken
  due to mis-apply

Signed-off-by: Tad <tad@spotco.us>
This commit is contained in:
Tad 2021-09-03 08:44:54 -04:00
parent f77971d38f
commit dd4457260f
2 changed files with 96 additions and 100 deletions

View File

@ -1,4 +1,4 @@
From f5e94f458e2496c4b5bb6d4a1b239ce24b84d898 Mon Sep 17 00:00:00 2001
From 234ea9eca07c828e2e34f462d10acb876bc59e09 Mon Sep 17 00:00:00 2001
From: MSe1969 <mse1969@posteo.de>
Date: Mon, 10 Sep 2018 12:05:40 +0200
Subject: [PATCH] Network & Internet Settings: Add option to switch off Captive
@ -10,30 +10,28 @@ Subject: [PATCH] Network & Internet Settings: Add option to switch off Captive
* Warning dialog is shown, when captive portal check is switched off
* Hidden under 'advanced'
Cherry-picked from lin16-microG repo and adapted to Q (e.g. androidx pref.)
Cherry-picked from lin17-microG repo
Change-Id: Ibbffdb5f3930df74ca8b4ba93d451f7fad086989
---
res/values-de/cm_strings.xml | 3 +
res/values/cm_strings.xml | 5 ++
res/xml/network_and_internet.xml | 6 ++
.../android/settings/ResetNetworkConfirm.java | 1 +
.../settings/ResetNetworkConfirm.java.rej | 11 +++
res/xml/network_and_internet.xml | 7 ++
.../android/settings/ResetNetworkConfirm.java | 4 +
...CaptivePortalModePreferenceController.java | 82 +++++++++++++++++++
.../network/CaptivePortalWarningDialog.java | 74 +++++++++++++++++
.../CaptivePortalWarningDialogHost.java | 32 ++++++++
.../network/NetworkDashboardFragment.java | 17 +++-
9 files changed, 230 insertions(+), 1 deletion(-)
create mode 100644 src/com/android/settings/ResetNetworkConfirm.java.rej
8 files changed, 223 insertions(+), 1 deletion(-)
create mode 100644 src/com/android/settings/network/CaptivePortalModePreferenceController.java
create mode 100644 src/com/android/settings/network/CaptivePortalWarningDialog.java
create mode 100644 src/com/android/settings/network/CaptivePortalWarningDialogHost.java
diff --git a/res/values-de/cm_strings.xml b/res/values-de/cm_strings.xml
index b21028ad93..f74eccd3d8 100644
index d981289421..3a66089d03 100644
--- a/res/values-de/cm_strings.xml
+++ b/res/values-de/cm_strings.xml
@@ -92,4 +92,7 @@
@@ -91,4 +91,7 @@
<string name="connected_tws_device_saved_title">Gespeicherte Kopfhörer</string>
<string name="fast_charging_title">Schnelles Laden</string>
<string name="fast_charging_summary">Deaktivieren, um die vom Gerät beim Laden erzeugte Wärme zu reduzieren oder die Lebensdauer des Akkus zu verlängern</string>
@ -42,13 +40,13 @@ index b21028ad93..f74eccd3d8 100644
+ <string name="captive_portal_switch_warning">Nach dem Ausschalten der Captive-Portal-Erkennung empfangen Sie keine Verbindungs-Rückmeldung mehr. Wirklich fortfahren?</string>
</resources>
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index c93c6e9959..cb46aff0ce 100644
index 099fb9eb07..8bbdef11f6 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -159,4 +159,9 @@
<!-- FastCharge feature -->
<string name="fast_charging_title">Fast charging</string>
<string name="fast_charging_summary">Disable to reduce the heat produced by the device while charging or to extend the lifespan of the battery</string>
@@ -162,4 +162,9 @@
<!-- Used in SetupWizard Wi-Fi network selection page [CHAR LIMIT=60] -->
<string name="wifi_setup_wizard_title">Select Wi\u2011Fi network</string>
+
+ <!-- Captive Portal -->
+ <string name="captive_portal_switch_title">Captive portal mode</string>
@ -56,22 +54,23 @@ index c93c6e9959..cb46aff0ce 100644
+ <string name="captive_portal_switch_warning">If you switch off the captive portal, you will not receive connectivity informations any longer. Really switch off?</string>
</resources>
diff --git a/res/xml/network_and_internet.xml b/res/xml/network_and_internet.xml
index 6bf6dbaccf..5773f6d2da 100644
index 6bf6dbaccf..38535bb4ba 100644
--- a/res/xml/network_and_internet.xml
+++ b/res/xml/network_and_internet.xml
@@ -118,6 +118,12 @@
android:positiveButtonText="@string/save"
android:negativeButtonText="@android:string/cancel" />
@@ -125,4 +125,11 @@
android:summary="@string/summary_placeholder"
android:order="25"
settings:controller="com.android.settings.network.AdaptiveConnectivityPreferenceController"/>
+
+ <SwitchPreference
+ android:key="captive_portal_switch"
+ android:title="@string/captive_portal_switch_title"
+ android:summary="@string/captive_portal_switch_summary"
+ android:order="20" />
+ android:order="30" />
+
<Preference
android:fragment="com.android.settings.network.AdaptiveConnectivitySettings"
android:key="adaptive_connectivity"
</PreferenceScreen>
diff --git a/src/com/android/settings/ResetNetworkConfirm.java b/src/com/android/settings/ResetNetworkConfirm.java
index 784ffa7719..b503298ad6 100644
--- a/src/com/android/settings/ResetNetworkConfirm.java
+++ b/src/com/android/settings/ResetNetworkConfirm.java
@@ -35,6 +35,7 @@ import android.os.Bundle;
@ -82,22 +81,19 @@ index 6bf6dbaccf..5773f6d2da 100644
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.view.LayoutInflater;
diff --git a/src/com/android/settings/ResetNetworkConfirm.java.rej b/src/com/android/settings/ResetNetworkConfirm.java.rej
--- /dev/null
+++ b/src/com/android/settings/ResetNetworkConfirm.java.rej
@@ -0,0 +1,11 @@
+diff a/src/com/android/settings/ResetNetworkConfirm.java b/src/com/android/settings/ResetNetworkConfirm.java (rejected hunks)
+@@ -125,6 +126,9 @@ public class ResetNetworkConfirm extends InstrumentedFragment {
+ }
+ }
+
++ Settings.Global.putInt(mContext.getContentResolver(),
++ Settings.Global.CAPTIVE_PORTAL_MODE, 1);
++
+ ImsManager.getInstance(mContext,
+ SubscriptionManager.getPhoneId(mSubId)).factoryReset();
+ restoreDefaultApn(mContext);
@@ -129,6 +130,9 @@ public class ResetNetworkConfirm extends InstrumentedFragment {
}
}
+ Settings.Global.putInt(mContext.getContentResolver(),
+ Settings.Global.CAPTIVE_PORTAL_MODE, 1);
+
restoreDefaultApn(mContext);
return isResetSucceed;
}
diff --git a/src/com/android/settings/network/CaptivePortalModePreferenceController.java b/src/com/android/settings/network/CaptivePortalModePreferenceController.java
new file mode 100644
index 0000000000..ae21b29292
--- /dev/null
+++ b/src/com/android/settings/network/CaptivePortalModePreferenceController.java
@@ -0,0 +1,82 @@
@ -184,6 +180,8 @@ diff --git a/src/com/android/settings/network/CaptivePortalModePreferenceControl
+ }
+}
diff --git a/src/com/android/settings/network/CaptivePortalWarningDialog.java b/src/com/android/settings/network/CaptivePortalWarningDialog.java
new file mode 100644
index 0000000000..d27bd7d2f0
--- /dev/null
+++ b/src/com/android/settings/network/CaptivePortalWarningDialog.java
@@ -0,0 +1,74 @@
@ -262,6 +260,8 @@ diff --git a/src/com/android/settings/network/CaptivePortalWarningDialog.java b/
+ }
+}
diff --git a/src/com/android/settings/network/CaptivePortalWarningDialogHost.java b/src/com/android/settings/network/CaptivePortalWarningDialogHost.java
new file mode 100644
index 0000000000..7a04d1f831
--- /dev/null
+++ b/src/com/android/settings/network/CaptivePortalWarningDialogHost.java
@@ -0,0 +1,32 @@
@ -297,6 +297,8 @@ diff --git a/src/com/android/settings/network/CaptivePortalWarningDialogHost.jav
+ */
+ void onCaptivePortalSwitchOffDialogDismissed();
+}
diff --git a/src/com/android/settings/network/NetworkDashboardFragment.java b/src/com/android/settings/network/NetworkDashboardFragment.java
index db704ae850..f4c5363d80 100644
--- a/src/com/android/settings/network/NetworkDashboardFragment.java
+++ b/src/com/android/settings/network/NetworkDashboardFragment.java
@@ -41,7 +41,7 @@ import java.util.List;

View File

@ -1,68 +1,61 @@
From 1326644f0e695266010461ba80543eba403c64e5 Mon Sep 17 00:00:00 2001
From 91cdd8cfebafcbfd226800cfdef80ec9a943e38b Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Wed, 28 Feb 2018 08:12:03 -0500
Date: Fri, 3 Sep 2021 08:52:48 -0400
Subject: [PATCH] Remove analytics
Change-Id: I189e9362c828569512e819cf655b03bfa3436830
Change-Id: I3f42646ba278ef6d0d4aa7565f8374047d599938
---
res/layout/setup_lineage_settings.xml | 36 -------------------
.../lineageos/setupwizard/FinishActivity.java | 12 -------
.../setupwizard/LineageSettingsActivity.java | 31 ----------------
res/layout/setup_lineage_settings.xml | 29 -----------------
.../lineageos/setupwizard/FinishActivity.java | 13 --------
.../setupwizard/LineageSettingsActivity.java | 31 -------------------
.../lineageos/setupwizard/SetupWizardApp.java | 1 -
4 files changed, 80 deletions(-)
4 files changed, 74 deletions(-)
diff --git a/res/layout/setup_lineage_settings.xml b/res/layout/setup_lineage_settings.xml
index b75af3c..15c2755 100644
index a222d5b..9645f95 100644
--- a/res/layout/setup_lineage_settings.xml
+++ b/res/layout/setup_lineage_settings.xml
@@ -51,42 +51,6 @@
android:text="@string/services_explanation"
android:clickable="true"/>
@@ -53,35 +53,6 @@
android:text="@string/services_explanation"
android:clickable="true" />
- <!-- 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">
-
-
- <CheckBox
- android:id="@+id/enable_metrics_checkbox"
- android:layout_width="wrap_content"
- <!-- 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:layout_gravity="top"
- android:layout_marginTop="5dp"
- android:duplicateParentState="true"
- android:clickable="false"/>
- android:paddingLeft="@dimen/location_margin_left"
- android:paddingRight="@dimen/content_margin_right"
- android:background="?android:attr/selectableItemBackground"
- android:clickable="true">
-
- <TextView
- android:id="@+id/enable_metrics_summary"
- android:layout_width="0px"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:textSize="15sp"
- android:lineSpacingExtra="@dimen/setup_line_spacing"
- android:gravity="top"
- android:layout_marginLeft="@dimen/location_text_margin_left"
- android:layout_marginRight="@dimen/location_text_margin_right"
- android:paddingBottom="@dimen/content_margin_bottom"
- android:text="@string/services_metrics_label"/>
-
- </LinearLayout>
- <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" />
-
<!-- Checkbox for using on-screen nav keys -->
<LinearLayout
android:id="@+id/nav_keys"
- <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" />
-
- </LinearLayout>
-
<!-- Checkbox for using on-screen nav keys -->
<LinearLayout
android:id="@+id/nav_keys"
diff --git a/src/org/lineageos/setupwizard/FinishActivity.java b/src/org/lineageos/setupwizard/FinishActivity.java
index 4eeaeb9..584af29 100644
index 12cda35..6248985 100644
--- a/src/org/lineageos/setupwizard/FinishActivity.java
+++ b/src/org/lineageos/setupwizard/FinishActivity.java
@@ -20,7 +20,6 @@ package org.lineageos.setupwizard;
@@ -23,7 +23,6 @@ import static org.lineageos.setupwizard.Manifest.permission.FINISH_SETUP;
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;
@ -70,7 +63,7 @@ index 4eeaeb9..584af29 100644
import static org.lineageos.setupwizard.SetupWizardApp.LOGV;
import static org.lineageos.setupwizard.SetupWizardApp.UPDATE_RECOVERY_PROP;
@@ -175,7 +174,6 @@ public class FinishActivity extends BaseSetupWizardActivity {
@@ -176,7 +175,6 @@ public class FinishActivity extends BaseSetupWizardActivity {
if (mEnableAccessibilityController != null) {
mEnableAccessibilityController.onDestroy();
}
@ -78,7 +71,7 @@ index 4eeaeb9..584af29 100644
handleNavKeys(mSetupWizardApp);
handleRecoveryUpdate(mSetupWizardApp);
final WallpaperManager wallpaperManager =
@@ -187,16 +185,6 @@ public class FinishActivity extends BaseSetupWizardActivity {
@@ -188,17 +186,6 @@ public class FinishActivity extends BaseSetupWizardActivity {
startActivityForResult(intent, NEXT_REQUEST);
}
@ -87,7 +80,8 @@ index 4eeaeb9..584af29 100644
- if (privacyData != null
- && privacyData.containsKey(KEY_SEND_METRICS)) {
- LineageSettings.Secure.putInt(setupWizardApp.getContentResolver(),
- LineageSettings.Secure.STATS_COLLECTION, privacyData.getBoolean(KEY_SEND_METRICS)
- LineageSettings.Secure.STATS_COLLECTION,
- privacyData.getBoolean(KEY_SEND_METRICS)
- ? 1 : 0);
- }
- }
@ -96,7 +90,7 @@ index 4eeaeb9..584af29 100644
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
index 4041f4b..0aaf96e 100644
index 4f5519d..c1f3698 100644
--- a/src/org/lineageos/setupwizard/LineageSettingsActivity.java
+++ b/src/org/lineageos/setupwizard/LineageSettingsActivity.java
@@ -18,7 +18,6 @@
@ -107,7 +101,7 @@ index 4041f4b..0aaf96e 100644
import android.app.Activity;
import android.content.Context;
@@ -55,17 +54,10 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
@@ -50,17 +49,10 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
private SetupWizardApp mSetupWizardApp;
@ -116,16 +110,16 @@ index 4041f4b..0aaf96e 100644
private boolean mSupportsKeyDisabler = false;
- private View.OnClickListener mMetricsClickListener = view -> {
- private final View.OnClickListener mMetricsClickListener = view -> {
- boolean checked = !mMetrics.isChecked();
- mMetrics.setChecked(checked);
- mSetupWizardApp.getSettingsBundle().putBoolean(KEY_SEND_METRICS, checked);
- };
-
private View.OnClickListener mNavKeysClickListener = view -> {
private final View.OnClickListener mNavKeysClickListener = view -> {
boolean checked = !mNavKeys.isChecked();
mNavKeys.setChecked(checked);
@@ -101,19 +93,6 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
@@ -97,19 +89,6 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
privacyPolicy.setMovementMethod(LinkMovementMethod.getInstance());
privacyPolicy.setText(ss);
@ -145,7 +139,7 @@ index 4041f4b..0aaf96e 100644
View navKeysRow = findViewById(R.id.nav_keys);
navKeysRow.setOnClickListener(mNavKeysClickListener);
mNavKeys = (CheckBox) findViewById(R.id.nav_keys_checkbox);
@@ -130,7 +109,6 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
@@ -126,7 +105,6 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
public void onResume() {
super.onResume();
updateDisableNavkeysOption();
@ -153,7 +147,7 @@ index 4041f4b..0aaf96e 100644
}
@Override
@@ -154,15 +132,6 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
@@ -150,15 +128,6 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
return R.drawable.ic_features;
}
@ -170,11 +164,11 @@ index 4041f4b..0aaf96e 100644
if (mSupportsKeyDisabler) {
final Bundle myPageBundle = mSetupWizardApp.getSettingsBundle();
diff --git a/src/org/lineageos/setupwizard/SetupWizardApp.java b/src/org/lineageos/setupwizard/SetupWizardApp.java
index 88581cf..757e0b1 100644
index b1755c7..c299457 100644
--- a/src/org/lineageos/setupwizard/SetupWizardApp.java
+++ b/src/org/lineageos/setupwizard/SetupWizardApp.java
@@ -63,7 +63,6 @@ public class SetupWizardApp extends Application {
public static final String EXTRA_IS_SETUP_FLOW = "isSetupFlow";
@@ -59,7 +59,6 @@ public class SetupWizardApp extends Application {
public static final String EXTRA_ENABLE_NEXT_ON_CONNECT = "wifi_enable_next_on_connect";
public static final String KEY_DETECT_CAPTIVE_PORTAL = "captive_portal_detection_enabled";
- public static final String KEY_SEND_METRICS = "send_metrics";
@ -182,5 +176,5 @@ index 88581cf..757e0b1 100644
public static final String ENABLE_RECOVERY_UPDATE = "enable_recovery_update";
public static final String UPDATE_RECOVERY_PROP = "persist.vendor.recovery_update";
--
2.30.2
2.31.1