Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98c33afa authored by Prabal Singh's avatar Prabal Singh Committed by Android (Google) Code Review
Browse files

Merge "Remove Advanced Privacy Settings screen"

parents 44b02abb 9afbd458
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -1902,6 +1902,10 @@
                <action android:name="com.android.settings.MORE_SECURITY_PRIVACY_SETTINGS" />
                <action android:name="com.android.settings.MORE_SECURITY_PRIVACY_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            </intent-filter>
            <intent-filter>
                <action android:name="android.settings.PRIVACY_ADVANCED_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                       android:value="com.android.settings.safetycenter.MoreSecurityPrivacyFragment" />
                       android:value="com.android.settings.safetycenter.MoreSecurityPrivacyFragment" />
            <meta-data android:name="com.android.settings.HIGHLIGHT_MENU_KEY"
            <meta-data android:name="com.android.settings.HIGHLIGHT_MENU_KEY"
@@ -1964,10 +1968,6 @@
                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            </intent-filter>
            <intent-filter>
                <action android:name="android.settings.PRIVACY_ADVANCED_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter android:priority="1">
            <intent-filter android:priority="1">
                <action android:name="android.settings.REQUEST_ENABLE_CONTENT_CAPTURE" />
                <action android:name="android.settings.REQUEST_ENABLE_CONTENT_CAPTURE" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.DEFAULT" />
+0 −104
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2022 The Android Open Source Project

    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="privacy_dashboard_page"
    android:title="@string/privacy_advanced_settings">

    <!-- Work Policy info -->
    <Preference
        android:key="work_policy_info"
        android:title="@string/work_policy_privacy_settings"
        android:summary="@string/work_policy_privacy_settings_summary"
        settings:controller="com.android.settings.privacy.WorkPolicyInfoPreferenceController"/>

    <!-- Connected work and personal apps -->
    <Preference
        android:key="interact_across_profiles_privacy"
        android:title="@string/interact_across_profiles_title"
        android:fragment="com.android.settings.applications.specialaccess.interactacrossprofiles.InteractAcrossProfilesSettings"
        settings:searchable="false"
        settings:controller="com.android.settings.applications.specialaccess.interactacrossprofiles.InteractAcrossProfilesController" />

    <!-- Accessibility usage -->
    <Preference
        android:key="privacy_accessibility_usage"
        android:title="@string/accessibility_usage_title"
        settings:controller="com.android.settings.privacy.AccessibilityUsagePreferenceController">
        <intent android:action="android.intent.action.REVIEW_ACCESSIBILITY_SERVICES"/>
    </Preference>

    <!-- On lock screen notifications -->
    <com.android.settings.RestrictedListPreference
        android:key="privacy_lock_screen_notifications"
        android:title="@string/lock_screen_notifs_title"
        android:summary="@string/summary_placeholder"
        settings:searchable="false"/>

    <!-- Show media on lock screen -->
    <SwitchPreference
        android:key="privacy_media_controls_lockscreen"
        android:title="@string/media_controls_lockscreen_title"
        android:summary="@string/media_controls_lockscreen_description"
        settings:controller=
            "com.android.settings.sound.MediaControlsLockScreenPreferenceController" />

    <!-- Privacy Service -->
    <PreferenceCategory
        android:key="privacy_services"
        android:layout="@layout/preference_category_no_label"/>

    <PreferenceCategory
        android:key="dashboard_tile_placeholder"/>

    <!-- Work profile settings are at the bottom with high order value to avoid users thinking that
         any of the above settings (including dynamic) are specific to the work profile. -->
    <PreferenceCategory
        android:key="privacy_work_profile_notifications_category"
        android:title="@string/profile_section_header_for_advanced_privacy"
        android:order="998">

        <com.android.settings.RestrictedListPreference
            android:key="privacy_lock_screen_work_profile_notifications"
            android:title="@string/locked_work_profile_notification_title"
            android:summary="@string/summary_placeholder"
            android:order="999"
            settings:searchable="false"/>
    </PreferenceCategory>

    <!-- Content Capture -->

    <!-- NOTE: content capture has a different preference, depending whether or not the
         ContentCaptureService implementations defines a custom settings activitiy on its manifest.
         Hence, we show both here, but the controller itself will decide if it's available or not.
    -->

    <SwitchPreference
        android:key="content_capture"
        android:title="@string/content_capture"
        android:summary="@string/content_capture_summary"
        settings:controller="com.android.settings.privacy.EnableContentCapturePreferenceController"/>

    <com.android.settingslib.PrimarySwitchPreference
        android:key="content_capture_custom_settings"
        android:title="@string/content_capture"
        android:summary="@string/content_capture_summary"
        settings:controller="com.android.settings.privacy.EnableContentCaptureWithServiceSettingsPreferenceController"/>

</PreferenceScreen>
 No newline at end of file
+3 −14
Original line number Original line Diff line number Diff line
@@ -34,7 +34,6 @@ import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.search.SearchIndexable;
import com.android.settingslib.search.SearchIndexable;


import java.util.Arrays;
import java.util.List;
import java.util.List;


@SearchIndexable
@SearchIndexable
@@ -77,16 +76,8 @@ public class PrivacyDashboardFragment extends DashboardFragment {


    @Override
    @Override
    protected int getPreferenceScreenResId() {
    protected int getPreferenceScreenResId() {
        return getPreferenceScreenResId(getContext());
    }

    private static int getPreferenceScreenResId(Context context) {
        if (SafetyCenterManagerWrapper.get().isEnabled(context)) {
            return R.xml.privacy_advanced_settings;
        } else {
        return R.xml.privacy_dashboard_settings;
        return R.xml.privacy_dashboard_settings;
    }
    }
    }


    private static List<AbstractPreferenceController> buildPreferenceControllers(
    private static List<AbstractPreferenceController> buildPreferenceControllers(
            Context context, Lifecycle lifecycle) {
            Context context, Lifecycle lifecycle) {
@@ -94,7 +85,7 @@ public class PrivacyDashboardFragment extends DashboardFragment {
    }
    }


    public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
    public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
            new BaseSearchIndexProvider() {
            new BaseSearchIndexProvider(R.xml.privacy_dashboard_settings) {
                /**
                /**
                 * If SafetyCenter is enabled, all of these entries will be in the More Settings
                 * If SafetyCenter is enabled, all of these entries will be in the More Settings
                 * page, and we don't want to index these entries.
                 * page, and we don't want to index these entries.
@@ -105,9 +96,7 @@ public class PrivacyDashboardFragment extends DashboardFragment {
                    if (SafetyCenterManagerWrapper.get().isEnabled(context)) {
                    if (SafetyCenterManagerWrapper.get().isEnabled(context)) {
                        return null;
                        return null;
                    }
                    }
                    final SearchIndexableResource sir = new SearchIndexableResource(context);
                    return super.getXmlResourcesToIndex(context, enabled);
                    sir.xmlResId = getPreferenceScreenResId(context);
                    return Arrays.asList(sir);
                }
                }


                @Override
                @Override