LeOS-GSI/patches/leos/platform_packages_apps_Sett.../0014-advanced-privacy.patch

144 lines
5.8 KiB
Diff

From 6568dbdf116f7b7563a6b5403c7f2242df02790c Mon Sep 17 00:00:00 2001
From: harvey186 <harvey186@hotmail.com>
Date: Mon, 11 Sep 2023 15:36:33 +0200
Subject: [PATCH] advanced privacy
Change-Id: Icb2db233012ed614e843430a60213908ae83fe93
---
.../AdvancedPrivacyDashboardFragment.java | 52 +++++++++++++++++++
res/values/cm_strings.xml | 2 +-
.../advanced_privacy_dashboard_settings.xml | 28 ++++++++++
res/xml/top_level_settings.xml | 8 +++
4 files changed, 89 insertions(+), 1 deletion(-)
create mode 100644 src/com/android/settings/privacy/AdvancedPrivacyDashboardFragment.java
create mode 100644 res/xml/advanced_privacy_dashboard_settings.xml
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/res/values/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
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index a70e709c9b..ca60ed4bfb 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="fFotosalse">one.one.one.one</string>
+ <string name="private_dns_hostname_cloudflare" translatable="false">one.one.one.one</string>
<!-- Advanced keyboard settings -->
<string name="keyboard_extras_title">Extras</string>
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/top_level_settings.xml b/res/xml/top_level_settings.xml
index d050a1f274..918bcbb004 100644
--- a/res/xml/top_level_settings.xml
+++ b/res/xml/top_level_settings.xml
@@ -155,6 +155,14 @@
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"
--
2.34.1