From e76034d015026bc132713b4cb6d94a9e6446bece Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Wed, 2 Jun 2021 05:47:08 +0200 Subject: [PATCH 01/12] LineageParts: Change references to /e/ OS in Trust ASB dialog Signed-off-by: Aayush Gupta --- res/values/e_strings.xml | 19 +++++++++++++++++++ .../lineageparts/trust/TrustPreferences.java | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 res/values/e_strings.xml diff --git a/res/values/e_strings.xml b/res/values/e_strings.xml new file mode 100644 index 00000000..a8f7314a --- /dev/null +++ b/res/values/e_strings.xml @@ -0,0 +1,19 @@ + + + + Security patches are released monthly by Google in cooperation with SoC vendors to address flaws which could be exploited by malicious apps to bypass security restrictions and cause permanent damage to your device. Patches made available by Google are applied every month on all supported devices, but patches to proprietary code can only be applied by your device\'s manufacturer. To keep your device safe make sure your /e/ OS build is always up-to-date, and (if applicable) ensure your vendor image is updated to the latest one recommended by /e/ OS. + diff --git a/src/org/lineageos/lineageparts/trust/TrustPreferences.java b/src/org/lineageos/lineageparts/trust/TrustPreferences.java index f966f920..12583117 100644 --- a/src/org/lineageos/lineageparts/trust/TrustPreferences.java +++ b/src/org/lineageos/lineageparts/trust/TrustPreferences.java @@ -60,7 +60,7 @@ public class TrustPreferences extends SettingsPreferenceFragment { mSELinuxPref.setOnPreferenceClickListener(p -> showInfo(R.string.trust_feature_selinux_explain)); mSecurityPatchesPref.setOnPreferenceClickListener(p -> - showInfo(R.string.trust_feature_security_patches_explain)); + showInfo(R.string.e_trust_feature_security_patches_explain)); mEncryptionPref.setOnPreferenceClickListener(p -> showInfo(R.string.trust_feature_encryption_explain)); mSmsLimitPref.setOnPreferenceChangeListener((p, v) -> -- GitLab From d4c00c42e6f3184adcab5d6cc836a951493d9d9c Mon Sep 17 00:00:00 2001 From: TheScarastic Date: Tue, 23 Aug 2022 06:54:58 +0000 Subject: [PATCH 02/12] LineageParts: Add /e/ contributors --- AndroidManifest.xml | 2 +- res/values/e_strings.xml | 5 +++ res/xml/contributors_cloud.xml | 9 ----- res/xml/e_contributors.xml | 33 +++++++++++++++++++ res/xml/parts_catalog.xml | 4 +-- .../contributors/ContributorsSettings.java | 30 +++++++++++++++++ 6 files changed, 71 insertions(+), 12 deletions(-) delete mode 100644 res/xml/contributors_cloud.xml create mode 100644 res/xml/e_contributors.xml create mode 100644 src/org/lineageos/lineageparts/contributors/ContributorsSettings.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 122635e4..d62cfc97 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -272,7 +272,7 @@ diff --git a/res/values/e_strings.xml b/res/values/e_strings.xml index a8f7314a..0d354665 100644 --- a/res/values/e_strings.xml +++ b/res/values/e_strings.xml @@ -16,4 +16,9 @@ --> Security patches are released monthly by Google in cooperation with SoC vendors to address flaws which could be exploited by malicious apps to bypass security restrictions and cause permanent damage to your device. Patches made available by Google are applied every month on all supported devices, but patches to proprietary code can only be applied by your device\'s manufacturer. To keep your device safe make sure your /e/ OS build is always up-to-date, and (if applicable) ensure your vendor image is updated to the latest one recommended by /e/ OS. + + + /e/ contributors + /e/ supporters + LineageOS contributors diff --git a/res/xml/contributors_cloud.xml b/res/xml/contributors_cloud.xml deleted file mode 100644 index 39fc4f55..00000000 --- a/res/xml/contributors_cloud.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/res/xml/e_contributors.xml b/res/xml/e_contributors.xml new file mode 100644 index 00000000..1784f9c9 --- /dev/null +++ b/res/xml/e_contributors.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + diff --git a/res/xml/parts_catalog.xml b/res/xml/parts_catalog.xml index d6b19c03..a2e0f38a 100644 --- a/res/xml/parts_catalog.xml +++ b/res/xml/parts_catalog.xml @@ -35,8 +35,8 @@ + android:fragment="org.lineageos.lineageparts.contributors.ContributorsSettings" + lineage:xmlRes="@xml/e_contributors" /> Date: Tue, 23 Aug 2022 08:57:56 +0000 Subject: [PATCH 03/12] LineageParts: Add microg to system settings --- AndroidManifest.xml | 28 ++++++++++++ res/drawable/ic_settings_microg.xml | 14 ++++++ res/values/e_strings.xml | 3 ++ res/xml/microg_settings.xml | 18 ++++++++ res/xml/parts_catalog.xml | 5 +++ .../lineageparts/microg/MicrogSettings.java | 45 +++++++++++++++++++ 6 files changed, 113 insertions(+) create mode 100644 res/drawable/ic_settings_microg.xml create mode 100644 res/xml/microg_settings.xml create mode 100644 src/org/lineageos/lineageparts/microg/MicrogSettings.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index d62cfc97..aa67ce89 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -244,6 +244,34 @@ android:resource="@string/summary_empty" /> + + + + + + + + + + + + + + + + + diff --git a/res/values/e_strings.xml b/res/values/e_strings.xml index 0d354665..c9fe3943 100644 --- a/res/values/e_strings.xml +++ b/res/values/e_strings.xml @@ -21,4 +21,7 @@ /e/ contributors /e/ supporters LineageOS contributors + + + microG diff --git a/res/xml/microg_settings.xml b/res/xml/microg_settings.xml new file mode 100644 index 00000000..57a51ee5 --- /dev/null +++ b/res/xml/microg_settings.xml @@ -0,0 +1,18 @@ + + + + diff --git a/res/xml/parts_catalog.xml b/res/xml/parts_catalog.xml index a2e0f38a..bb9ad96e 100644 --- a/res/xml/parts_catalog.xml +++ b/res/xml/parts_catalog.xml @@ -95,4 +95,9 @@ android:title="@string/trust_title" android:fragment="org.lineageos.lineageparts.trust.TrustPreferences" lineage:xmlRes="@xml/trust_preferences" /> + + diff --git a/src/org/lineageos/lineageparts/microg/MicrogSettings.java b/src/org/lineageos/lineageparts/microg/MicrogSettings.java new file mode 100644 index 00000000..3862ba55 --- /dev/null +++ b/src/org/lineageos/lineageparts/microg/MicrogSettings.java @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 /e/ foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.lineageos.lineageparts.microg; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Intent; +import android.os.Bundle; + +import org.lineageos.lineageparts.R; +import org.lineageos.lineageparts.SettingsPreferenceFragment; + +public class MicrogSettings extends SettingsPreferenceFragment { + + private static final String MICROG_PACKAGE_NAME = "com.google.android.gms"; + private static final String MICROG_ACTIVITY_NAME = "org.microg.gms.ui.SettingsActivity"; + + @Override + public void onCreate(Bundle savedInstance) { + super.onCreate(savedInstance); + + Intent intent = new Intent(Intent.ACTION_MAIN); + intent.setComponent(new ComponentName(MICROG_PACKAGE_NAME, MICROG_ACTIVITY_NAME)); + startActivity(intent); + + Activity activity = getActivity(); + if (activity != null) { + activity.finish(); + } + } +} -- GitLab From d389f70c50981891bb3fed84262c6a0dccfd69d1 Mon Sep 17 00:00:00 2001 From: Nishith Khanna Date: Mon, 10 Mar 2025 18:21:15 +0530 Subject: [PATCH 04/12] LineageParts: Add openkeychain Co-authored-by: TheScarastic --- AndroidManifest.xml | 22 +++++++++ res/values/e_strings.xml | 3 ++ res/xml/openkeychain_settings.xml | 18 ++++++++ res/xml/parts_catalog.xml | 5 +++ .../openkeychain/OpenKeychainSettings.java | 45 +++++++++++++++++++ 5 files changed, 93 insertions(+) create mode 100644 res/xml/openkeychain_settings.xml create mode 100644 src/org/lineageos/lineageparts/openkeychain/OpenKeychainSettings.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index aa67ce89..7d19ae90 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -272,6 +272,28 @@ android:resource="@string/summary_empty" /> + + + + + + + + + + + + microG + + + OpenKeychain diff --git a/res/xml/openkeychain_settings.xml b/res/xml/openkeychain_settings.xml new file mode 100644 index 00000000..8517cf10 --- /dev/null +++ b/res/xml/openkeychain_settings.xml @@ -0,0 +1,18 @@ + + + + diff --git a/res/xml/parts_catalog.xml b/res/xml/parts_catalog.xml index bb9ad96e..9703b9d2 100644 --- a/res/xml/parts_catalog.xml +++ b/res/xml/parts_catalog.xml @@ -100,4 +100,9 @@ android:title="@string/microg_title" android:fragment="org.lineageos.lineageparts.microg.MicrogSettings" lineage:xmlRes="@xml/microg_settings" /> + + diff --git a/src/org/lineageos/lineageparts/openkeychain/OpenKeychainSettings.java b/src/org/lineageos/lineageparts/openkeychain/OpenKeychainSettings.java new file mode 100644 index 00000000..0990a7a1 --- /dev/null +++ b/src/org/lineageos/lineageparts/openkeychain/OpenKeychainSettings.java @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 /e/ foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.lineageos.lineageparts.openkeychain; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Intent; +import android.os.Bundle; + +import org.lineageos.lineageparts.R; +import org.lineageos.lineageparts.SettingsPreferenceFragment; + +public class OpenKeychainSettings extends SettingsPreferenceFragment { + + private static final String OPENKEYCHAIN_PACKAGE_NAME = "org.sufficientlysecure.keychain"; + private static final String OPENKEYCHAIN_ACTIVITY_NAME = "org.sufficientlysecure.keychain.ui.MainActivity"; + + @Override + public void onCreate(Bundle savedInstance) { + super.onCreate(savedInstance); + + Intent intent = new Intent(Intent.ACTION_MAIN); + intent.setComponent(new ComponentName(OPENKEYCHAIN_PACKAGE_NAME, OPENKEYCHAIN_ACTIVITY_NAME)); + startActivity(intent); + + Activity activity = getActivity(); + if (activity != null) { + activity.finish(); + } + } +} -- GitLab From 54e732aac6ff19d0df714d7fc0987819a644e5cc Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Wed, 2 Jun 2021 05:58:10 +0200 Subject: [PATCH 05/12] LineageParts: Remove LineageOS stats collection support completely Signed-off-by: Aayush Gupta Signed-off-by: althafvly --- AndroidManifest.xml | 22 -- proguard.flags | 1 - res/values/config.xml | 3 - res/values/strings.xml | 22 -- res/xml/anonymous_stats.xml | 23 -- res/xml/parts_catalog.xml | 5 - res/xml/preview_data.xml | 42 ---- res/xml/trust_preferences.xml | 3 - .../lineagestats/AnonymousStats.java | 63 ------ .../lineagestats/PreviewData.java | 39 ---- .../lineagestats/ReportingService.java | 73 ------- .../lineagestats/ReportingServiceManager.java | 96 --------- .../lineagestats/StatsUploadJobService.java | 201 ------------------ .../lineageparts/lineagestats/Utilities.java | 105 --------- 14 files changed, 698 deletions(-) delete mode 100644 res/xml/anonymous_stats.xml delete mode 100644 res/xml/preview_data.xml delete mode 100644 src/org/lineageos/lineageparts/lineagestats/AnonymousStats.java delete mode 100644 src/org/lineageos/lineageparts/lineagestats/PreviewData.java delete mode 100644 src/org/lineageos/lineageparts/lineagestats/ReportingService.java delete mode 100644 src/org/lineageos/lineageparts/lineagestats/ReportingServiceManager.java delete mode 100644 src/org/lineageos/lineageparts/lineagestats/StatsUploadJobService.java delete mode 100644 src/org/lineageos/lineageparts/lineagestats/Utilities.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 7d19ae90..66508f07 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -349,28 +349,6 @@ android:resource="@string/summary_empty" /> - - - - - - - - - - - - diff --git a/proguard.flags b/proguard.flags index cfbdae39..8991f2bb 100644 --- a/proguard.flags +++ b/proguard.flags @@ -11,7 +11,6 @@ -keep class org.lineageos.lineageparts.gestures.* -keep class org.lineageos.lineageparts.hardware.* -keep class org.lineageos.lineageparts.input.* --keep class org.lineageos.lineageparts.lineagestats.* -keep class org.lineageos.lineageparts.livedisplay.* -keep class org.lineageos.lineageparts.notificationlight.* -keep class org.lineageos.lineageparts.power.* diff --git a/res/values/config.xml b/res/values/config.xml index adfcaa48..4c575f2f 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -6,9 +6,6 @@ --> - - https://stats.lineageos.org/api/v1/stats - diff --git a/res/values/strings.xml b/res/values/strings.xml index 8a077210..e01d9f72 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -543,28 +543,6 @@ Total commits: %2$s

Last update: %3$s]]> - - - LineageOS statistics - Help make LineageOS better by opting into anonymous statistics reporting - About - Opting into LineageOS Statistics will allow non-personal data to be submitted to the - developers of LineageOS to track unique installations across devices. The information submitted includes an unique identifier, - which does not compromise your privacy or personal data. The data is submitted during each boot.\n\nFor an example of the data that is submitted, tap on Preview Data. - Enable reporting - Preview data - View stats - Learn more - - - Unique ID - Device - Version - Country - Carrier - Stats collection - Allow installation metrics and device statistics to be collected - Auto-rotate screen Rotation settings diff --git a/res/xml/anonymous_stats.xml b/res/xml/anonymous_stats.xml deleted file mode 100644 index 898bc746..00000000 --- a/res/xml/anonymous_stats.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - diff --git a/res/xml/parts_catalog.xml b/res/xml/parts_catalog.xml index 9703b9d2..52ca689e 100644 --- a/res/xml/parts_catalog.xml +++ b/res/xml/parts_catalog.xml @@ -64,11 +64,6 @@ android:fragment="org.lineageos.lineageparts.statusbar.StatusBarSettings" lineage:xmlRes="@xml/status_bar_settings" /> - - - - - - - - - - - - - - - - - - diff --git a/res/xml/trust_preferences.xml b/res/xml/trust_preferences.xml index 021533b8..5767cf40 100644 --- a/res/xml/trust_preferences.xml +++ b/res/xml/trust_preferences.xml @@ -36,9 +36,6 @@ android:entryValues="@array/trust_restrict_usb_values" android:defaultValue="0" /> - - = QUEUE_MAX_THRESHOLD) { - lastId = 1; - } else { - lastId += 1; - } - setLastJobId(context, lastId); - return lastId; - } -} diff --git a/src/org/lineageos/lineageparts/lineagestats/PreviewData.java b/src/org/lineageos/lineageparts/lineagestats/PreviewData.java deleted file mode 100644 index 32e44137..00000000 --- a/src/org/lineageos/lineageparts/lineagestats/PreviewData.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2012 The CyanogenMod Project - * SPDX-FileCopyrightText: 2017-2023 The LineageOS Project - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.lineageos.lineageparts.lineagestats; - -import android.content.Context; -import android.os.Bundle; - -import androidx.preference.PreferenceScreen; - -import org.lineageos.lineageparts.R; -import org.lineageos.lineageparts.SettingsPreferenceFragment; - -public class PreviewData extends SettingsPreferenceFragment { - private static final String UNIQUE_ID = "preview_id"; - private static final String DEVICE = "preview_device"; - private static final String VERSION = "preview_version"; - private static final String COUNTRY = "preview_country"; - private static final String CARRIER = "preview_carrier"; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - addPreferencesFromResource(R.xml.preview_data); - - final PreferenceScreen prefSet = getPreferenceScreen(); - final Context context = requireActivity(); - - prefSet.findPreference(UNIQUE_ID).setSummary(Utilities.getUniqueID(context)); - prefSet.findPreference(DEVICE).setSummary(Utilities.getDevice()); - prefSet.findPreference(VERSION).setSummary(Utilities.getModVersion()); - prefSet.findPreference(COUNTRY).setSummary(Utilities.getCountryCode(context)); - prefSet.findPreference(CARRIER).setSummary(Utilities.getCarrier(context)); - } -} diff --git a/src/org/lineageos/lineageparts/lineagestats/ReportingService.java b/src/org/lineageos/lineageparts/lineagestats/ReportingService.java deleted file mode 100644 index 7455b500..00000000 --- a/src/org/lineageos/lineageparts/lineagestats/ReportingService.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015 The CyanogenMod Project - * SPDX-FileCopyrightText: 2017-2022 The LineageOS Project - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.lineageos.lineageparts.lineagestats; - -import android.app.IntentService; -import android.app.job.JobInfo; -import android.app.job.JobScheduler; -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.os.PersistableBundle; -import android.util.Log; - -public class ReportingService extends IntentService { - /* package */ static final String TAG = "LineageStats"; - private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); - - public ReportingService() { - super(ReportingService.class.getSimpleName()); - } - - @Override - protected void onHandleIntent(Intent intent) { - JobScheduler js = getSystemService(JobScheduler.class); - - Context context = getApplicationContext(); - - String deviceId = Utilities.getUniqueID(context); - String deviceName = Utilities.getDevice(); - String deviceVersion = Utilities.getModVersion(); - String deviceCountry = Utilities.getCountryCode(context); - String deviceCarrier = Utilities.getCarrier(context); - String deviceCarrierId = Utilities.getCarrierId(context); - - final int lineageOldJobId = AnonymousStats.getLastJobId(context); - final int lineageOrgJobId = AnonymousStats.getNextJobId(context); - - if (DEBUG) Log.d(TAG, "scheduling job id: " + lineageOrgJobId); - - PersistableBundle lineageBundle = new PersistableBundle(); - lineageBundle.putString(StatsUploadJobService.KEY_DEVICE_NAME, deviceName); - lineageBundle.putString(StatsUploadJobService.KEY_UNIQUE_ID, deviceId); - lineageBundle.putString(StatsUploadJobService.KEY_VERSION, deviceVersion); - lineageBundle.putString(StatsUploadJobService.KEY_COUNTRY, deviceCountry); - lineageBundle.putString(StatsUploadJobService.KEY_CARRIER, deviceCarrier); - lineageBundle.putString(StatsUploadJobService.KEY_CARRIER_ID, deviceCarrierId); - lineageBundle.putLong(StatsUploadJobService.KEY_TIMESTAMP, System.currentTimeMillis()); - - // set job types - lineageBundle.putInt(StatsUploadJobService.KEY_JOB_TYPE, - StatsUploadJobService.JOB_TYPE_LINEAGEORG); - - // schedule lineage stats upload - js.schedule(new JobInfo.Builder(lineageOrgJobId, new ComponentName(getPackageName(), - StatsUploadJobService.class.getName())) - .setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY) - .setMinimumLatency(1000) - .setExtras(lineageBundle) - .setPersisted(true) - .build()); - - // cancel old job in case it didn't run yet - js.cancel(lineageOldJobId); - - // reschedule - AnonymousStats.updateLastSynced(this); - ReportingServiceManager.setAlarm(this); - } -} diff --git a/src/org/lineageos/lineageparts/lineagestats/ReportingServiceManager.java b/src/org/lineageos/lineageparts/lineagestats/ReportingServiceManager.java deleted file mode 100644 index 56989537..00000000 --- a/src/org/lineageos/lineageparts/lineagestats/ReportingServiceManager.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2012 The CyanogenMod Project - * SPDX-FileCopyrightText: 2017-2023 The LineageOS Project - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.lineageos.lineageparts.lineagestats; - -import android.app.AlarmManager; -import android.app.PendingIntent; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.SharedPreferences; -import android.os.UserHandle; -import android.util.Log; - -public class ReportingServiceManager extends BroadcastReceiver { - private static final long MILLIS_PER_HOUR = 60L * 60L * 1000L; - private static final long MILLIS_PER_DAY = 24L * MILLIS_PER_HOUR; - private static final long UPDATE_INTERVAL = 1L * MILLIS_PER_DAY; - - private static final String TAG = ReportingServiceManager.class.getSimpleName(); - - public static final String ACTION_LAUNCH_SERVICE = - "org.lineageos.lineageparts.action.TRIGGER_REPORT_METRICS"; - public static final String EXTRA_FORCE = "force"; - - @Override - public void onReceive(Context context, Intent intent) { - if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) { - setAlarm(context); - } else if (intent.getAction().equals(ACTION_LAUNCH_SERVICE)){ - launchService(context, intent.getBooleanExtra(EXTRA_FORCE, false)); - } - } - - public static void setAlarm(Context context) { - SharedPreferences prefs = AnonymousStats.getPreferences(context); - if (prefs.contains(AnonymousStats.ANONYMOUS_OPT_IN)) { - migrate(context, prefs); - } - if (!Utilities.isStatsCollectionEnabled(context)) { - return; - } - long lastSynced = prefs.getLong(AnonymousStats.ANONYMOUS_LAST_CHECKED, 0); - if (lastSynced == 0) { - launchService(context, true); // service will reschedule the next alarm - return; - } - long millisFromNow = (lastSynced + UPDATE_INTERVAL) - System.currentTimeMillis(); - - Intent intent = new Intent(ACTION_LAUNCH_SERVICE); - intent.setClass(context, ReportingServiceManager.class); - - AlarmManager alarmManager = context.getSystemService(AlarmManager.class); - alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + millisFromNow, - PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_IMMUTABLE)); - Log.d(TAG, "Next sync attempt in : " - + (millisFromNow / MILLIS_PER_HOUR) + " hours"); - } - - public static void launchService(Context context, boolean force) { - SharedPreferences prefs = AnonymousStats.getPreferences(context); - - if (!Utilities.isStatsCollectionEnabled(context)) { - return; - } - - if (!force) { - long lastSynced = prefs.getLong(AnonymousStats.ANONYMOUS_LAST_CHECKED, 0); - if (lastSynced == 0) { - setAlarm(context); - return; - } - long timeElapsed = System.currentTimeMillis() - lastSynced; - if (timeElapsed < UPDATE_INTERVAL) { - long timeLeft = UPDATE_INTERVAL - timeElapsed; - Log.d(TAG, "Waiting for next sync : " - + timeLeft / MILLIS_PER_HOUR + " hours"); - return; - } - } - - Intent intent = new Intent(); - intent.setClass(context, ReportingService.class); - context.startServiceAsUser(intent, UserHandle.SYSTEM); - } - - private static void migrate(Context context, SharedPreferences prefs) { - Utilities.setStatsCollectionEnabled(context, - prefs.getBoolean(AnonymousStats.ANONYMOUS_OPT_IN, true)); - prefs.edit().remove(AnonymousStats.ANONYMOUS_OPT_IN).commit(); - } - -} diff --git a/src/org/lineageos/lineageparts/lineagestats/StatsUploadJobService.java b/src/org/lineageos/lineageparts/lineagestats/StatsUploadJobService.java deleted file mode 100644 index b7a9f187..00000000 --- a/src/org/lineageos/lineageparts/lineagestats/StatsUploadJobService.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015 The CyanogenMod Project - * SPDX-FileCopyrightText: 2017-2023 The LineageOS project - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.lineageos.lineageparts.lineagestats; - -import android.app.job.JobParameters; -import android.app.job.JobService; -import android.net.Uri; -import android.os.Handler; -import android.os.Looper; -import android.os.PersistableBundle; -import android.util.ArrayMap; -import android.util.Log; - -import org.json.JSONException; -import org.json.JSONObject; -import org.lineageos.lineageparts.R; - -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.util.Collections; -import java.util.Map; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -public class StatsUploadJobService extends JobService { - - private static final String TAG = StatsUploadJobService.class.getSimpleName(); - private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); - - public static final String KEY_JOB_TYPE = "job_type"; - public static final int JOB_TYPE_LINEAGEORG = 1; - - public static final String KEY_UNIQUE_ID = "uniqueId"; - public static final String KEY_DEVICE_NAME = "deviceName"; - public static final String KEY_VERSION = "version"; - public static final String KEY_COUNTRY = "country"; - public static final String KEY_CARRIER = "carrier"; - public static final String KEY_CARRIER_ID = "carrierId"; - public static final String KEY_TIMESTAMP = "timeStamp"; - - private final Map mCurrentJobs - = Collections.synchronizedMap(new ArrayMap<>()); - - @Override - public boolean onStartJob(JobParameters jobParameters) { - if (DEBUG) - Log.d(TAG, "onStartJob() called with " + "jobParameters = [" + jobParameters + "]"); - - if (!Utilities.isStatsCollectionEnabled(this)) { - return false; - } - - final StatsUploadTask uploadTask = new StatsUploadTask(jobParameters); - mCurrentJobs.put(jobParameters, uploadTask); - uploadTask.execute(); - return true; - } - - @Override - public boolean onStopJob(JobParameters jobParameters) { - if (DEBUG) - Log.d(TAG, "onStopJob() called with " + "jobParameters = [" + jobParameters + "]"); - - final StatsUploadTask cancelledJob; - cancelledJob = mCurrentJobs.remove(jobParameters); - - if (cancelledJob != null) { - // cancel the ongoing background task - cancelledJob.cancel(); - return true; // reschedule - } - - return false; - } - - private class StatsUploadTask { - - private final JobParameters mJobParams; - private boolean mCancelled; - - public StatsUploadTask(JobParameters jobParams) { - this.mJobParams = jobParams; - } - - public void execute() { - ExecutorService executor = Executors.newSingleThreadExecutor(); - Handler handler = new Handler(Looper.getMainLooper()); - executor.execute(() -> { - PersistableBundle extras = mJobParams.getExtras(); - - String deviceId = extras.getString(KEY_UNIQUE_ID); - String deviceName = extras.getString(KEY_DEVICE_NAME); - String deviceVersion = extras.getString(KEY_VERSION); - String deviceCountry = extras.getString(KEY_COUNTRY); - String deviceCarrier = extras.getString(KEY_CARRIER); - String deviceCarrierId = extras.getString(KEY_CARRIER_ID); - - boolean success = false; - int jobType = extras.getInt(KEY_JOB_TYPE, -1); - if (!mCancelled) { - switch (jobType) { - case JOB_TYPE_LINEAGEORG: - try { - JSONObject json = buildStatsRequest(deviceId, deviceName, - deviceVersion, deviceCountry, deviceCarrier, - deviceCarrierId); - success = uploadToLineage(json); - } catch (IOException | JSONException e) { - Log.e(TAG, "Could not upload stats checkin to community server", e); - } - break; - } - } - if (DEBUG) - Log.d(TAG, "job id " + mJobParams.getJobId() + ", has finished with success=" - + success); - - if (!mCancelled) { - final boolean finalResult = success; - handler.post(() -> { - mCurrentJobs.remove(mJobParams); - jobFinished(mJobParams, !finalResult); - }); - } - }); - } - - public void cancel() { - mCancelled = true; - } - } - - private JSONObject buildStatsRequest(String deviceId, String deviceName, String deviceVersion, - String deviceCountry, String deviceCarrier, - String deviceCarrierId) throws JSONException { - JSONObject request = new JSONObject(); - request.put("device_hash", deviceId); - request.put("device_name", deviceName); - request.put("device_version", deviceVersion); - request.put("device_country", deviceCountry); - request.put("device_carrier", deviceCarrier); - request.put("device_carrier_id", deviceCarrierId); - return request; - } - - private boolean uploadToLineage(JSONObject json) throws IOException { - final Uri uri = Uri.parse(getString(R.string.stats_lineage_url)); - URL url = new URL(uri.toString()); - HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); - try { - urlConnection.setInstanceFollowRedirects(true); - urlConnection.setDoOutput(true); - urlConnection.setDoInput(true); - urlConnection.setRequestProperty("Content-Type", "application/json; charset=UTF-8"); - - OutputStream os = urlConnection.getOutputStream(); - os.write(json.toString().getBytes(StandardCharsets.UTF_8)); - os.close(); - - final int responseCode = urlConnection.getResponseCode(); - if (DEBUG) Log.d(TAG, "lineage server response code=" + responseCode); - final boolean success = responseCode == HttpURLConnection.HTTP_OK; - if (!success) { - Log.w(TAG, "failed sending, server returned: " + getResponse(urlConnection)); - } - return success; - } finally { - urlConnection.disconnect(); - } - - } - - private String getResponse(HttpURLConnection httpUrlConnection) - throws IOException { - InputStream responseStream = new BufferedInputStream(httpUrlConnection.getErrorStream()); - - BufferedReader responseStreamReader = new BufferedReader( - new InputStreamReader(responseStream)); - String line = ""; - StringBuilder stringBuilder = new StringBuilder(); - while ((line = responseStreamReader.readLine()) != null) { - stringBuilder.append(line).append("\n"); - } - responseStreamReader.close(); - responseStream.close(); - - return stringBuilder.toString(); - } - -} diff --git a/src/org/lineageos/lineageparts/lineagestats/Utilities.java b/src/org/lineageos/lineageparts/lineagestats/Utilities.java deleted file mode 100644 index ce155c69..00000000 --- a/src/org/lineageos/lineageparts/lineagestats/Utilities.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2012 The CyanogenMod Project - * SPDX-FileCopyrightText: 2021-2022 The LineageOS Project - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.lineageos.lineageparts.lineagestats; - -import android.content.Context; -import android.os.Build; -import android.os.SystemProperties; -import android.provider.Settings; -import android.telephony.TelephonyManager; -import android.text.TextUtils; - -import lineageos.providers.LineageSettings; - -import java.math.BigInteger; -import java.security.MessageDigest; -import java.util.Locale; - -public class Utilities { - public static String getUniqueID(Context context) { - final String id = Settings.Secure.getString(context.getContentResolver(), - Settings.Secure.ANDROID_ID); - return digest(context.getPackageName() + id); - } - - public static String getCarrier(Context context) { - TelephonyManager tm = context.getSystemService(TelephonyManager.class); - String carrier = tm.getNetworkOperatorName(); - if (TextUtils.isEmpty(carrier)) { - String simOperator = tm.getSimOperatorName(); - if (!TextUtils.isEmpty(simOperator)) { - carrier = simOperator; - } else { - carrier = "Unknown"; - } - } - return carrier; - } - - public static String getCarrierId(Context context) { - TelephonyManager tm = context.getSystemService(TelephonyManager.class); - String carrierId = tm.getNetworkOperator(); - if (TextUtils.isEmpty(carrierId)) { - carrierId = "0"; - } - return carrierId; - } - - public static String getCountryCode(Context context) { - TelephonyManager tm = context.getSystemService(TelephonyManager.class); - String countryCode = tm.getNetworkCountryIso().toUpperCase(); - if (TextUtils.isEmpty(countryCode) || isCdmaPhone(tm)) { - String localeCountryCode = Locale.getDefault().getCountry(); - if (localeCountryCode.length() == 2) { - countryCode = localeCountryCode; - } else { - countryCode = "Unknown"; - } - } - return countryCode; - } - - public static String getDevice() { - return SystemProperties.get("ro.lineage.device", Build.PRODUCT); - } - - public static String getModVersion() { - return SystemProperties.get("ro.lineage.version", Build.DISPLAY); - } - - public static String digest(String input) { - try { - MessageDigest md = MessageDigest.getInstance("SHA-256"); - return new BigInteger(1, md.digest(input.getBytes())).toString(16).toUpperCase(); - } catch (Exception e) { - return null; - } - } - - /** - * Check to see if global stats are enabled. - * @return Whether or not stats collection is enabled. - */ - public static boolean isStatsCollectionEnabled(Context context) { - return LineageSettings.Secure.getInt(context.getContentResolver(), - LineageSettings.Secure.STATS_COLLECTION, 1) != 0; - } - - /** - * Enabled or disable stats collection - * @param enabled Boolean that sets collection being enabled. - */ - public static void setStatsCollectionEnabled(Context context, boolean enabled) { - int enable = (enabled) ? 1 : 0; - LineageSettings.Secure.putInt(context.getContentResolver(), - LineageSettings.Secure.STATS_COLLECTION, enable); - } - - private static boolean isCdmaPhone(TelephonyManager tm) { - return tm != null && tm.getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA; - } -} -- GitLab From a22ede6f7b5b8b22c73ae1ce877d3bc4c8f4dc6a Mon Sep 17 00:00:00 2001 From: Yash Garg Date: Mon, 24 Oct 2022 07:11:23 +0000 Subject: [PATCH 06/12] Remove split screen option from recents long press actions - Set app switch action to nothing if it's set to split screen --- res/values/arrays.xml | 2 -- src/org/lineageos/lineageparts/BootReceiver.java | 1 + .../lineageos/lineageparts/input/ButtonSettings.java | 12 ++++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/res/values/arrays.xml b/res/values/arrays.xml index ad917759..4fb77513 100644 --- a/res/values/arrays.xml +++ b/res/values/arrays.xml @@ -81,7 +81,6 @@ @string/hardware_keys_action_launch_camera @string/hardware_keys_action_sleep @string/hardware_keys_action_last_app - @string/hardware_keys_action_split_screen @string/hardware_keys_action_kill_app @string/hardware_keys_action_play_pause_music @@ -96,7 +95,6 @@ 6 7 8 - 9 10 11 diff --git a/src/org/lineageos/lineageparts/BootReceiver.java b/src/org/lineageos/lineageparts/BootReceiver.java index b915ada1..50fc0848 100644 --- a/src/org/lineageos/lineageparts/BootReceiver.java +++ b/src/org/lineageos/lineageparts/BootReceiver.java @@ -45,6 +45,7 @@ public class BootReceiver extends BroadcastReceiver { } ButtonSettings.restoreKeyDisabler(ctx); + ButtonSettings.setLongPressActionToNothing(ctx); ButtonSettings.restoreKeySwapper(ctx); TouchscreenGestureSettings.restoreTouchscreenGestureStates(ctx); } diff --git a/src/org/lineageos/lineageparts/input/ButtonSettings.java b/src/org/lineageos/lineageparts/input/ButtonSettings.java index d791b59a..810c17b8 100644 --- a/src/org/lineageos/lineageparts/input/ButtonSettings.java +++ b/src/org/lineageos/lineageparts/input/ButtonSettings.java @@ -786,6 +786,18 @@ public class ButtonSettings extends SettingsPreferenceFragment preferences.getBoolean(KEY_SWAP_CAPACITIVE_KEYS, false)); } + public static void setLongPressActionToNothing(Context context) { + final int action = LineageSettings.System.getIntForUser(context.getContentResolver(), + LineageSettings.System.KEY_APP_SWITCH_LONG_PRESS_ACTION, context.getResources().getInteger( + org.lineageos.platform.internal.R.integer.config_longPressOnAppSwitchBehavior), + UserHandle.USER_CURRENT); + + if (action == Action.SPLIT_SCREEN.ordinal()) { + LineageSettings.System.putInt(context.getContentResolver(), + LineageSettings.System.KEY_APP_SWITCH_LONG_PRESS_ACTION, Action.NOTHING.ordinal()); + } + } + @Override public boolean onPreferenceTreeClick(Preference preference) { if (preference == mSwapVolumeButtons) { -- GitLab From 198bceb12c4dad1fd5a282bda7e23b454cf76584 Mon Sep 17 00:00:00 2001 From: Mohammed Althaf Thayyil Date: Fri, 30 Jun 2023 05:41:36 +0000 Subject: [PATCH 07/12] LineageParts: Set sentry user id on boot --- .../lineageos/lineageparts/BootReceiver.java | 4 ++ .../lineageos/lineageparts/utils/EUtils.java | 40 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 src/org/lineageos/lineageparts/utils/EUtils.java diff --git a/src/org/lineageos/lineageparts/BootReceiver.java b/src/org/lineageos/lineageparts/BootReceiver.java index 50fc0848..6bad17e3 100644 --- a/src/org/lineageos/lineageparts/BootReceiver.java +++ b/src/org/lineageos/lineageparts/BootReceiver.java @@ -19,6 +19,7 @@ import org.lineageos.lineageparts.contributors.ContributorsCloudFragment; import org.lineageos.lineageparts.gestures.TouchscreenGestureSettings; import org.lineageos.lineageparts.input.ButtonSettings; import org.lineageos.lineageparts.livedisplay.LiveDisplaySettings; +import org.lineageos.lineageparts.utils.EUtils; public class BootReceiver extends BroadcastReceiver { @@ -38,6 +39,9 @@ public class BootReceiver extends BroadcastReceiver { return; } + // Set sentry id on boot + EUtils.loadSentryID(ctx); + if (!hasRestoredTunable(ctx)) { /* Restore the hardware tunable values */ ButtonSettings.restoreKeyDisabler(ctx); diff --git a/src/org/lineageos/lineageparts/utils/EUtils.java b/src/org/lineageos/lineageparts/utils/EUtils.java new file mode 100644 index 00000000..5eead97f --- /dev/null +++ b/src/org/lineageos/lineageparts/utils/EUtils.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 MURENA SAS + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.lineageos.lineageparts.utils; + +import android.content.Context; +import android.os.UserHandle; +import android.provider.Settings; + +import java.util.UUID; + + +public class EUtils { + + private static final String SENTRY_USERID = "sentry_userid"; + + public static void loadSentryID(Context context) { + String sentryId = Settings.Secure.getStringForUser( + context.getContentResolver(), SENTRY_USERID, + UserHandle.USER_CURRENT); + if (sentryId == null) { + UUID uuid = UUID.randomUUID(); + Settings.Secure.putStringForUser(context.getContentResolver(), + SENTRY_USERID, uuid.toString(), + UserHandle.USER_CURRENT); + } + } +} -- GitLab From cdee67fce8c973c72e78826556d13396162b2a5d Mon Sep 17 00:00:00 2001 From: Mohammed Althaf Thayyil Date: Thu, 28 Mar 2024 05:45:38 +0000 Subject: [PATCH 08/12] LineageParts: Enable long press for torch by-default --- res/xml/button_settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/xml/button_settings.xml b/res/xml/button_settings.xml index 875d7eaa..d36131c0 100644 --- a/res/xml/button_settings.xml +++ b/res/xml/button_settings.xml @@ -103,7 +103,7 @@ android:key="torch_long_press_power_gesture" android:title="@string/torch_long_press_power_gesture_title" android:summary="@string/torch_long_press_power_gesture_desc" - android:defaultValue="false" + android:defaultValue="true" lineage:requiresConfig="@*android:bool/config_supportLongPressPowerWhenNonInteractive" /> Date: Thu, 13 Jun 2024 16:03:01 +0000 Subject: [PATCH 09/12] Parts: Disable advance reboot for parental control --- .../lineageparts/input/PowerMenuActions.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/org/lineageos/lineageparts/input/PowerMenuActions.java b/src/org/lineageos/lineageparts/input/PowerMenuActions.java index c057d56e..a75f3baa 100644 --- a/src/org/lineageos/lineageparts/input/PowerMenuActions.java +++ b/src/org/lineageos/lineageparts/input/PowerMenuActions.java @@ -12,6 +12,7 @@ import android.Manifest; import android.content.Context; import android.content.pm.UserInfo; import android.os.Bundle; +import android.os.SystemProperties; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; @@ -25,6 +26,7 @@ import com.android.internal.util.EmergencyAffordanceManager; import com.android.settingslib.applications.ServiceListing; import lineageos.app.LineageGlobalActions; +import lineageos.providers.LineageSettings; import org.lineageos.internal.util.PowerMenuConstants; import org.lineageos.lineageparts.R; @@ -37,8 +39,10 @@ public class PowerMenuActions extends SettingsPreferenceFragment { final static String TAG = "PowerMenuActions"; private static final String CATEGORY_POWER_MENU_ITEMS = "power_menu_items"; + private static final String CATEGORY_ADVANCED_ITEMS = "advanced"; private PreferenceCategory mPowerMenuItemsCategory; + private PreferenceCategory mAdvancedItemsCategory; private CheckBoxPreference mScreenshotPref; private CheckBoxPreference mAirplanePref; @@ -67,6 +71,13 @@ public class PowerMenuActions extends SettingsPreferenceFragment { mEmergencyAffordanceManager = new EmergencyAffordanceManager(mContext); mPowerMenuItemsCategory = findPreference(CATEGORY_POWER_MENU_ITEMS); + mAdvancedItemsCategory = findPreference(CATEGORY_ADVANCED_ITEMS); + + boolean isMdmActive = SystemProperties.getInt("persist.sys.mdm_active", 0) == 1; + if (isMdmActive && getPreferenceScreen() != null) { + LineageSettings.Secure.putInt(getContentResolver(), LineageSettings.Secure.ADVANCED_REBOOT, 0); + getPreferenceScreen().removePreference(mAdvancedItemsCategory); + } for (String action : PowerMenuConstants.getAllActions()) { if (action.equals(GLOBAL_ACTION_KEY_SCREENSHOT)) { -- GitLab From c094bc4f7a1af30b0ee66099534c3885a7885a76 Mon Sep 17 00:00:00 2001 From: Romain Hunault Date: Mon, 2 Jun 2025 23:20:36 +0200 Subject: [PATCH 10/12] Add license --- LICENSE | 202 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..7a4a3ea2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file -- GitLab From 5ac3b8b7beacb65d5e3704c1042178697588e32d Mon Sep 17 00:00:00 2001 From: Nishith Khanna Date: Wed, 21 May 2025 14:47:22 +0530 Subject: [PATCH 11/12] Port translations from A15 --- res/values-de/e_strings.xml | 21 +++++++++++++++++++++ res/values-fr/e_strings.xml | 20 ++++++++++++++++++++ res/values-is/e_strings.xml | 22 ++++++++++++++++++++++ res/values-ja/e_strings.xml | 7 +++++++ res/values-nl/e_strings.xml | 22 ++++++++++++++++++++++ res/values-ru/e_strings.xml | 22 ++++++++++++++++++++++ res/values-sv/e_strings.xml | 7 +++++++ res/values-uk/e_strings.xml | 7 +++++++ 8 files changed, 128 insertions(+) create mode 100644 res/values-de/e_strings.xml create mode 100644 res/values-fr/e_strings.xml create mode 100644 res/values-is/e_strings.xml create mode 100644 res/values-ja/e_strings.xml create mode 100644 res/values-nl/e_strings.xml create mode 100644 res/values-ru/e_strings.xml create mode 100644 res/values-sv/e_strings.xml create mode 100644 res/values-uk/e_strings.xml diff --git a/res/values-de/e_strings.xml b/res/values-de/e_strings.xml new file mode 100644 index 00000000..0dd6a462 --- /dev/null +++ b/res/values-de/e_strings.xml @@ -0,0 +1,21 @@ + + + LineageOS Mitwirkende + /e/ Unterstützer + /e/ Mitwirkende + Sicherheits-Patches werden monatlich von Google in Zusammenarbeit mit SoC-Anbietern veröffentlicht, um Schwachstellen zu beheben, die von bösartigen Apps ausgenutzt werden könnten, um Sicherheitseinschränkungen zu umgehen und das Gerät dauerhaft zu beschädigen. Die von Google zur Verfügung gestellten Patches werden jeden Monat auf alle unterstützten Geräte aufgespielt, aber Patches für proprietären Code können nur vom Hersteller deines Geräts aufgespielt werden. Um dein Gerät zu schützen, solltest du sicherstellen, dass dein /e/-OS-Build immer auf dem neuesten Stand ist, und (falls zutreffend) dass dein Hersteller-Image auf die neueste von /e/OS empfohlene Version aktualisiert ist. + \ No newline at end of file diff --git a/res/values-fr/e_strings.xml b/res/values-fr/e_strings.xml new file mode 100644 index 00000000..508025f9 --- /dev/null +++ b/res/values-fr/e_strings.xml @@ -0,0 +1,20 @@ + + + + Contributeurs LineageOS + Les correctifs de sécurité sont publiés chaque mois par Google, en coopération avec les fabricants de puces SoC (System On a Chip). Ils permettent de corriger des failles que des applications malveillantes sont susceptibles d\'exploiter pour contourner les restrictions de sécurité et endommager votre appareil de façon définitive. Les correctifs fournis par Google sont appliqués chaque mois à tous les appareils compatibles, mais ceux concernant le code propriétaire ne peuvent l\'être que par le fabricant de votre appareil. Pour garantir la sécurité de votre appareil, veillez à toujours utiliser la dernière version de /e/OS et, le cas échéant, mettez à jour votre fichier vendor.img afin qu\'il corresponde à la dernière version recommandée par /e/OS. + \ No newline at end of file diff --git a/res/values-is/e_strings.xml b/res/values-is/e_strings.xml new file mode 100644 index 00000000..61a6b818 --- /dev/null +++ b/res/values-is/e_strings.xml @@ -0,0 +1,22 @@ + + + + Google gefur út öryggisplástra mánaðarlega í sambandi við SoC-öryggissérfræðinga til að bæta úr göllum, sem óvinveitt forrit gætu nýtt sér til að komast framhjá öryggistakmörkunum og þannig valdið alvarlegum skemmdum á kerfinu þínu. Öryggisplástrar Google eru settir inn í hverjum mánuði á öll studd tæki, en öryggisplástra á séreignakóða getur einungis framleiðandi tækisins sett inn. Til að halda tækinu þinu öruggu ættirðu að sjá til þess að útgáfa þín af /e/ OS sé ávallt af nýjustu gerð og (ef við á) tryggja að kerfisdiskmynd framleiðanda sé uppfærð í þá nýjustu sem /e/ OS mælir með. + Þátttakendur í /e/ + Stuðningsaðilar /e/ + Aðstandendur LineageOS + \ No newline at end of file diff --git a/res/values-ja/e_strings.xml b/res/values-ja/e_strings.xml new file mode 100644 index 00000000..5cc20f35 --- /dev/null +++ b/res/values-ja/e_strings.xml @@ -0,0 +1,7 @@ + + + /e/ 貢献者 + セキュリティーパッチは、システム・オン・チップ(System On a Chip)のベンダーと協力して、Googleにより毎月リリースされます。これは悪意あるアプリが、セキュリティー上の制限を回避し、端末に永続的なダメージを与えようとして使用する可能性がある不具合を修正することを狙いとしています。パッチはGoogleにより、毎月、サポートされている全ての端末に対して提供されますが、プロプライエタリーなコードに関するパッチについては、あなたの端末の製造元しかこれを適用することができません。端末の安全性を維持するためには、あなたの/e/ OSを常に最新のバージョンに保ち、可能であれば、ベンダーイメージを/e/ OSの推奨する最新のバージョンにアップデートしてください。 + /e/ サポーター + LineageOSの貢献者 + \ No newline at end of file diff --git a/res/values-nl/e_strings.xml b/res/values-nl/e_strings.xml new file mode 100644 index 00000000..4b17bf54 --- /dev/null +++ b/res/values-nl/e_strings.xml @@ -0,0 +1,22 @@ + + + + LineageOS medewerkers + /e/ ondersteuners + /e/ medewerkers + Veiligheidsupdates worden maandelijks vrijgegeven door Google in samenwerking met SoC fabrikanten om gebreken te verbeteren die kunnen misbruikt worden door schadelijke apps om veiligheidsrestricties te omzeilen en je toestel permanent te beschadigen. Veiligheidsupdates van Google worden maandelijks toegepast op alle ondersteunde toestellen, maar updates voor propriëtaire code kunnen enkel toegepast worden door de fabrikant van jouw toestel. Om de veiligheid op je toestel te garanderen, hou je /e/ OS altijd up-to-date, en (indien van toepassing) zorg er voor dat de vendor-image is bijgewerkt tot de laatste versie, aangeraden door /e/ OS. + \ No newline at end of file diff --git a/res/values-ru/e_strings.xml b/res/values-ru/e_strings.xml new file mode 100644 index 00000000..4a136374 --- /dev/null +++ b/res/values-ru/e_strings.xml @@ -0,0 +1,22 @@ + + + + участники проекта /e/ + Исправления безопасности ежемесячно выпускаются Google в сотрудничестве с производителями SoC для устранения недостатков, которые могут быть использованы вредоносными приложениями для обхода ограничений безопасности и нанесения постоянного ущерба вашему устройству. Исправления, выпускаемые Google, применяются каждый месяц на всех поддерживаемых устройствах, но исправления для собственного кода могут быть применены только производителем вашего устройства. Для обеспечения безопасности вашего устройства убедитесь, что сборка /e/ OS всегда актуальна, и (если это применимо) убедитесь, что образ производителя обновлен до последней версии, рекомендованной /e/ OS. + Поддерживающие проект /e/ люди + Участники проекта LineageOS + \ No newline at end of file diff --git a/res/values-sv/e_strings.xml b/res/values-sv/e_strings.xml new file mode 100644 index 00000000..4119df02 --- /dev/null +++ b/res/values-sv/e_strings.xml @@ -0,0 +1,7 @@ + + + /e/ bidragsgivare + Säkerhetsprogramfixar släpps månadsvis av Google i samarbete med SoC-leverantörer för att adressera fel som kan utnyttjas av skadliga appar för att gå runt säkerhetsrestriktioner och göra permanent skada på din enhet. Programfixar som gjorts tillgängliga av Google appliceras varje månad på alla enheter som stöds. Programfixar för proprietär kod kan endast appliceras av din enhets tillverkare. Se till att ditt bygge av /e/ OS alltid är uppdaterat för att hålla din enhet säker, och (om möjligt) säkerställ att din leverantörsavbild är uppdaterad till den senaste avbilden som rekommenderas av /e/ OS. + LineageOS bidragsgivare + /e/ anhängare + \ No newline at end of file diff --git a/res/values-uk/e_strings.xml b/res/values-uk/e_strings.xml new file mode 100644 index 00000000..6d69fce8 --- /dev/null +++ b/res/values-uk/e_strings.xml @@ -0,0 +1,7 @@ + + + Розробники /e/ + Google щомісяця випускає патчі безпеки у співпраці з виробниками SoC, щоб усунути недоліки, які можуть бути використані зловмисними застосунками для обходу обмежень безпеки та завдати незворотної шкоди вашому пристрою. Випущені Google виправлення встановлюються щомісяця на всіх підтримуваних пристроях, але виправлення для пропрієтарного коду можуть бути встановлені лише виробником вашого пристрою. Щоб захистити свій пристрій, переконайтеся, що ваша збірка /e/ OS завжди актуальна, і (якщо це можливо) переконайтеся, що ваш образ вендора оновлений до останньої версії, яка відповідає рекомендаціям /e/ OS. + Розробники LineageOS + Підтримують /e/ OS + \ No newline at end of file -- GitLab From d030b07ca62a6833c553f425b41e1ad41e11fff2 Mon Sep 17 00:00:00 2001 From: Nishith Khanna Date: Wed, 24 Jul 2024 14:22:31 +0530 Subject: [PATCH 12/12] Theme app according to our palette --- res/layout-v34/settingslib_main_switch_bar.xml | 5 ++--- res/layout/long_screen_list_item.xml | 3 +-- res/layout/preference_widget_switch_compat.xml | 5 ++--- res/values/styles.xml | 4 ++-- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/res/layout-v34/settingslib_main_switch_bar.xml b/res/layout-v34/settingslib_main_switch_bar.xml index aa4cb43c..3c2444e8 100644 --- a/res/layout-v34/settingslib_main_switch_bar.xml +++ b/res/layout-v34/settingslib_main_switch_bar.xml @@ -37,15 +37,14 @@ android:lineBreakWordStyle="phrase" style="@style/MainSwitchText.Settingslib" /> - + android:focusable="false" /> diff --git a/res/layout/long_screen_list_item.xml b/res/layout/long_screen_list_item.xml index 9afe9bcf..359a5990 100644 --- a/res/layout/long_screen_list_item.xml +++ b/res/layout/long_screen_list_item.xml @@ -45,6 +45,5 @@ android:id="@+id/state" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@null" - android:theme="@style/Theme.Material3.DynamicColors.DayNight" /> + android:background="@null" /> diff --git a/res/layout/preference_widget_switch_compat.xml b/res/layout/preference_widget_switch_compat.xml index 5ab45c0e..3c0de3de 100644 --- a/res/layout/preference_widget_switch_compat.xml +++ b/res/layout/preference_widget_switch_compat.xml @@ -3,12 +3,11 @@ SPDX-FileCopyrightText: 2023 The Android Open Source Project SPDX-License-Identifier: Apache-2.0 --> - + android:focusable="false" /> diff --git a/res/values/styles.xml b/res/values/styles.xml index be39ae50..0348b184 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -31,7 +31,7 @@ @@ -43,7 +43,7 @@
-- GitLab