LeOS-GSI/patches/leos/platform_packages_apps_Sett.../0010-advanced_privacy.patch

313 lines
17 KiB
Diff
Raw Normal View History

2024-01-14 12:25:28 +01:00
From 0490342cba1518a65de63cbe89192d1d51ca03e5 Mon Sep 17 00:00:00 2001
2023-12-16 09:20:57 +01:00
From: harvey186 <harvey186@hotmail.com>
2024-01-14 12:25:28 +01:00
Date: Sun, 14 Jan 2024 09:33:57 +0100
2023-12-16 09:20:57 +01:00
Subject: [PATCH] advanced_privacy
2024-01-14 12:25:28 +01:00
Change-Id: I1b3bad5418581bd6fd95b9147a01e1122788a555
---
res/drawable/ic_homepage_advanced_privacy.xml | 41 +++++++++++++++
...een.xml => ic_illustration_fullscreen.xml} | 0
..._switch.xml => ic_illustration_switch.xml} | 0
..._window.xml => ic_illustration_window.xml} | 0
res/drawable/ic_launcher_background.xml | 37 +++++++++----
res/values/cm_strings.xml | 6 ++-
res/values/strings.xml | 3 ++
.../advanced_privacy_dashboard_settings.xml | 28 ++++++++++
res/xml/bubble_notification_settings.xml | 5 +-
res/xml/top_level_settings.xml | 10 +++-
.../AdvancedPrivacyDashboardFragment.java | 52 +++++++++++++++++++
11 files changed, 167 insertions(+), 15 deletions(-)
create mode 100644 res/drawable/ic_homepage_advanced_privacy.xml
rename res/drawable/{accessibility_magnification_mode_fullscreen.xml => ic_illustration_fullscreen.xml} (100%)
rename res/drawable/{accessibility_magnification_mode_switch.xml => ic_illustration_switch.xml} (100%)
rename res/drawable/{accessibility_magnification_mode_window.xml => ic_illustration_window.xml} (100%)
create mode 100644 res/xml/advanced_privacy_dashboard_settings.xml
create mode 100644 src/com/android/settings/privacy/AdvancedPrivacyDashboardFragment.java
2023-12-16 09:20:57 +01:00
diff --git a/res/drawable/ic_homepage_advanced_privacy.xml b/res/drawable/ic_homepage_advanced_privacy.xml
new file mode 100644
index 0000000000..3786ebb858
--- /dev/null
+++ b/res/drawable/ic_homepage_advanced_privacy.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright ECORP SAS 2022
+ ~ 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 <https://www.gnu.org/licenses/>.
+ -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="36dp"
+ android:height="36dp"
+ android:viewportWidth="32"
+ android:viewportHeight="32">
+ <group>
+ <clip-path
+ android:pathData="M0,0h32v32h-32z"/>
+ <path
+ android:pathData="M7,0L25,0A7,7 0,0 1,32 7L32,25A7,7 0,0 1,25 32L7,32A7,7 0,0 1,0 25L0,7A7,7 0,0 1,7 0z"
+ android:fillColor="#2CCF69"/>
+ <path
+ android:pathData="M15.983,6.667V6.667C15.917,6.666 15.85,6.675 15.785,6.693L7.869,10.044C7.815,10.069 7.765,10.111 7.727,10.168C7.689,10.228 7.667,10.301 7.667,10.377L7.667,10.379C7.667,18.181 12.058,23.35 15.862,24.975L15.865,24.977C15.902,24.992 15.94,25 15.978,25C16.016,25 16.054,24.992 16.091,24.977L16.097,24.974L16.097,24.974C19.126,23.687 24.324,19.049 24.333,10.402C24.33,10.323 24.305,10.248 24.263,10.186C24.22,10.122 24.162,10.075 24.099,10.049C24.099,10.049 24.099,10.049 24.099,10.049L16.169,6.691C16.112,6.675 16.053,6.667 15.994,6.667L15.983,6.667ZM16.75,5.127L24.75,8.514C25.114,8.669 25.425,8.927 25.647,9.258C25.869,9.589 25.992,9.979 26,10.379C26,19.777 20.332,24.986 16.749,26.508C16.505,26.613 16.243,26.667 15.978,26.667C15.713,26.667 15.451,26.613 15.207,26.508C10.749,24.603 6,18.803 6,10.379C5.999,9.982 6.114,9.594 6.328,9.262C6.543,8.931 6.849,8.671 7.208,8.514L15.207,5.127C15.463,5.041 15.73,4.998 15.999,5C16.255,5.001 16.508,5.044 16.75,5.127Z"
+ android:fillColor="#ffffff"
+ android:fillType="evenOdd"/>
+ <path
+ android:pathData="M13.672,11.986C13.998,12.312 13.998,12.84 13.672,13.165C13.03,13.808 12.708,14.649 12.708,15.493C12.708,16.336 13.03,17.177 13.672,17.82C14.315,18.463 15.156,18.784 16,18.784C16.844,18.784 17.684,18.463 18.327,17.82C18.97,17.177 19.291,16.336 19.291,15.493C19.291,14.649 18.97,13.808 18.327,13.165C18.002,12.84 18.002,12.312 18.327,11.986C18.653,11.661 19.18,11.661 19.506,11.986C20.474,12.955 20.958,14.225 20.958,15.493C20.958,16.76 20.474,18.03 19.506,18.998C18.538,19.966 17.267,20.451 16,20.451C14.732,20.451 13.462,19.966 12.494,18.998C11.526,18.03 11.042,16.76 11.042,15.493C11.042,14.225 11.526,12.955 12.494,11.986C12.819,11.661 13.347,11.661 13.672,11.986Z"
+ android:fillColor="#ffffff"
+ android:fillType="evenOdd"/>
+ <path
+ android:pathData="M16.085,11C16.545,11 16.918,11.373 16.918,11.833L16.918,15.554C16.918,16.014 16.545,16.387 16.085,16.387C15.624,16.387 15.251,16.014 15.251,15.554L15.251,11.833C15.251,11.373 15.624,11 16.085,11Z"
+ android:fillColor="#ffffff"
+ android:fillType="evenOdd"/>
+ </group>
+</vector>
diff --git a/res/drawable/accessibility_magnification_mode_fullscreen.xml b/res/drawable/ic_illustration_fullscreen.xml
similarity index 100%
rename from res/drawable/accessibility_magnification_mode_fullscreen.xml
rename to res/drawable/ic_illustration_fullscreen.xml
diff --git a/res/drawable/accessibility_magnification_mode_switch.xml b/res/drawable/ic_illustration_switch.xml
similarity index 100%
rename from res/drawable/accessibility_magnification_mode_switch.xml
rename to res/drawable/ic_illustration_switch.xml
diff --git a/res/drawable/accessibility_magnification_mode_window.xml b/res/drawable/ic_illustration_window.xml
similarity index 100%
rename from res/drawable/accessibility_magnification_mode_window.xml
rename to res/drawable/ic_illustration_window.xml
diff --git a/res/drawable/ic_launcher_background.xml b/res/drawable/ic_launcher_background.xml
index 8c651550f9..b91ae32786 100644
--- a/res/drawable/ic_launcher_background.xml
+++ b/res/drawable/ic_launcher_background.xml
@@ -1,18 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- SPDX-FileCopyrightText: 2022 The LineageOS Project
- SPDX-License-Identifier: Apache-2.0
--->
+ ~ Copyright ECORP SAS 2022
+ ~ 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 <https://www.gnu.org/licenses/>.
+ -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
- android:pathData="M0,0h108v108h-108z"
- android:fillColor="#ffffff"/>
- <path
- android:pathData="M58.148,28C59.193,28 60.062,28.805 60.142,29.847L60.254,31.303C60.431,33.606 62.018,35.527 64.017,36.685C66.016,37.844 68.441,38.236 70.525,37.237L71.846,36.604C72.789,36.153 73.92,36.503 74.443,37.408L78.59,44.592C79.113,45.497 78.851,46.652 77.988,47.243L76.782,48.068C74.876,49.374 74,51.689 74,54C74,56.311 74.876,58.626 76.782,59.932L77.988,60.757C78.851,61.348 79.113,62.503 78.59,63.408L74.443,70.592C73.92,71.497 72.789,71.847 71.846,71.396L70.525,70.763C68.441,69.764 66.016,70.156 64.017,71.315C62.018,72.473 60.431,74.394 60.254,76.697L60.142,78.153C60.062,79.195 59.193,80 58.148,80H49.852C48.807,80 47.938,79.195 47.858,78.153L47.746,76.697C47.569,74.394 45.981,72.473 43.983,71.315C41.984,70.156 39.558,69.764 37.475,70.763L36.153,71.396C35.211,71.847 34.08,71.497 33.557,70.592L29.409,63.408C28.887,62.503 29.149,61.348 30.011,60.757L31.218,59.931C33.124,58.626 34,56.311 34,54C34,51.689 33.124,49.374 31.218,48.068L30.011,47.242C29.149,46.652 28.887,45.497 29.409,44.592L33.557,37.408C34.08,36.503 35.211,36.153 36.153,36.604L37.475,37.237C39.558,38.236 41.984,37.844 43.983,36.685C45.982,35.527 47.569,33.606 47.746,31.303L47.858,29.847C47.938,28.805 48.807,28 49.852,28H58.148ZM54,66C60.627,66 66,60.627 66,54C66,47.373 60.627,42 54,42C47.373,42 42,47.373 42,54C42,60.627 47.373,66 54,66Z"
- android:fillColor="#167C80"
- android:fillType="evenOdd"/>
+ android:pathData="M0,0h108v108h-108z">
+ <aapt:attr name="android:fillColor">
+ <gradient
+ android:startX="54"
+ android:startY="7.15"
+ android:endX="54"
+ android:endY="208.35"
+ android:type="linear">
+ <item android:offset="0" android:color="#FFD8DDDF"/>
+ <item android:offset="1" android:color="#FF949DA1"/>
+ </gradient>
+ </aapt:attr>
+ </path>
</vector>
2024-01-14 12:25:28 +01:00
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index 9cda169ed0..4da3fdca8c 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -18,7 +18,7 @@
<!-- Private DNS -->
<string name="private_dns_mode_cloudflare" translatable="false">Cloudflare DNS</string>
<!-- Alternative: 1dot1dot1dot1.cloudflare-dns.com -->
- <string name="private_dns_hostname_cloudflare" translatable="false">one.one.one.one</string>
+ <string name="private_dns_hostname_cloudflare" translatable="false">9.9.9.9</string>
<!-- Advanced keyboard settings -->
<string name="keyboard_extras_title">Extras</string>
@@ -189,4 +189,8 @@
<!-- Location settings screen, setting summary for Assisted GPS switch -->
<string name="assisted_gps_summary">Download satellite assistance data from the internet which can greatly improve the GPS startup performance. For emergency calls, assisted GPS is always allowed.</string>
+
+ <!-- LeOS Advanced Privacy -->
+ <string name="advanced_privacy_dashboard_title" translatable="false">Advanced Privacy</string>
+ <string name="advanced_privacy_dashboard_summary">Manage trackers, fake location, hide IP address</string>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 1951c0a06b..92c7766f9e 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -792,6 +792,9 @@
<!-- TODO(b/208624929): Update to an UX approved summary and char limit. -->
<!-- Main Settings screen setting summary for the item that takes you to the privacy and security settings. [CHAR LIMIT=60] -->
<string name="safety_center_summary">App security, device lock, permissions</string>
+
+ <!-- Summary for e Security settings, explaining a few important settings under it [CHAR LIMIT=NONE] -->
+ <string name="security_dashboard_summary_e">Screen lock, app security</string>
<!-- Face enrollment and settings --><skip />
<!-- Note: Update FaceEnrollParentalConsent.CONSENT_STRING_RESOURCES when any _consent_ strings are added or removed. -->
2023-12-16 09:20:57 +01:00
diff --git a/res/xml/advanced_privacy_dashboard_settings.xml b/res/xml/advanced_privacy_dashboard_settings.xml
new file mode 100644
index 0000000000..8433a4402a
--- /dev/null
+++ b/res/xml/advanced_privacy_dashboard_settings.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2019-2022 ECORP SAS
+
+ 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.
+ -->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:settings="http://schemas.android.com/apk/res-auto"
+ android:key="advanced_privacy"
+ android:title="@string/advanced_privacy_dashboard_title">
+
+ <Preference>
+ <intent android:action="android.intent.action.MAIN"
+ android:targetPackage="foundation.e.advancedprivacy"
+ android:targetClass="foundation.e.privacycentralapp.main.MainActivity" />
+ </Preference>
+</PreferenceScreen>
diff --git a/res/xml/bubble_notification_settings.xml b/res/xml/bubble_notification_settings.xml
index 3e137d7001..82a89a3249 100644
--- a/res/xml/bubble_notification_settings.xml
+++ b/res/xml/bubble_notification_settings.xml
@@ -26,10 +26,7 @@
<com.android.settingslib.widget.IllustrationPreference
android:key="bubbles_illustration"
settings:searchable="false"
- app:lottie_rawRes="@raw/lottie_bubbles"
- app:lottie_cacheComposition="false"
- settings:dynamicColor="true"
- settings:controller="com.android.settings.notification.BubbleNotificationIllustrationPreferenceController"/>
+ app:lottie_rawRes="@raw/lottie_bubbles"/>
<com.android.settingslib.widget.MainSwitchPreference
android:key="global_notification_bubbles"
diff --git a/res/xml/top_level_settings.xml b/res/xml/top_level_settings.xml
2024-01-14 12:25:28 +01:00
index d050a1f274..0c0db84657 100644
2023-12-16 09:20:57 +01:00
--- a/res/xml/top_level_settings.xml
+++ b/res/xml/top_level_settings.xml
2024-01-14 12:25:28 +01:00
@@ -141,7 +141,7 @@
2023-12-16 09:20:57 +01:00
android:key="top_level_security"
android:order="-50"
android:title="@string/security_settings_title"
- android:summary="@string/security_dashboard_summary"
+ android:summary="@string/security_dashboard_summary_e"
settings:highlightableMenuKey="@string/menu_key_security"
settings:controller="com.android.settings.security.TopLevelSecurityEntryPreferenceController"/>
2024-01-14 12:25:28 +01:00
@@ -155,6 +155,14 @@
2023-12-16 09:20:57 +01:00
settings:highlightableMenuKey="@string/menu_key_privacy"
settings:controller="com.android.settings.privacy.TopLevelPrivacyEntryPreferenceController"/>
+ <com.android.settings.widget.HomepagePreference
+ android:key="top_level_advanced_privacy"
+ android:title="@string/advanced_privacy_dashboard_title"
+ android:summary="@string/advanced_privacy_dashboard_summary"
+ android:icon="@drawable/ic_homepage_advanced_privacy"
+ android:order="-35"
+ android:fragment="com.android.settings.privacy.AdvancedPrivacyDashboardFragment"/>
+
<com.android.settings.widget.HomepagePreference
android:fragment="com.android.settings.location.LocationSettings"
android:icon="@drawable/ic_settings_location"
diff --git a/src/com/android/settings/privacy/AdvancedPrivacyDashboardFragment.java b/src/com/android/settings/privacy/AdvancedPrivacyDashboardFragment.java
new file mode 100644
index 0000000000..c0564742c3
--- /dev/null
+++ b/src/com/android/settings/privacy/AdvancedPrivacyDashboardFragment.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2019-2022 ECORP SAS
+ *
+ * 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 com.android.settings.privacy;
+
+import android.app.Activity;
+import android.content.ComponentName;
+import android.content.Intent;
+import android.os.Bundle;
+
+import androidx.fragment.app.Fragment;
+
+import com.android.settings.R;
+import com.android.settings.search.BaseSearchIndexProvider;
+import com.android.settingslib.search.SearchIndexable;
+
+@SearchIndexable
+public class AdvancedPrivacyDashboardFragment extends Fragment {
+
+ private static final String advancedPrivacyPackageName = "foundation.e.advancedprivacy";
+ private static final String advancedPrivacyActivityName = "foundation.e.advancedprivacy.main.MainActivity";
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ Activity activity = getActivity();
+ Intent intent = new Intent().setComponent(new ComponentName(advancedPrivacyPackageName,
+ advancedPrivacyActivityName));
+ startActivity(intent);
+
+ if (activity != null) {
+ activity.finish();
+ }
+ }
+
+ public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+ new BaseSearchIndexProvider(R.xml.advanced_privacy_dashboard_settings);
+}
\ No newline at end of file
2024-01-14 12:25:28 +01:00
--
2.34.1