This repository was archived by the owner on Mar 5, 2025. It is now read-only.
forked from cm13-microG/z_patches
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpatch_006_Settings.patch
More file actions
162 lines (152 loc) · 9.29 KB
/
Copy pathpatch_006_Settings.patch
File metadata and controls
162 lines (152 loc) · 9.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
From 8ac96af12eeb4f197633a111a87e978d783b1735 Mon Sep 17 00:00:00 2001
From: MSe1969 <mse1969@posteo.de>
Date: Thu, 28 Oct 2021 17:07:17 +0200
Subject: [PATCH] Device Info: Read new property to indicate custom build
version [3/3]
The 'official' Security string has always been taken from the LineageOS
sources, as Android security patches are frequently back-ported by the
members of the community.
Recently, certain ASB patches could not (yet) be backported, whilst it is
acknowledged, that they are relevant. Hence the official stance of the
LineageOS directors is to continue backporting any ASB patches, but not
to lift the security string in order to be transparent about the fact,
that the formal criteria to declare a patch level haven't been met.
The official patch level will be lifted accordingly, once the missing
patches will have been successfully backported and merged.
To consider that (not lifting the patch), but at the same time indicate,
that despite the missing patches, further backporting of security issues
is ongoing, a new "Custom build release" property 'ro.cm.custom_version'
is introduced to show this next to the "official" security string.
This commit provides a new preference to show this additional information.
Change-Id: I14f41ab305acaeaaab42596046498696d8e6bbda
---
res/values-de/cm_strings.xml | 2 ++
res/values-fr/cm_strings.xml | 2 ++
res/values-pl/cm_strings.xml | 2 ++
res/values-ru/cm_strings.xml | 2 ++
res/values/cm_strings.xml | 5 +++++
res/xml/device_info_settings.xml | 5 +++++
.../android/settings/DeviceInfoSettings.java | 17 +++++++++++++++++
7 files changed, 35 insertions(+)
diff --git a/res/values-de/cm_strings.xml b/res/values-de/cm_strings.xml
index b968d7b685..dbf15ccb70 100644
--- a/res/values-de/cm_strings.xml
+++ b/res/values-de/cm_strings.xml
@@ -349,4 +349,6 @@
<string name="shortcut_carrier_title">Netzbetreiber</string>
<string name="burnin_protection_title">Einbrennschutz</string>
<string name="burnin_protection_summary">Statisch angezeigte Elemente periodisch bewegen, um übermäßigen Bildschirmverschleiß in diesem Bereich zu vermeiden</string>
+ <string name="custom_patch">Custom Build Version</string>
+ <string name="custom_patch_info">Für diese Android-Version sind keine offiziellen Sicherheitsupdates mehr erhältlich. \nAlle enthaltenen Patches wurden aus neueren Versionen rückportiert.</string>
</resources>
diff --git a/res/values-fr/cm_strings.xml b/res/values-fr/cm_strings.xml
index 395b87195c..0a0dbfcd3a 100644
--- a/res/values-fr/cm_strings.xml
+++ b/res/values-fr/cm_strings.xml
@@ -352,4 +352,6 @@ Vous êtes maintenant à <xliff:g id="step_count">%1$d</xliff:g> étapes de l\'a
<string name="shortcut_carrier_title">Opérateurs réseau</string>
<string name="burnin_protection_title">Protection contre le brûlage de l\'écran</string>
<string name="burnin_protection_summary">Déplacer périodiquement les éléments affichés en permanence à l\'écran pour éviter l\'usure de celui-ci</string>
+ <string name="custom_patch">Version individuelle</string>
+ <string name="custom_patch_info">Il n\'y a pas de mises à jour de sécurité officielles disponibles pour cette version d\'Android. \nTous les correctifs contenus ont été répliqués à partir de versions plus récentes.</string>
</resources>
diff --git a/res/values-pl/cm_strings.xml b/res/values-pl/cm_strings.xml
index fc64753d57..479f61c0c8 100644
--- a/res/values-pl/cm_strings.xml
+++ b/res/values-pl/cm_strings.xml
@@ -353,4 +353,6 @@
<string name="shortcut_carrier_title">Operatorzy sieci</string>
<string name="burnin_protection_title">Zabezpieczenie przed wypaleniem ekranu</string>
<string name="burnin_protection_summary">Co jakiś czas przemieszcza trwale wyświetlane elementy, aby uniknąć wypalenia ekranu w danym obszarze</string>
+ <string name="custom_patch">Wersja nieoficjalna</string>
+ <string name="custom_patch_info">Nie ma oficjalnych aktualizacji zabezpieczeń dla tej wersji Androida. \nWszystkie zawarte łaty zostały przeniesione z nowszych wersji.</string>
</resources>
diff --git a/res/values-ru/cm_strings.xml b/res/values-ru/cm_strings.xml
index e91657f4a2..f09eb2e6fc 100644
--- a/res/values-ru/cm_strings.xml
+++ b/res/values-ru/cm_strings.xml
@@ -353,4 +353,6 @@
<string name="shortcut_carrier_title">Операторы сети</string>
<string name="burnin_protection_title">Защита экрана от выгорания</string>
<string name="burnin_protection_summary">Периодически перемещать элементы, которые постоянно отображаются на экране, чтобы избежать выгорания экрана в этой области</string>
+ <string name="custom_patch">Неофициальная версия</string>
+ <string name="custom_patch_info">Официальные исправления безопасности более не выпускаются для данной версии Android. \nВсе исправления, представленные в этой сборке, адаптированы из более новых версий системы.</string>
</resources>
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index 0dd77d2439..f159910546 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -516,4 +516,9 @@
<!-- Burn in protection -->
<string name="burnin_protection_title">Display burn-in protection</string>
<string name="burnin_protection_summary">Periodically move items that are permanently shown on screen to avoid excessive screen wear in that area</string>
+
+ <!-- "Custom" Security Patch label -->
+ <string name="custom_patch">Custom build release</string>
+ <string name="custom_patch_info">There are no official security patches for this Android version anymore. \nAll patches contained in this build are backports from newer versions.</string>
+
</resources>
diff --git a/res/xml/device_info_settings.xml b/res/xml/device_info_settings.xml
index d59486cc9e..2b8dda4a8a 100644
--- a/res/xml/device_info_settings.xml
+++ b/res/xml/device_info_settings.xml
@@ -137,6 +137,11 @@
android:data="https://source.android.com/security/bulletin/" />
</PreferenceScreen>
+ <!-- Unofficial/custom patch level -->
+ <Preference android:key="custom_patch"
+ android:title="@string/custom_patch"
+ android:summary="@string/device_info_default"/>
+
<!-- Device FCC equipment id -->
<com.android.settings.DividerPreference
android:key="fcc_equipment_id"
diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java
index d8394dd04a..d0177447e9 100644
--- a/src/com/android/settings/DeviceInfoSettings.java
+++ b/src/com/android/settings/DeviceInfoSettings.java
@@ -17,6 +17,7 @@
package com.android.settings;
import android.app.Activity;
+import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
@@ -69,6 +70,7 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
private static final String KEY_BASEBAND_VERSION = "baseband_version";
private static final String KEY_FIRMWARE_VERSION = "firmware_version";
private static final String KEY_SECURITY_PATCH = "security_patch";
+ private static final String KEY_CUSTOM_PATCH = "custom_patch";
private static final String KEY_UPDATE_SETTING = "additional_system_update_settings";
private static final String KEY_EQUIPMENT_ID = "fcc_equipment_id";
private static final String PROPERTY_EQUIPMENT_ID = "ro.ril.fccid";
@@ -125,6 +127,14 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
getPreferenceScreen().removePreference(findPreference(KEY_SECURITY_PATCH));
}
+ final String customPatch = DeviceInfoUtils.getCustomPatch();
+ if (!TextUtils.isEmpty(customPatch)) {
+ setStringSummary(KEY_CUSTOM_PATCH, customPatch);
+ findPreference(KEY_CUSTOM_PATCH).setEnabled(true);
+ } else {
+ getPreferenceScreen().removePreference(findPreference(KEY_CUSTOM_PATCH));
+ }
+
setValueSummary(KEY_BASEBAND_VERSION, "gsm.version.baseband");
setValueSummary(KEY_EQUIPMENT_ID, PROPERTY_EQUIPMENT_ID);
setStringSummary(KEY_DEVICE_MODEL, Build.MODEL);
@@ -331,6 +341,13 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
+ "queryIntentActivities() returns empty" );
return true;
}
+ } else if (preference.getKey().equals(KEY_CUSTOM_PATCH)) {
+ new AlertDialog.Builder(getActivity())
+ .setTitle(R.string.custom_patch)
+ .setIcon(android.R.drawable.ic_dialog_alert)
+ .setMessage(R.string.custom_patch_info)
+ .setNegativeButton(R.string.cancel, null)
+ .create().show();
} else if (preference.getKey().equals(KEY_DEVICE_FEEDBACK)) {
sendFeedback();
} else if(preference.getKey().equals(KEY_SYSTEM_UPDATE_SETTINGS)) {
--
2.20.1