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

Commit f4726dc6 authored by Junchen Quan's avatar Junchen Quan Committed by Android (Google) Code Review
Browse files

Merge "[Device Supervision] PIN management dashboard with all the PIN management options" into main

parents 170cdf0a 107ef205
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -14382,13 +14382,19 @@ Data usage charges may apply.</string>
    <string name="supervision_change_pin_preference_title">Change PIN</string>
    <!-- Title for supervision forgot PIN setting entry [CHAR LIMIT=60] -->
    <string name="supervision_add_forgot_pin_preference_title">Forgot PIN</string>
    <!-- Title for supervision update PIN recovery email setting entry [CHAR LIMIT=60] -->
    <string name="supervision_update_recovery_email_preference_title">Update recovery email</string>
    <!-- Title for supervision delete pin setting entry [CHAR LIMIT=60] -->
    <string name="supervision_delete_pin_preference_title">Delete PIN</string>
    <!-- Summary for supervision delete pin setting entry [CHAR LIMIT=NONE] -->
    <string name="supervision_delete_pin_preference_summary">This will reset all your supervision settings</string>
    <!-- Title for web content filters entry [CHAR LIMIT=60] -->
    <string name="supervision_web_content_filters_title">Web content filters</string>
    <!-- Title for web content filters browser category [CHAR LIMIT=60] -->
    <string name="supervision_web_content_filters_browser_title">Google Chrome and Web</string>
    <!-- Title for web content filters browser category block explicit sites option [CHAR LIMIT=60] -->
    <string name="supervision_web_content_filters_browser_block_explicit_sites_title">Try to block explicit sites</string>
    <!-- Summary for web content filters browser category block explicit sites option [CHAR LIMIT=None] -->
    <!-- Summary for web content filters browser category block explicit sites option [CHAR LIMIT=NONE] -->
    <string name="supervision_web_content_filters_browser_block_explicit_sites_summary">No filter is perfect, but this should help hide sexually explicit sites</string>
    <!-- Title for web content filters browser category allow all sites option [CHAR LIMIT=60] -->
    <string name="supervision_web_content_filters_browser_allow_all_sites_title">Allow all sites</string>
@@ -14396,11 +14402,11 @@ Data usage charges may apply.</string>
    <string name="supervision_web_content_filters_search_title">Google Search</string>
    <!-- Title for web content filters search category filter on option [CHAR LIMIT=60] -->
    <string name="supervision_web_content_filters_search_filter_on_title">SafeSearch filtering ON</string>
    <!-- Summary for web content filters search category filter on option [CHAR LIMIT=None] -->
    <!-- Summary for web content filters search category filter on option [CHAR LIMIT=NONE] -->
    <string name="supervision_web_content_filters_search_filter_on_summary">Helps filter out explicit images, text, and links from search results on this device</string>
    <!-- Title for web content filters search category filter off option [CHAR LIMIT=60] -->
    <string name="supervision_web_content_filters_search_filter_off_title">SafeSearch filtering OFF</string>
    <!-- Summary for web content filters search category filter off option [CHAR LIMIT=None] -->
    <!-- Summary for web content filters search category filter off option [CHAR LIMIT=NONE] -->
    <string name="supervision_web_content_filters_search_filter_off_summary">Account settings may still filter or blur explicit results</string>
    <!-- Generic content description that is attached to the preview illustration at the top of an Accessibility feature toggle page. [CHAR LIMIT=NONE] -->
    <!-- Title for supervision PIN verification screen [CHAR LIMIT=60] -->
+40 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 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.supervision

import com.android.settings.R
import com.android.settingslib.metadata.PreferenceMetadata

/**
 * Setting on PIN Management screen (Settings > Supervision > Manage Pin) that invokes the flow to
 * delete the device PIN.
 */
class SupervisionDeletePinPreference : PreferenceMetadata {
    override val key: String
        get() = KEY

    override val title: Int
        get() = R.string.supervision_delete_pin_preference_title

    override val summary: Int
        get() = R.string.supervision_delete_pin_preference_summary

    // TODO(b/406082832): Implements the delete PIN flow in settings.

    companion object {
        const val KEY = "supervision_delete_pin"
    }
}
+8 −3
Original line number Diff line number Diff line
@@ -46,12 +46,17 @@ class SupervisionPinManagementScreen : PreferenceScreenCreator, PreferenceAvaila

    override fun getPreferenceHierarchy(context: Context) =
        preferenceHierarchy(context, this) {
            +TitlelessPreferenceGroup(GROUP_KEY) += {
                +SupervisionPinRecoveryPreference()
                // TODO(b/391992481) implement the screen.
                +SupervisionChangePinPreference()
                +SupervisionUpdateRecoveryEmailPreference()
            }
            +SupervisionDeletePinPreference()
        }

    companion object {
        const val KEY = "supervision_pin_management"
        internal const val GROUP_KEY = "pin_management_group"
    }
}
+5 −5
Original line number Diff line number Diff line
@@ -17,15 +17,15 @@ package com.android.settings.supervision

import android.app.supervision.flags.Flags
import android.content.Context
import com.android.settings.R
import androidx.preference.Preference
import com.android.settings.R
import com.android.settingslib.metadata.PreferenceAvailabilityProvider
import com.android.settingslib.metadata.PreferenceMetadata

class SupervisionPinRecoveryPreference : PreferenceMetadata,
    PreferenceAvailabilityProvider, Preference.OnPreferenceClickListener {
class SupervisionPinRecoveryPreference :
    PreferenceMetadata, PreferenceAvailabilityProvider, Preference.OnPreferenceClickListener {
    override val key: String
        get() = SupervisionPinRecoveryPreference.KEY
        get() = KEY

    override val title: Int
        get() = R.string.supervision_add_forgot_pin_preference_title
+37 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 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.supervision

import com.android.settings.R
import com.android.settingslib.metadata.PreferenceMetadata

/**
 * Setting on PIN Management screen (Settings > Supervision > Manage Pin) that invokes the flow to
 * update the PIN recovery email.
 */
class SupervisionUpdateRecoveryEmailPreference : PreferenceMetadata {
    override val key: String
        get() = KEY

    override val title: Int
        get() = R.string.supervision_update_recovery_email_preference_title

    // TODO(b/402987522): Add update recovery email flow in settings.

    companion object {
        const val KEY = "supervision_update_recovery_email"
    }
}
Loading