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

Commit 0bf0a9ac authored by Jan Tomljanovic's avatar Jan Tomljanovic Committed by Android (Google) Code Review
Browse files

Merge changes I4c813a35,I9bedb58a

* changes:
  Toggle Security and Privacy entries depending on SafetyCenter status.
  Add SafetyCenter entry to Settings.
parents 3b4bb3a0 9ef7f723
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2021 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.
  -->
<!-- TODO(b/208624929): Update to an UX approved icon. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportHeight="24"
    android:viewportWidth="24"
    android:tint="?android:attr/colorControlNormal">
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M12,15m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M18.5,1C16.01,1 14,3.01 14,5.5V8H6c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V10c0,-1.1 -0.9,-2 -2,-2h-2V5.5C16,4.12 17.12,3 18.5,3C19.88,3 21,4.12 21,5.5V6h2V5.5C23,3.01 20.99,1 18.5,1zM18,10v10H6V10H18z"/>
</vector>
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
    <string name="menu_key_display" translatable="false">top_level_display</string>
    <string name="menu_key_wallpaper" translatable="false">top_level_wallpaper</string>
    <string name="menu_key_accessibility" translatable="false">top_level_accessibility</string>
    <string name="menu_key_safety_center" translatable="false">top_level_safety_center</string>
    <string name="menu_key_security" translatable="false">top_level_security</string>
    <string name="menu_key_privacy" translatable="false">top_level_privacy</string>
    <string name="menu_key_location" translatable="false">top_level_location</string>
+6 −0
Original line number Diff line number Diff line
@@ -722,6 +722,12 @@
    <string name="security_status_title">Security status</string>
    <!-- Summary for Security settings, explaining a few important settings under it [CHAR LIMIT=NONE] -->
    <string name="security_dashboard_summary">Screen lock, Find My Device, app security</string>
    <!-- TODO(b/208624929): Update to an UX approved title and char limit. -->
    <!-- Main Settings screen setting title for the item that takes you to the safety center [CHAR LIMIT=60] -->
    <string name="safety_center_title">Security &amp; privacy</string>
    <!-- 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 safety center [CHAR LIMIT=60] -->
    <string name="safety_center_summary">Permissions, screen lock, app security</string>
    <!-- Face enrollment and settings --><skip />
    <!-- Note: Update FaceEnrollParentalConsent.CONSENT_STRING_RESOURCES when any _consent_ strings are added or removed. -->
+11 −1
Original line number Diff line number Diff line
@@ -116,6 +116,15 @@
        settings:highlightableMenuKey="@string/menu_key_accessibility"
        settings:controller="com.android.settings.accessibility.TopLevelAccessibilityPreferenceController"/>

    <com.android.settings.widget.HomepagePreference
        android:icon="@drawable/ic_settings_safety_center"
        android:key="top_level_safety_center"
        android:order="-55"
        android:title="@string/safety_center_title"
        android:summary="@string/safety_center_summary"
        settings:highlightableMenuKey="@string/menu_key_safety_center"
        settings:controller="com.android.settings.safetycenter.TopLevelSafetyCenterEntryPreferenceController"/>

    <com.android.settings.widget.HomepagePreference
        android:fragment="com.android.settings.security.SecuritySettings"
        android:icon="@drawable/ic_settings_security_white"
@@ -133,7 +142,8 @@
        android:order="-40"
        android:title="@string/privacy_dashboard_title"
        android:summary="@string/privacy_dashboard_summary"
        settings:highlightableMenuKey="@string/menu_key_privacy"/>
        settings:highlightableMenuKey="@string/menu_key_privacy"
        settings:controller="com.android.settings.privacy.TopLevelPrivacyEntryPreferenceController"/>

    <com.android.settings.widget.HomepagePreference
        android:fragment="com.android.settings.location.LocationSettings"
+39 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 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.
 */

package com.android.settings.privacy;

import android.annotation.NonNull;
import android.content.Context;

import com.android.settings.core.BasePreferenceController;
import com.android.settings.safetycenter.SafetyCenterStatus;

/** The preference controller for the top level privacy tile. */
public class TopLevelPrivacyEntryPreferenceController  extends BasePreferenceController {

    public TopLevelPrivacyEntryPreferenceController(@NonNull Context context, @NonNull String key) {
        super(context, key);
    }

    @Override
    public int getAvailabilityStatus() {
        if (!SafetyCenterStatus.isEnabled()) {
            return AVAILABLE;
        }
        return CONDITIONALLY_UNAVAILABLE;
    }
}
Loading