启用或停用安全中心
如需启用或停用安全中心,请使用 frameworks/base/core/res/res/values/config.xml
文件中的可叠加 config_enableSafetyCenter
布尔值字段。
大多数设备都默认支持安全中心,例如手机和平板电脑。在某些外形规格上,安全中心默认处于停用状态,例如在汽车、电视和 Wear 上。
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- ... -->
<!-- Determines whether SafetyCenter feature is enabled. -->
<bool name="config_enableSafetyCenter">true</bool>
<!-- ... -->
</resources>
若要支持安全中心,请将 config_enableSafetyCenter
设置为 true
。如果您不想支持安全中心,请将此值设为 false
以将其停用。
安全中心被停用后,任何尝试重定向至“安全和隐私”页面的操作都会打开“设置”应用。任何与 API 交互的尝试都将被忽略或返回默认值。关联的“快捷设置”功能块和“设置”条目也会根据是否启用安全中心而显示或隐藏。
DeviceConfig 标志
除了使用 config_enableSafetyCenter
配置启用安全中心外,还可以使用 DeviceConfig
标志 (safety_center_is_enabled
) 远程启用或停用安全中心。
在 Android 14 及更高版本中,您无需采取进一步操作,因为此标记默认为 true
。
在 Android 13 中,安全中心默认停用,并且使用此标记列入许可名单。提交您的设备指纹并联系您的 TAM 即可将您的设备添加到许可名单。请注意,Mainline 版本 M-2022-11
或更高版本需要添加到许可名单中。对于本地开发和测试,可通过 adb
命令在本地启用或停用该标志(直到重新启动)。例如,如需启用此标志,请使用以下命令:
adb root
adb shell device_config set_sync_disabled_for_tests until_reboot
adb shell device_config put privacy safety_center_is_enabled true
为确认安全中心是否已启用,请按以下步骤操作:
adb root
adb shell cmd safety_center enabled
输出将返回设备上是否已正确启用安全中心的信息。
更新配置文件
使用 safety_center_config.xml
配置文件修改安全中心屏幕的内容。如果您符合自定义要求,则可以叠加此文件。
叠加配置文件
如需叠加 safety_center_config.xml
文件,请参阅在运行时更改应用资源的值,了解如何修改运行时资源叠加层 (RRO)。
在 Android 14 中,请务必叠加 res/raw-v34/safety_center_config.xml
文件,而不是 res/raw/safety_center_config.xml
,因为前者优先(这也适用于范围限定为 v34
的其他文件,例如 res/values-v34/strings.xml
)。叠加层软件包的最低 SDK 必须低于 34
,否则 v34
限定符可能会在优化过程中被剥离。此外,请务必使用静态叠加层,因为此值在启动时加载。
对于 Android 开源项目 (AOSP) 设备,请以 com.android.safetycenter.resources
软件包为目标。没有可供定位的叠加层配置。所有资源都可以叠加,对内容没有任何限制。
对于配置为接收 Mainline 更新的 GMS 设备,请以软件包 com.google.android.safetycenter.resources
为目标。目标配置为 SafetyCenterConfig
。此配置要求叠加层软件包位于 product
、system
或 vendor
分区中。GMS OEM 应复制 Google 提供的 safety_center_config.xml
文件,并将修改限制为 GTS 测试所允许的范围。 叠加层定义应大致如下:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your.overlay.package"
android:versionCode="1"
android:versionName="1.0">
<application android:hasCode="false" />
<overlay
android:targetPackage="com.google.android.safetycenter.resources"
android:targetName="SafetyCenterConfig"
android:isStatic="true"
android:priority="0"/>
</manifest>
对于未配置为接收 Mainline 更新的 GMS 设备,请以软件包 com.android.safetycenter.resources
为目标。没有可供定位的叠加层配置。叠加层软件包必须使用 com.google.android.safetycenter.resources
这一软件包名称。
GMS OEM 应复制 Google 提供的 safety_center_config.xml
文件,并将修改限制为 GTS 测试所允许的范围。GMS OEM 还必须定义 XML 配置中使用的字符串。
文件结构
概括来讲,safety_center_config.xml
文件是安全性信息来源列表。这些安全性信息来源会分组整理来管理安全中心屏幕上的信号,例如应用安全或屏幕锁定。此列表的顺序定义了显示顺序:
<safety-center-config> <!-- Wrapper for the Safety Center configuration -->
<safety-sources-config>< !-- Wrapper for the safety sources groups -->
<safety-sources-group> <!-- Contains information about a safety sources group -->
<dynamic-safety-source /> <!-- Contains information about a safety source -->
<!-- More safety sources in the group -->
</safety-sources-group> <!-- More safety sources groups -->
</safety-sources-config>
</safety-center-config>
Google 配置文件
AOSP 配置文件位于 packages/modules/Permission/SafetyCenter/Resources/res/raw/safety_center_config.xml
中。
在 Android 13 中,Google 配置文件为:
<safety-center-config>
<safety-sources-config>
<safety-sources-group
id="GoogleAppSecuritySources"
title="@com.google.android.safetycenter.resources:string/google_app_security_sources_title"
summary="@com.google.android.safetycenter.resources:string/google_app_security_sources_summary">
<dynamic-safety-source
id="GooglePlayProtect"
packageName="com.android.vending"
profile="all_profiles"
intentAction="com.google.android.finsky.PLAY_PROTECT"
title="@com.google.android.safetycenter.resources:string/google_play_protect_title"
titleForWork="@com.google.android.safetycenter.resources:string/google_play_protect_title_for_work"
summary="@com.google.android.safetycenter.resources:string/google_play_protect_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_play_protect_search_terms"
refreshOnPageOpenAllowed="true"/>
<dynamic-safety-source
id="GoogleAppProtectionService"
packageName="com.google.android.odad"
profile="primary_profile_only"
initialDisplayState="hidden"
loggingAllowed="false"/>
</safety-sources-group>
<safety-sources-group
id="AndroidLockScreenSources"
title="@com.google.android.safetycenter.resources:string/google_lock_screen_sources_title"
summary="@com.google.android.safetycenter.resources:string/google_lock_screen_sources_summary">
<dynamic-safety-source
id="AndroidLockScreen"
packageName="com.android.settings"
profile="primary_profile_only"
title="@com.google.android.safetycenter.resources:string/google_lock_screen_title"
summary="@com.google.android.safetycenter.resources:string/google_lock_screen_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_lock_screen_search_terms"
initialDisplayState="disabled"
maxSeverityLevel="300"
refreshOnPageOpenAllowed="true"/>
<dynamic-safety-source
id="AndroidBiometrics"
packageName="com.android.settings"
profile="primary_profile_only"
title="@com.google.android.safetycenter.resources:string/google_biometrics_title"
summary="@com.google.android.safetycenter.resources:string/google_biometrics_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_biometrics_search_terms"
initialDisplayState="@com.google.android.safetycenter.resources:string/google_biometrics_initial_display_state"
maxSeverityLevel="0"
refreshOnPageOpenAllowed="true"/>
</safety-sources-group>
<safety-sources-group
id="GoogleAccountsSources"
title="@com.google.android.safetycenter.resources:string/google_accounts_sources_title"
summary="@com.google.android.safetycenter.resources:string/google_accounts_sources_summary">
<dynamic-safety-source
id="GoogleSecurityCheckup"
packageName="com.google.android.gms"
profile="all_profiles"
intentAction="com.google.android.gms.accountsettings.action.SAFETY_CENTER_SECURITY_CHECKUP"
title="@com.google.android.safetycenter.resources:string/google_security_checkup_title"
titleForWork="@com.google.android.safetycenter.resources:string/google_security_checkup_title_for_work"
summary="@com.google.android.safetycenter.resources:string/google_security_checkup_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_security_checkup_search_terms"
refreshOnPageOpenAllowed="true"/>
</safety-sources-group>
<safety-sources-group
id="GoogleDeviceFinderSources"
title="@com.google.android.safetycenter.resources:string/google_device_finder_sources_title"
summary="@com.google.android.safetycenter.resources:string/google_device_finder_sources_summary">
<dynamic-safety-source
id="GoogleFindMyDevice"
packageName="com.google.android.gms"
profile="primary_profile_only"
intentAction="com.google.android.gms.settings.FIND_MY_DEVICE_SETTINGS"
title="@com.google.android.safetycenter.resources:string/google_find_my_device_title"
summary="@com.google.android.safetycenter.resources:string/google_find_my_device_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_find_my_device_search_terms"
refreshOnPageOpenAllowed="true"/>
<dynamic-safety-source
id="GoogleRogueTag"
packageName="com.google.android.gms"
profile="primary_profile_only"
initialDisplayState="hidden"
refreshOnPageOpenAllowed="true"/>
</safety-sources-group>
<safety-sources-group
id="GoogleUpdateSources"
title="@com.google.android.safetycenter.resources:string/google_updates_title"
summary="@com.google.android.safetycenter.resources:string/google_updates_summary">
<dynamic-safety-source
id="GoogleSecurityUpdates"
packageName="com.google.android.gms"
profile="primary_profile_only"
intentAction="@com.google.android.safetycenter.resources:string/google_security_updates_intent"
title="@com.google.android.safetycenter.resources:string/google_security_updates_title"
summary="@com.google.android.safetycenter.resources:string/google_security_updates_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_security_updates_search_terms"
refreshOnPageOpenAllowed="true"/>
<dynamic-safety-source
id="GooglePlaySystemUpdate"
packageName="com.android.vending"
profile="primary_profile_only"
intentAction="android.settings.MODULE_UPDATE_SETTINGS"
title="@com.google.android.safetycenter.resources:string/google_play_system_update_title"
summary="@com.google.android.safetycenter.resources:string/google_play_system_update_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_play_system_update_search_terms"
refreshOnPageOpenAllowed="true"/>
</safety-sources-group>
<safety-sources-group
id="AndroidPrivacySources"
title="@com.google.android.safetycenter.resources:string/google_privacy_sources_title"
summary="@com.google.android.safetycenter.resources:string/google_privacy_sources_summary"
statelessIconType="privacy">
<static-safety-source
id="AndroidPermissionUsage"
profile="primary_profile_only"
intentAction="android.intent.action.REVIEW_PERMISSION_USAGE"
title="@com.google.android.safetycenter.resources:string/google_permission_usage_title"
summary="@com.google.android.safetycenter.resources:string/google_permission_usage_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_permission_usage_search_terms"/>
<static-safety-source
id="AndroidPermissionManager"
profile="primary_profile_only"
intentAction="android.intent.action.MANAGE_PERMISSIONS"
title="@com.google.android.safetycenter.resources:string/google_permission_manager_title"
summary="@com.google.android.safetycenter.resources:string/google_permission_manager_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_permission_manager_search_terms"/>
<static-safety-source
id="AndroidPrivacyControls"
profile="primary_profile_only"
intentAction="android.settings.PRIVACY_CONTROLS"
title="@com.google.android.safetycenter.resources:string/google_privacy_controls_title"
summary="@com.google.android.safetycenter.resources:string/google_privacy_controls_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_privacy_controls_search_terms"/>
<issue-only-safety-source
id="AndroidAccessibility"
packageName="com.google.android.permissioncontroller"
profile="all_profiles"
refreshOnPageOpenAllowed="true"/>
<issue-only-safety-source
id="AndroidNotificationListener"
packageName="com.google.android.permissioncontroller"
profile="primary_profile_only"
refreshOnPageOpenAllowed="true"/>
<issue-only-safety-source
id="AndroidBackgroundLocation"
packageName="com.google.android.permissioncontroller"
profile="all_profiles"
refreshOnPageOpenAllowed="true"/>
<issue-only-safety-source
id="AndroidPermissionAutoRevoke"
packageName="com.google.android.permissioncontroller"
profile="all_profiles"
refreshOnPageOpenAllowed="true"/>
</safety-sources-group>
<safety-sources-group
id="AndroidAdvancedSources"
title="@com.google.android.safetycenter.resources:string/google_advanced_title">
<dynamic-safety-source
id="AndroidWorkPolicyInfo"
packageName="com.google.android.permissioncontroller"
profile="primary_profile_only"
initialDisplayState="hidden"
refreshOnPageOpenAllowed="true"/>
<static-safety-source
id="AndroidAdvancedSecurity"
profile="primary_profile_only"
intentAction="com.android.settings.security.SECURITY_ADVANCED_SETTINGS"
title="@com.google.android.safetycenter.resources:string/google_advanced_security_title"
summary="@com.google.android.safetycenter.resources:string/google_advanced_security_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_advanced_security_search_terms"/>
<static-safety-source
id="AndroidAdvancedPrivacy"
profile="primary_profile_only"
intentAction="android.settings.PRIVACY_ADVANCED_SETTINGS"
title="@com.google.android.safetycenter.resources:string/google_advanced_privacy_title"
summary="@com.google.android.safetycenter.resources:string/google_advanced_privacy_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_advanced_privacy_search_terms"/>
</safety-sources-group>
</safety-sources-config>
</safety-center-config>
在 Android 14 中,Google 配置文件为:
<safety-center-config>
<safety-sources-config>
<safety-sources-group
id="GoogleAppSecuritySources"
title="@com.google.android.safetycenter.resources:string/google_app_security_sources_title"
summary="@com.google.android.safetycenter.resources:string/google_app_security_sources_summary">
<dynamic-safety-source
id="GooglePlayProtect"
packageName="com.android.vending"
profile="all_profiles"
intentAction="com.google.android.finsky.PLAY_PROTECT"
title="@com.google.android.safetycenter.resources:string/google_play_protect_title"
titleForWork="@com.google.android.safetycenter.resources:string/google_play_protect_title_for_work"
summary="@com.google.android.safetycenter.resources:string/google_play_protect_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_play_protect_search_terms"
notificationsAllowed="true"
packageCertificateHashes="1975b2f17177bc89a5dff31f9e64a6cae281a53dc1d1d59b1d147fe1c82afa00,f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83,d22cc500299fb22873a01a010de1c82fbe4d061119b94814dd301dab50cb7678,7ce83c1b71f3d572fed04c8d40c5cb10ff75e6d87d9df6fbd53f0468c2905053"
deduplicationGroup="AppSecurity"/>
<issue-only-safety-source
id="GoogleAppProtectionService"
packageName="com.google.android.odad"
profile="primary_profile_only"
loggingAllowed="false"
deduplicationGroup="AppSecurity"/>
</safety-sources-group>
<safety-sources-group
id="AndroidLockScreenSources"
title="@com.google.android.safetycenter.resources:string/google_lock_screen_sources_title"
summary="@com.google.android.safetycenter.resources:string/google_lock_screen_sources_summary">
<dynamic-safety-source
id="AndroidLockScreen"
packageName="com.android.settings"
profile="primary_profile_only"
title="@com.google.android.safetycenter.resources:string/google_lock_screen_title"
summary="@com.google.android.safetycenter.resources:string/google_lock_screen_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_lock_screen_search_terms"
initialDisplayState="disabled"
notificationsAllowed="true"
maxSeverityLevel="300"/>
<dynamic-safety-source
id="AndroidBiometrics"
packageName="com.android.settings"
profile="all_profiles"
title="@com.google.android.safetycenter.resources:string/google_biometrics_title"
titleForWork="@com.google.android.safetycenter.resources:string/google_biometrics_title_for_work"
summary="@com.google.android.safetycenter.resources:string/google_biometrics_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_biometrics_search_terms"
initialDisplayState="@com.google.android.safetycenter.resources:string/google_biometrics_initial_display_state"
maxSeverityLevel="0"/>
</safety-sources-group>
<safety-sources-group
id="GoogleAccountsSources"
title="@com.google.android.safetycenter.resources:string/google_accounts_sources_title"
summary="@com.google.android.safetycenter.resources:string/google_accounts_sources_summary">
<dynamic-safety-source
id="GoogleSecurityCheckup"
packageName="com.google.android.gms"
profile="all_profiles"
intentAction="com.google.android.gms.accountsettings.action.SAFETY_CENTER_SECURITY_CHECKUP"
title="@com.google.android.safetycenter.resources:string/google_security_checkup_title"
titleForWork="@com.google.android.safetycenter.resources:string/google_security_checkup_title_for_work"
summary="@com.google.android.safetycenter.resources:string/google_security_checkup_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_security_checkup_search_terms"
deduplicationGroup="AccountRequired"
packageCertificateHashes="1975b2f17177bc89a5dff31f9e64a6cae281a53dc1d1d59b1d147fe1c82afa00,f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83,d22cc500299fb22873a01a010de1c82fbe4d061119b94814dd301dab50cb7678,7ce83c1b71f3d572fed04c8d40c5cb10ff75e6d87d9df6fbd53f0468c2905053"
refreshOnPageOpenAllowed="true"/>
<dynamic-safety-source
id="GooglePasswordCheckup"
packageName="com.google.android.gms"
profile="all_profiles"
title="@com.google.android.safetycenter.resources:string/google_password_checkup_title"
titleForWork="@com.google.android.safetycenter.resources:string/google_password_checkup_title_for_work"
searchTerms="@com.google.android.safetycenter.resources:string/google_password_checkup_search_terms"
initialDisplayState="hidden"
notificationsAllowed="true"
deduplicationGroup="AccountRequired"
packageCertificateHashes="1975b2f17177bc89a5dff31f9e64a6cae281a53dc1d1d59b1d147fe1c82afa00,f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83,d22cc500299fb22873a01a010de1c82fbe4d061119b94814dd301dab50cb7678,7ce83c1b71f3d572fed04c8d40c5cb10ff75e6d87d9df6fbd53f0468c2905053"
refreshOnPageOpenAllowed="false"/>
</safety-sources-group>
<safety-sources-group
id="GoogleDeviceFinderSources"
title="@com.google.android.safetycenter.resources:string/google_device_finder_sources_title"
summary="@com.google.android.safetycenter.resources:string/google_device_finder_sources_summary">
<dynamic-safety-source
id="GoogleFindMyDevice"
packageName="com.google.android.gms"
profile="primary_profile_only"
intentAction="com.google.android.gms.settings.FIND_MY_DEVICE_SETTINGS"
title="@com.google.android.safetycenter.resources:string/google_find_my_device_title"
summary="@com.google.android.safetycenter.resources:string/google_find_my_device_summary"
notificationsAllowed="true"
deduplicationGroup="AccountRequired"
packageCertificateHashes="1975b2f17177bc89a5dff31f9e64a6cae281a53dc1d1d59b1d147fe1c82afa00,f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83,d22cc500299fb22873a01a010de1c82fbe4d061119b94814dd301dab50cb7678,7ce83c1b71f3d572fed04c8d40c5cb10ff75e6d87d9df6fbd53f0468c2905053"
searchTerms="@com.google.android.safetycenter.resources:string/google_find_my_device_search_terms"/>
<dynamic-safety-source
id="GoogleRogueTag"
packageName="com.google.android.gms"
profile="primary_profile_only"
packageCertificateHashes="1975b2f17177bc89a5dff31f9e64a6cae281a53dc1d1d59b1d147fe1c82afa00,f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83,d22cc500299fb22873a01a010de1c82fbe4d061119b94814dd301dab50cb7678,7ce83c1b71f3d572fed04c8d40c5cb10ff75e6d87d9df6fbd53f0468c2905053"
initialDisplayState="hidden"/>
</safety-sources-group>
<safety-sources-group
id="GoogleUpdateSources"
title="@com.google.android.safetycenter.resources:string/google_updates_title"
summary="@com.google.android.safetycenter.resources:string/google_updates_summary">
<dynamic-safety-source
id="GoogleSecurityUpdates"
packageName="com.google.android.gms"
profile="primary_profile_only"
intentAction="@com.google.android.safetycenter.resources:string/google_security_updates_intent"
title="@com.google.android.safetycenter.resources:string/google_security_updates_title"
summary="@com.google.android.safetycenter.resources:string/google_security_updates_summary"
notificationsAllowed="true"
packageCertificateHashes="1975b2f17177bc89a5dff31f9e64a6cae281a53dc1d1d59b1d147fe1c82afa00,f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83,d22cc500299fb22873a01a010de1c82fbe4d061119b94814dd301dab50cb7678,7ce83c1b71f3d572fed04c8d40c5cb10ff75e6d87d9df6fbd53f0468c2905053"
searchTerms="@com.google.android.safetycenter.resources:string/google_security_updates_search_terms"/>
<dynamic-safety-source
id="GooglePlaySystemUpdate"
packageName="com.android.vending"
profile="primary_profile_only"
intentAction="android.settings.MODULE_UPDATE_SETTINGS"
title="@com.google.android.safetycenter.resources:string/google_play_system_update_title"
summary="@com.google.android.safetycenter.resources:string/google_play_system_update_summary"
notificationsAllowed="true"
deduplicationGroup="AccountRequired"
packageCertificateHashes="1975b2f17177bc89a5dff31f9e64a6cae281a53dc1d1d59b1d147fe1c82afa00,f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83,d22cc500299fb22873a01a010de1c82fbe4d061119b94814dd301dab50cb7678,7ce83c1b71f3d572fed04c8d40c5cb10ff75e6d87d9df6fbd53f0468c2905053"
searchTerms="@com.google.android.safetycenter.resources:string/google_play_system_update_search_terms"/>
<dynamic-safety-source
id="GoogleBackupAndRestore"
packageName="com.google.android.gms"
profile="primary_profile_only"
initialDisplayState="hidden"
title="@com.google.android.safetycenter.resources:string/google_backup_title"
packageCertificateHashes="1975b2f17177bc89a5dff31f9e64a6cae281a53dc1d1d59b1d147fe1c82afa00,f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83,d22cc500299fb22873a01a010de1c82fbe4d061119b94814dd301dab50cb7678,7ce83c1b71f3d572fed04c8d40c5cb10ff75e6d87d9df6fbd53f0468c2905053"
searchTerms="@com.google.android.safetycenter.resources:string/google_backup_search_terms"/>
</safety-sources-group>
<safety-sources-group
id="AndroidPrivacySources"
title="@com.google.android.safetycenter.resources:string/google_privacy_sources_title"
summary="@com.google.android.safetycenter.resources:string/google_privacy_sources_summary"
statelessIconType="privacy">
<static-safety-source
id="AndroidPermissionManager"
profile="primary_profile_only"
intentAction="android.intent.action.MANAGE_PERMISSIONS"
title="@com.google.android.safetycenter.resources:string/google_permission_manager_title"
summary="@com.google.android.safetycenter.resources:string/google_permission_manager_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_permission_manager_search_terms"/>
<static-safety-source
id="AndroidPermissionUsage"
profile="primary_profile_only"
intentAction="android.intent.action.REVIEW_PERMISSION_USAGE"
title="@com.google.android.safetycenter.resources:string/google_permission_usage_title"
summary="@com.google.android.safetycenter.resources:string/google_permission_usage_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_permission_usage_search_terms"/>
<static-safety-source
id="GoogleAdsIdentity"
profile="all_profiles"
packageName="com.google.android.gms"
intentAction="com.google.android.gms.adsidentity.ACTION_ADS_IDENTITY_SETTINGS"
title="@com.google.android.safetycenter.resources:string/google_ads_identity_title"
titleForWork="@com.google.android.safetycenter.resources:string/google_ads_identity_title_for_work"
summary="@com.google.android.safetycenter.resources:string/google_ads_identity_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_ads_identity_search_terms"/>
<dynamic-safety-source
id="AndroidHealthConnect"
profile="primary_profile_only"
packageName="com.google.android.healthconnect.controller"
initialDisplayState="hidden"
refreshOnPageOpenAllowed="false"
title="@com.google.android.safetycenter.resources:string/google_health_connect_title"
searchTerms="@com.google.android.safetycenter.resources:string/google_health_connect_search_terms"/>
<dynamic-safety-source
id="AndroidPrivacyAppDataSharingUpdates"
packageName="com.google.android.permissioncontroller"
profile="primary_profile_only"
initialDisplayState="hidden"
refreshOnPageOpenAllowed="true"
title="@com.google.android.safetycenter.resources:string/google_app_data_sharing_updates_title"
searchTerms="@com.google.android.safetycenter.resources:string/google_app_data_sharing_updates_search_terms"/>
<static-safety-source
id="AndroidPrivacyControls"
profile="primary_profile_only"
intentAction="android.settings.PRIVACY_CONTROLS"
title="@com.google.android.safetycenter.resources:string/google_privacy_controls_title"
summary="@com.google.android.safetycenter.resources:string/google_privacy_controls_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_privacy_controls_search_terms"/>
<static-safety-source
id="GoogleActivityControls"
profile="all_profiles"
packageName="com.google.android.gms"
intentAction="com.google.android.gms.accountsettings.action.ACTIVITY_CONTROLS"
title="@com.google.android.safetycenter.resources:string/google_activity_controls_title"
titleForWork="@com.google.android.safetycenter.resources:string/google_activity_controls_title_for_work"
summary="@com.google.android.safetycenter.resources:string/google_activity_controls_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_activity_controls_search_terms"/>
<issue-only-safety-source
id="AndroidAccessibility"
packageName="com.google.android.permissioncontroller"
profile="all_profiles"
notificationsAllowed="true"
refreshOnPageOpenAllowed="true"/>
<issue-only-safety-source
id="AndroidNotificationListener"
packageName="com.google.android.permissioncontroller"
profile="primary_profile_only"
notificationsAllowed="true"
refreshOnPageOpenAllowed="true"/>
<issue-only-safety-source
id="AndroidBackgroundLocation"
packageName="com.google.android.permissioncontroller"
profile="all_profiles"
notificationsAllowed="true"
refreshOnPageOpenAllowed="true"/>
<issue-only-safety-source
id="AndroidPermissionAutoRevoke"
packageName="com.google.android.permissioncontroller"
profile="all_profiles"
notificationsAllowed="true"
refreshOnPageOpenAllowed="true"/>
</safety-sources-group>
<safety-sources-group
id="AndroidAdvancedSources"
title="@com.google.android.safetycenter.resources:string/google_advanced_title">
<dynamic-safety-source
id="AndroidWorkPolicyInfo"
packageName="com.google.android.permissioncontroller"
profile="primary_profile_only"
title="@com.google.android.safetycenter.resources:string/google_work_policy_title"
initialDisplayState="hidden"
refreshOnPageOpenAllowed="true"/>
<static-safety-source
id="AndroidMoreSettings"
profile="primary_profile_only"
intentAction="com.android.settings.MORE_SECURITY_PRIVACY_SETTINGS"
title="@com.google.android.safetycenter.resources:string/google_more_settings_title"
summary="@com.google.android.safetycenter.resources:string/google_more_settings_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_more_settings_search_terms"/>
</safety-sources-group>
</safety-sources-config>
</safety-center-config>
在 Android 15 中,Google 配置文件为:
<safety-center-config>
<safety-sources-config>
<safety-sources-group
id="GoogleAppSecuritySources"
title="@com.google.android.safetycenter.resources:string/google_app_security_sources_title"
summary="@com.google.android.safetycenter.resources:string/google_app_security_sources_summary">
<dynamic-safety-source
id="GooglePlayProtect"
packageName="com.android.vending"
profile="all_profiles"
intentAction="com.google.android.finsky.PLAY_PROTECT"
title="@com.google.android.safetycenter.resources:string/google_play_protect_title"
titleForWork="@com.google.android.safetycenter.resources:string/google_play_protect_title_for_work"
titleForPrivateProfile="@com.google.android.safetycenter.resources:string/google_play_protect_title_for_private_profile"
summary="@com.google.android.safetycenter.resources:string/google_play_protect_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_play_protect_search_terms"
notificationsAllowed="true"
packageCertificateHashes="1975b2f17177bc89a5dff31f9e64a6cae281a53dc1d1d59b1d147fe1c82afa00,f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83,d22cc500299fb22873a01a010de1c82fbe4d061119b94814dd301dab50cb7678,7ce83c1b71f3d572fed04c8d40c5cb10ff75e6d87d9df6fbd53f0468c2905053"
deduplicationGroup="AppSecurity"/>
<issue-only-safety-source
id="GoogleAppProtectionService"
packageName="com.google.android.odad"
profile="primary_profile_only"
loggingAllowed="false"
deduplicationGroup="AppSecurity"/>
</safety-sources-group>
<safety-sources-group
id="AndroidLockScreenSources"
title="@com.google.android.safetycenter.resources:string/google_lock_screen_sources_title"
summary="@com.google.android.safetycenter.resources:string/google_lock_screen_sources_summary">
<dynamic-safety-source
id="AndroidLockScreen"
packageName="com.android.settings"
profile="primary_profile_only"
title="@com.google.android.safetycenter.resources:string/google_lock_screen_title"
summary="@com.google.android.safetycenter.resources:string/google_lock_screen_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_lock_screen_search_terms"
initialDisplayState="disabled"
notificationsAllowed="true"
maxSeverityLevel="300"/>
<dynamic-safety-source
id="AndroidBiometrics"
packageName="com.android.settings"
profile="all_profiles"
title="@com.google.android.safetycenter.resources:string/google_biometrics_title"
titleForWork="@com.google.android.safetycenter.resources:string/google_biometrics_title_for_work"
titleForPrivateProfile="@com.google.android.safetycenter.resources:string/google_biometrics_title_for_private_profile"
summary="@com.google.android.safetycenter.resources:string/google_biometrics_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_biometrics_search_terms"
initialDisplayState="@com.google.android.safetycenter.resources:string/google_biometrics_initial_display_state"
maxSeverityLevel="0"/>
<dynamic-safety-source
id="GoogleAutoLock"
packageName="com.google.android.gms"
profile="primary_profile_only"
initialDisplayState="hidden"
maxSeverityLevel="0"
packageCertificateHashes="1975b2f17177bc89a5dff31f9e64a6cae281a53dc1d1d59b1d147fe1c82afa00,f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83,d22cc500299fb22873a01a010de1c82fbe4d061119b94814dd301dab50cb7678,7ce83c1b71f3d572fed04c8d40c5cb10ff75e6d87d9df6fbd53f0468c2905053"/>
</safety-sources-group>
<safety-sources-group
id="GoogleAccountsSources"
title="@com.google.android.safetycenter.resources:string/google_accounts_sources_title"
summary="@com.google.android.safetycenter.resources:string/google_accounts_sources_summary">
<dynamic-safety-source
id="GoogleSecurityCheckup"
packageName="com.google.android.gms"
profile="all_profiles"
intentAction="com.google.android.gms.accountsettings.action.SAFETY_CENTER_SECURITY_CHECKUP"
title="@com.google.android.safetycenter.resources:string/google_security_checkup_title"
titleForWork="@com.google.android.safetycenter.resources:string/google_security_checkup_title_for_work"
titleForPrivateProfile="@com.google.android.safetycenter.resources:string/google_security_checkup_title_for_private_profile"
summary="@com.google.android.safetycenter.resources:string/google_security_checkup_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_security_checkup_search_terms"
deduplicationGroup="AccountRequired"
packageCertificateHashes="1975b2f17177bc89a5dff31f9e64a6cae281a53dc1d1d59b1d147fe1c82afa00,f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83,d22cc500299fb22873a01a010de1c82fbe4d061119b94814dd301dab50cb7678,7ce83c1b71f3d572fed04c8d40c5cb10ff75e6d87d9df6fbd53f0468c2905053"
refreshOnPageOpenAllowed="true"/>
<dynamic-safety-source
id="GooglePasswordCheckup"
packageName="com.google.android.gms"
profile="all_profiles"
title="@com.google.android.safetycenter.resources:string/google_password_checkup_title"
titleForWork="@com.google.android.safetycenter.resources:string/google_password_checkup_title_for_work"
titleForPrivateProfile="@com.google.android.safetycenter.resources:string/google_password_checkup_title_for_private_profile"
searchTerms="@com.google.android.safetycenter.resources:string/google_password_checkup_search_terms"
initialDisplayState="hidden"
notificationsAllowed="true"
deduplicationGroup="AccountRequired"
packageCertificateHashes="1975b2f17177bc89a5dff31f9e64a6cae281a53dc1d1d59b1d147fe1c82afa00,f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83,d22cc500299fb22873a01a010de1c82fbe4d061119b94814dd301dab50cb7678,7ce83c1b71f3d572fed04c8d40c5cb10ff75e6d87d9df6fbd53f0468c2905053"
refreshOnPageOpenAllowed="false"/>
</safety-sources-group>
<safety-sources-group
id="GoogleDeviceFinderSources"
title="@com.google.android.safetycenter.resources:string/google_device_finder_sources_title"
summary="@com.google.android.safetycenter.resources:string/google_device_finder_sources_summary">
<dynamic-safety-source
id="GoogleFindMyDevice"
packageName="com.google.android.gms"
profile="primary_profile_only"
intentAction="com.google.android.gms.settings.FIND_MY_DEVICE_SETTINGS"
title="@com.google.android.safetycenter.resources:string/google_find_my_device_title"
summary="@com.google.android.safetycenter.resources:string/google_find_my_device_summary"
notificationsAllowed="true"
deduplicationGroup="AccountRequired"
packageCertificateHashes="1975b2f17177bc89a5dff31f9e64a6cae281a53dc1d1d59b1d147fe1c82afa00,f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83,d22cc500299fb22873a01a010de1c82fbe4d061119b94814dd301dab50cb7678,7ce83c1b71f3d572fed04c8d40c5cb10ff75e6d87d9df6fbd53f0468c2905053"
searchTerms="@com.google.android.safetycenter.resources:string/google_find_my_device_search_terms"/>
<dynamic-safety-source
id="GoogleRogueTag"
packageName="com.google.android.gms"
profile="primary_profile_only"
packageCertificateHashes="1975b2f17177bc89a5dff31f9e64a6cae281a53dc1d1d59b1d147fe1c82afa00,f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83,d22cc500299fb22873a01a010de1c82fbe4d061119b94814dd301dab50cb7678,7ce83c1b71f3d572fed04c8d40c5cb10ff75e6d87d9df6fbd53f0468c2905053"
initialDisplayState="hidden"/>
</safety-sources-group>
<safety-sources-group
id="GoogleUpdateSources"
title="@com.google.android.safetycenter.resources:string/google_updates_title"
summary="@com.google.android.safetycenter.resources:string/google_updates_summary">
<dynamic-safety-source
id="GoogleSecurityUpdates"
packageName="com.google.android.gms"
profile="primary_profile_only"
intentAction="@com.google.android.safetycenter.resources:string/google_security_updates_intent"
title="@com.google.android.safetycenter.resources:string/google_security_updates_title"
summary="@com.google.android.safetycenter.resources:string/google_security_updates_summary"
notificationsAllowed="true"
packageCertificateHashes="1975b2f17177bc89a5dff31f9e64a6cae281a53dc1d1d59b1d147fe1c82afa00,f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83,d22cc500299fb22873a01a010de1c82fbe4d061119b94814dd301dab50cb7678,7ce83c1b71f3d572fed04c8d40c5cb10ff75e6d87d9df6fbd53f0468c2905053"
searchTerms="@com.google.android.safetycenter.resources:string/google_security_updates_search_terms"/>
<dynamic-safety-source
id="GooglePlaySystemUpdate"
packageName="com.android.vending"
profile="primary_profile_only"
intentAction="android.settings.MODULE_UPDATE_SETTINGS"
title="@com.google.android.safetycenter.resources:string/google_play_system_update_title"
summary="@com.google.android.safetycenter.resources:string/google_play_system_update_summary"
notificationsAllowed="true"
deduplicationGroup="AccountRequired"
packageCertificateHashes="1975b2f17177bc89a5dff31f9e64a6cae281a53dc1d1d59b1d147fe1c82afa00,f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83,d22cc500299fb22873a01a010de1c82fbe4d061119b94814dd301dab50cb7678,7ce83c1b71f3d572fed04c8d40c5cb10ff75e6d87d9df6fbd53f0468c2905053"
searchTerms="@com.google.android.safetycenter.resources:string/google_play_system_update_search_terms"/>
<dynamic-safety-source
id="GoogleBackupAndRestore"
packageName="com.google.android.gms"
profile="primary_profile_only"
initialDisplayState="hidden"
title="@com.google.android.safetycenter.resources:string/google_backup_title"
packageCertificateHashes="1975b2f17177bc89a5dff31f9e64a6cae281a53dc1d1d59b1d147fe1c82afa00,f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83,d22cc500299fb22873a01a010de1c82fbe4d061119b94814dd301dab50cb7678,7ce83c1b71f3d572fed04c8d40c5cb10ff75e6d87d9df6fbd53f0468c2905053"
searchTerms="@com.google.android.safetycenter.resources:string/google_backup_search_terms"/>
</safety-sources-group>
<safety-sources-group
id="AndroidCellularNetworkSecuritySources"
title="@com.google.android.safetycenter.resources:string/google_cellular_network_security_title"
summary="@com.google.android.safetycenter.resources:string/google_cellular_network_security_summary">
<dynamic-safety-source
id="AndroidCellularNetworkSecurity"
packageName="com.android.phone"
profile="primary_profile_only"
notificationsAllowed="true"
initialDisplayState="hidden"/>
</safety-sources-group>
<safety-sources-group
id="AndroidPrivacySources"
title="@com.google.android.safetycenter.resources:string/google_privacy_sources_title"
summary="@com.google.android.safetycenter.resources:string/google_privacy_sources_summary">
<static-safety-source
id="AndroidPermissionManager"
profile="primary_profile_only"
intentAction="android.intent.action.MANAGE_PERMISSIONS"
title="@com.google.android.safetycenter.resources:string/google_permission_manager_title"
summary="@com.google.android.safetycenter.resources:string/google_permission_manager_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_permission_manager_search_terms"/>
<static-safety-source
id="GoogleAdsIdentity"
profile="all_profiles"
packageName="com.google.android.gms"
intentAction="com.google.android.gms.adsidentity.ACTION_ADS_IDENTITY_SETTINGS"
title="@com.google.android.safetycenter.resources:string/google_ads_identity_title"
titleForWork="@com.google.android.safetycenter.resources:string/google_ads_identity_title_for_work"
titleForPrivateProfile="@com.google.android.safetycenter.resources:string/google_ads_identity_title_for_private_profile"
summary="@com.google.android.safetycenter.resources:string/google_ads_identity_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_ads_identity_search_terms"/>
<dynamic-safety-source
id="AndroidHealthConnect"
profile="primary_profile_only"
packageName="com.google.android.healthconnect.controller"
initialDisplayState="hidden"
refreshOnPageOpenAllowed="false"
title="@com.google.android.safetycenter.resources:string/google_health_connect_title"
searchTerms="@com.google.android.safetycenter.resources:string/google_health_connect_search_terms"/>
<dynamic-safety-source
id="AndroidPrivacyAppDataSharingUpdates"
packageName="com.google.android.permissioncontroller"
profile="primary_profile_only"
initialDisplayState="hidden"
refreshOnPageOpenAllowed="true"
title="@com.google.android.safetycenter.resources:string/google_app_data_sharing_updates_title"
searchTerms="@com.google.android.safetycenter.resources:string/google_app_data_sharing_updates_search_terms"/>
<static-safety-source
id="AndroidPrivacyControls"
profile="primary_profile_only"
intentAction="android.settings.PRIVACY_CONTROLS"
title="@com.google.android.safetycenter.resources:string/google_privacy_controls_title"
summary="@com.google.android.safetycenter.resources:string/google_privacy_controls_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_privacy_controls_search_terms"/>
<static-safety-source
id="GoogleActivityControls"
profile="all_profiles"
packageName="com.google.android.gms"
intentAction="com.google.android.gms.accountsettings.action.ACTIVITY_CONTROLS"
title="@com.google.android.safetycenter.resources:string/google_activity_controls_title"
titleForWork="@com.google.android.safetycenter.resources:string/google_activity_controls_title_for_work"
titleForPrivateProfile="@com.google.android.safetycenter.resources:string/google_activity_controls_title_for_private_profile"
summary="@com.google.android.safetycenter.resources:string/google_activity_controls_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_activity_controls_search_terms"/>
<issue-only-safety-source
id="AndroidAccessibility"
packageName="com.google.android.permissioncontroller"
profile="all_profiles"
notificationsAllowed="true"
refreshOnPageOpenAllowed="true"/>
<issue-only-safety-source
id="AndroidNotificationListener"
packageName="com.google.android.permissioncontroller"
profile="primary_profile_only"
notificationsAllowed="true"
refreshOnPageOpenAllowed="true"/>
<issue-only-safety-source
id="AndroidBackgroundLocation"
packageName="com.google.android.permissioncontroller"
profile="all_profiles"
notificationsAllowed="true"
refreshOnPageOpenAllowed="true"/>
<issue-only-safety-source
id="AndroidPermissionAutoRevoke"
packageName="com.google.android.permissioncontroller"
profile="all_profiles"
notificationsAllowed="true"
refreshOnPageOpenAllowed="true"/>
</safety-sources-group>
<safety-sources-group
id="AndroidPrivacySourcesAdditional"
title="@com.google.android.safetycenter.resources:string/google_privacy_additional_title">
<static-safety-source
id="AndroidPermissionUsage"
profile="primary_profile_only"
intentAction="android.intent.action.REVIEW_PERMISSION_USAGE"
title="@com.google.android.safetycenter.resources:string/google_permission_usage_title"
summary="@com.google.android.safetycenter.resources:string/google_permission_usage_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_permission_usage_search_terms"/>
<dynamic-safety-source
id="AndroidPrivateSpace"
packageName="com.android.settings"
profile="primary_profile_only"
title="@com.google.android.safetycenter.resources:string/google_private_space_title"
summary="@com.google.android.safetycenter.resources:string/google_private_space_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_private_space_search_terms"
initialDisplayState="hidden"
maxSeverityLevel="0"/>
</safety-sources-group>
<safety-sources-group
id="AndroidAdvancedSources"
title="@com.google.android.safetycenter.resources:string/google_advanced_title">
<dynamic-safety-source
id="AndroidWorkPolicyInfo"
packageName="com.google.android.permissioncontroller"
profile="primary_profile_only"
title="@com.google.android.safetycenter.resources:string/google_work_policy_title"
initialDisplayState="hidden"
refreshOnPageOpenAllowed="true"/>
<static-safety-source
id="AndroidMoreSettings"
profile="primary_profile_only"
intentAction="com.android.settings.MORE_SECURITY_PRIVACY_SETTINGS"
title="@com.google.android.safetycenter.resources:string/google_more_settings_title"
summary="@com.google.android.safetycenter.resources:string/google_more_settings_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_more_settings_search_terms"/>
</safety-sources-group>
</safety-sources-config>
</safety-center-config>
自定义安全中心信息来源
安全中心信息来源类型
这些来源可以是动态的、仅显示问题的,也可以是静态的,具体取决于它们向安全中心提供的数据类型。
动态信息来源
如果安全性信息来源能为安全中心的条目和潜在警告卡片提供动态数据,则可将其标记为 dynamic-safety-source
:
<dynamic-safety-source
id="AndroidLockScreen"
packageName="com.android.settings"
profile="primary_profile_only"
title="@com.google.android.safetycenter.resources:string/google_lock_screen_title"
summary="@com.google.android.safetycenter.resources:string/google_lock_screen_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_lock_screen_search_terms"
initialDisplayState="disabled"
maxSeverityLevel="300"
refreshOnPageOpenAllowed="true"/>
仅显示问题的信息来源
如果没有关联的设置条目,但系统仍然提供警告,请将来源标记为 issue-only-safety-source
。您只能发出警告;提供设置条目会导致错误:
<issue-only-safety-source
id="AndroidAccessibility"
packageName="com.google.android.permissioncontroller"
profile="all_profiles"
refreshOnPageOpenAllowed="true"/>
静态信息来源
如果来源是没有动态数据的重定向条目,请将来源标记为 static-safety-source
:
<static-safety-source
id="AndroidAdvancedSecurity"
profile="primary_profile_only"
intentAction="com.google.android.settings.security.SECURITY_ADVANCED_SETTINGS"
title="@com.google.android.safetycenter.resources:string/google_advanced_security_title"
summary="@com.google.android.safetycenter.resources:string/google_advanced_security_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_advanced_security_search_terms"/>
安全中心信息来源配置
根据安全中心源类型和其他不变量,配置文件字段可以是可选的、必需的或禁用的,并且支持自定义:
id
- 安全性信息来源的唯一标识符,在整个文件中必须是唯一的,且必须由字母字符(az 和 AZ)组成,并且区分大小写
- 字符串类型
- 对于所有安全性信息来源类型而言是必需的
packageName
- 拥有此安全性信息来源的软件包的名称,例如
com.google.android.permissioncontroller
- 字符串类型
- 对于动态和仅显示问题的安全性信息来源而言是必需的
- 对于 Android 13 中的静态安全性信息来源而言是禁用的;在 Android 14 中,可以选择将此属性设置为显式(而非隐式)以来源的
intentAction
为目标(如需了解更多详情,请参阅 intent 解析文档)
- 拥有此安全性信息来源的软件包的名称,例如
initialDisplayState
- 安全性信息来源未提供任何数据时界面条目的显示方式
- 以字符串表示的枚举类型必须是下列类型之一:
enabled
(默认,正常显示)disabled
(显示屏灰显,无法点击)hidden
(不显示)
- 对于动态安全性信息来源而言是可选的(默认为
enabled
) - 对于仅显示问题和静态的安全性信息来源而言是禁用的
profile
- 此安全性信息来源是否会与用户的受管理资料互动
- 以字符串表示的枚举类型必须是下列类型之一:
primary_profile_only
(仅与个人资料父级交互)all_profiles
(也可以与受管理个人资料互动,并从 Android 15 开始与不公开个人资料互动)
- 在
all_profiles
上,会生成多个界面条目(一个用于个人资料父账号,每个受管理资料对应一个);安全性信息来源可为每个配置文件提供不同的数据 - 对于所有安全性信息来源而言是必需的
searchTerms
- 您在使用“设置”应用中搜索时映射到安全中心条目的搜索字词列表
- 以完全限定资源名称表示的资源 ID,例如
@package:string/my_search_terms
- 对于动态和静态安全性信息来源而言是可选的(默认为无搜索字词)
- 对于仅显示问题的安全性信息来源而言是禁用的
title
- 界面条目的默认标题,在来源没有动态提供数据时使用
- 以完全限定资源名称表示的资源 ID,例如
@package:string/my_title
- 对于动态和静态安全性信息来源而言是必需的(除非
initialDisplayState="hidden"
没有searchTerms
) - 对于仅显示问题的安全性信息来源而言是禁用的
titleForWork
- 受管理资料的界面默认标题,在来源没有动态提供数据时使用
- 以完全限定资源名称表示的资源 ID,例如
@package:string/my_title_for_work
- 对于已指定
profile="all_profiles"
的动态和静态安全性信息来源而言是必需的(除非initialDisplayState="hidden"
没有searchTerms
) - 对于仅显示问题的安全性信息来源或包含
profile="primary_profile_only"
的信息来源而言是禁用的
summary
- 界面条目的默认摘要(这是显示在标题下方的较长文本说明),在来源没有动态提供数据时使用
- 以完全限定资源名称表示的资源 ID,例如
@package:string/my_summary
- 对于静态安全性信息来源而言是可选的(默认为无摘要)
- 对于动态安全性信息来源而言是必需的(除非
initialDisplayState
为hidden
) - 对于仅显示问题的安全性信息来源而言是禁用的
intentAction
- 点击界面条目时触发的操作
- 字符串类型(例如
com.google.android.settings.security.SECURITY_ADVANCED_SETTINGS
)或以完全限定资源名称表示的资源 ID(例如@package:string/my_intent_action
) - 如果对于给定
packageName
,该 intent 操作无法解析(如果有),则界面条目的行为方式与initialDisplayState="disabled"
相同。 - 对于静态安全性信息来源和具有
initialDisplayState="enabled"
的dynamic
安全性信息来源而言是必需的 - 对于仅显示问题的安全性信息来源而言是禁用的
maxSeverityLevel
- 此安全中心信息来源可以提供的最高严重程度级别
- 以字符串表示的整数,例如
300
- 对于动态和仅显示问题的安全性信息来源而言是可选的(默认为无上限)
- 对于静态安全性信息来源而言是禁用的
loggingAllowed
- 安全中心是否可以记录与此来源相关的互动或数据
- 以字符串表示的布尔值,例如
false
- 对于动态和仅显示问题的安全性信息来源而言是可选的(默认为
true
) - 对于静态安全性信息来源而言是禁用的
refreshOnPageOpenAllowed
- 当安全中心屏幕打开时,是否应向安全性信息来源发送信号以刷新其数据
- 以字符串表示的布尔值,例如
true
- 对于动态和仅显示问题的安全性信息来源而言是可选的(默认为
false
) - 对于静态安全性信息来源而言是禁用的
notificationsAllowed
(从 Android 14 开始)- 安全性信息来源是否可以在报告问题时提供通知
- 以字符串表示的布尔值,例如
true
- 对于动态和仅显示问题的安全性信息来源而言是可选的(默认为
false
) - 对于静态安全性信息来源而言是禁用的
deduplicationGroup
(从 Android 14 开始)- 潜在唯一标识符,可用于删除来自不同来源的问题的重复信息。同一重复信息删除群组内的来源可以使用可选的重复信息删除 ID 发送问题。即使有多个数据源同时发送,重复信息删除 ID 的问题也只会在界面中显示一次。
- 字符串类型
- 对于动态和仅显示问题的安全性信息来源而言是可选的(默认为不执行去重)
- 对于静态安全性信息来源而言是禁用的
packageCertificateHashes
(从 Android 14 开始)- 给定
packageName
的证书哈希值逗号分隔列表。如果设置了此标记,出于安全目的,在与安全性信息来源进行交互时,会针对给定packageName
的给定packageCertificateHashes
执行证书检查。 - 字符串类型
- 对于动态和仅显示问题的安全性信息来源而言是可选的(默认为不检查证书)
- 对于静态安全性信息来源而言是禁用的
- 给定
titleForPrivateProfile
(从 Android 15 开始)- 不公开个人资料的界面条目默认标题,在来源没有动态提供数据时使用
- 以完全限定资源名称表示的资源 ID,例如
@package:string/my_title_for_private_profile
- 对于已指定
profile="all_profiles"
的动态和静态安全性信息来源而言是必需的(除非initialDisplayState="hidden"
没有searchTerms
) - 对于仅显示问题的安全性信息来源或包含
profile="primary_profile_only"
的信息来源而言是禁用的
自定义安全中心信息来源群组
安全中心信息来源必须包含安全中心信息来源群组。每个源群组都会按照文件在文件中的列出顺序在界面中显示。每个来源都会按照文件中列出的顺序在群组内显示。如果该群组包含一个安全性信息来源,则会显示为单个条目,而非群组。
安全中心信息来源群组配置
使用以下变量自定义安全中心信息来源群组:
id
- 安全性信息来源群组的唯一标识符;在整个文件中必须是唯一的
- 字符串类型
- 必需
title
- 界面中群组的标题
- 以完全限定资源名称表示的资源 ID,例如
@package:string/my_title
- 如果群组内至少有一个动态或静态安全性信息来源(即该群组不是
type="hidden"
),则为必需属性
summary
- 界面中的群组的简短说明,显示在标题下方。 在特定条件下(通常是在未提供数据的情况下)显示;否则,系统会根据群组内的来源提供的数据计算摘要。
- 以完全限定资源名称表示的资源 ID,例如
@package:string/my_summary
- 可选属性(默认为无摘要)
statelessIconType
- 在安全性信息来源未提供任何状态(例如静态条目)时,为群组显示的图标类型
- 以字符串表示的枚举类型,必须为
none
或privacy
(隐私图标类型) - 可选属性(默认为
none
)
type
(从 Android 14 开始)- 用于明确此群组与安全中心互动的方式的明确类型
- 以字符串表示的枚举类型必须是下列类型之一:
stateful
(显示并影响安全中心的整体状态)stateless
(显示并不会影响安全中心的整体状态)hidden
(不显示,所有来源必须是仅显示问题的信息来源)
- 可选,默认情况下使用群组中包含的安全性信息来源以及
summary
和statelessIconType
进行推断。如果指定了type
,系统会强制执行一些其他的不变量,以确保它与群组中遇到的来源匹配(例如,如果群组用户可见的条目,则该群组不能为hidden
)
安全中心信息来源群组类型
根据特定字段的状态,安全中心信息来源群组会被归类为有状态、无状态或隐藏。
有状态群组
同时具有标题和摘要或者 stateLessIconType="privacy"
的群组会被视为有状态账号,其对安全中心的整体状态有影响:
<safety-sources-group
id="GoogleAppSecuritySources"
title="@com.google.android.safetycenter.resources:string/google_app_security_sources_title"
summary="@com.google.android.safetycenter.resources:string/google_app_security_sources_summary">
<dynamic-safety-source
id="GooglePlayProtect"
packageName="com.android.vending"
profile="all_profiles"
intentAction="com.google.android.finsky.PLAY_PROTECT"
title="@com.google.android.safetycenter.resources:string/google_play_protect_title"
titleForWork="@com.google.android.safetycenter.resources:string/google_play_protect_title_for_work"
summary="@com.google.android.safetycenter.resources:string/google_play_protect_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_play_protect_search_terms"
refreshOnPageOpenAllowed="true"/>
<dynamic-safety-source
id="GoogleAppProtectionService"
packageName="com.google.android.odad"
profile="primary_profile_only"
initialDisplayState="hidden"
loggingAllowed="false"/>
</safety-sources-group>
在 Android 13 中,此类群组在界面中将显示为可收起的条目。在 Android 14 中,它会显示为条目,具有自己的状态,且会重定向到子页面。
无状态群组
已命名但无摘要的群组处于 stateLessIconType="none"
状态,会被视为无状态,其本身并不会影响安全中心的整体状态:
<safety-sources-group
id="AndroidPrivacySources"
title="@com.google.android.safetycenter.resources:string/google_privacy_sources_title"
summary="@com.google.android.safetycenter.resources:string/google_privacy_sources_summary"
statelessIconType="privacy">
<static-safety-source
id="AndroidPermissionUsage"
profile="primary_profile_only"
intentAction="android.intent.action.REVIEW_PERMISSION_USAGE"
title="@com.google.android.safetycenter.resources:string/google_permission_usage_title"
summary="@com.google.android.safetycenter.resources:string/google_permission_usage_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_permission_usage_search_terms"/>
<static-safety-source
id="AndroidPermissionManager"
profile="primary_profile_only"
intentAction="android.intent.action.MANAGE_PERMISSIONS"
title="@com.google.android.safetycenter.resources:string/google_permission_manager_title"
summary="@com.google.android.safetycenter.resources:string/google_permission_manager_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_permission_manager_search_terms"/>
<static-safety-source
id="AndroidPrivacyControls"
profile="primary_profile_only"
intentAction="android.settings.PRIVACY_CONTROLS"
title="@com.google.android.safetycenter.resources:string/google_privacy_controls_title"
summary="@com.google.android.safetycenter.resources:string/google_privacy_controls_summary"
searchTerms="@com.google.android.safetycenter.resources:string/google_privacy_controls_search_terms"/>
<issue-only-safety-source
id="AndroidAccessibility"
packageName="com.google.android.permissioncontroller"
profile="all_profiles"
refreshOnPageOpenAllowed="true"/>
<issue-only-safety-source
id="AndroidNotificationListener"
packageName="com.google.android.permissioncontroller"
profile="primary_profile_only"
refreshOnPageOpenAllowed="true"/>
<issue-only-safety-source
id="AndroidBackgroundLocation"
packageName="com.google.android.permissioncontroller"
profile="all_profiles"
refreshOnPageOpenAllowed="true"/>
<issue-only-safety-source
id="AndroidPermissionAutoRevoke"
packageName="com.google.android.permissioncontroller"
profile="all_profiles"
refreshOnPageOpenAllowed="true"/>
</safety-sources-group>
此类群组将在界面中显示为僵化的条目列表。
隐藏的群组
隐藏的群组仅包含仅显示问题的安全性信息来源,而没有标题。 隐藏的群组不会显示在界面中:
<safety-sources-group
id="HiddenGroup">
<issue-only-safety-source
id="AndroidAccessibility"
packageName="com.google.android.permissioncontroller"
profile="all_profiles"
refreshOnPageOpenAllowed="true"/>
</safety-sources-group>
静态条目的动态数据
您可以将动态安全中心信息来源显示为静态条目,以便根据某些条件推送重定向条目,并在运行时自定义其内容。例如,根据您的工作政策信息条目,在无状态群组中定义动态信息来源。
以下示例展示了动态安全性信息来源,该安全性信息来源不提供安全信号,因为它位于无状态群组中:
<safety-sources-group
id="AndroidAdvancedSources"
title="@com.google.android.safetycenter.resources:string/google_advanced_title">
<dynamic-safety-source
id="AndroidWorkPolicyInfo"
packageName="com.google.android.permissioncontroller"
profile="primary_profile_only"
initialDisplayState="hidden"
refreshOnPageOpenAllowed="true"/>
<!-- … -->
</safety-sources-group>
在此示例中,来源只能推送绿色警告卡片,并提供一个未指定的状态。为了能够提供其他数据,来源必须位于有状态群组中。
自定义字符串和叠加层字段
对于未配置为接收 Mainline 更新的 GMS 设备,您可以叠加六个字符串资源来满足所有自定义需求,而不是叠加整个配置文件。下表中列出了叠加的字符串资源。
字符串资源 | 说明 |
---|---|
google_lock_screen_sources_summary |
叠加此值可定义当 AndroidLockScreenSources 群组中的所有来源都处于良好状态(信息级别或未指定严重程度级别)时显示的静态摘要。默认情况下,安全中心会显示群组中所有来源的标题,并将它们串联成群组的摘要。 |
google_biometrics_title |
叠加此值,可为 com.android.settings 软件包拥有的生物识别来源定义静态标题(在来源不提供动态数据时)。此外,如果还叠加了 com.android.settings 软件包中来源动态提供的影视内容,请叠加此属性。默认情况下,系统会忽略该来源,因为来源的初始显示状态为 hidden 。 |
google_biometrics_summary |
叠加该值,可以为 com.android.settings 软件包拥有的生物识别来源定义静态摘要(在来源不提供动态数据时)。默认情况下,系统会忽略该来源,因为来源的初始显示状态为 hidden 。 |
google_biometrics_search_terms |
叠加此值可为 com.android.settings 软件包拥有的生物识别来源定义搜索字词列表。 |
google_biometrics_initial_display_state |
叠加此值,以显示 com.android.settings 软件包拥有的生物识别来源在没有来源提供动态数据时的界面条目。默认值为 hidden 。 |
google_security_updates_intent |
叠加此值可更改打开用于允许用户查看和安装安全更新的 activity 所需的 intent。此 intent 操作必须与导出的 activity 相关联。默认值为 android.settings.SYSTEM_UPDATE_SETTINGS 。 |
com.google.android.safetycenter.resources
软件包中没有其他字符串可叠加。
对于 AOSP 设备,com.android.safetycenter.resources
软件包中的所有资源都是可叠加的,不受内容限制。
对于未配置为接收 Mainline 更新的 GMS 设备,请创建一个 com.google.android.safetycenter.resources
软件包,以替换或叠加 com.android.safetycenter.resources
来定义 GTS 测试要求的所有字符串。
这些字符串包括:
google_app_security_sources_title
google_app_security_sources_summary
google_play_protect_title
google_play_protect_title_for_work
google_play_protect_summary
google_play_protect_search_terms
google_lock_screen_sources_title
google_lock_screen_sources_summary
google_lock_screen_title
google_lock_screen_summary
google_lock_screen_search_terms
google_biometrics_title
google_biometrics_summary
google_biometrics_search_terms
google_biometrics_initial_display_state
google_accounts_sources_title
google_accounts_sources_summary
google_security_checkup_title
google_security_checkup_title_for_work
google_security_checkup_summary
google_security_checkup_search_terms
google_device_finder_sources_title
google_device_finder_sources_summary
google_find_my_device_title
google_find_my_device_summary
google_find_my_device_search_terms
google_updates_title
google_updates_summary
google_security_updates_title
google_security_updates_summary
google_security_updates_search_terms
google_security_updates_intent
google_play_system_update_title
google_play_system_update_summary
google_play_system_update_search_terms
google_privacy_sources_title
google_privacy_sources_summary
google_permission_usage_title
google_permission_usage_summary
google_permission_usage_search_terms
google_permission_manager_title
google_permission_manager_summary
google_permission_manager_search_terms
google_privacy_controls_title
google_privacy_controls_summary
google_privacy_controls_search_terms
google_advanced_title
google_advanced_security_title
google_advanced_security_summary
google_advanced_security_search_terms
google_advanced_privacy_title
google_advanced_privacy_summary
google_advanced_privacy_search_terms
自定义要求
文件格式要求
配置文件必须是 XML 文件,并遵循更新配置文件中所述的格式。该文件必须位于 raw
文件夹中。它必须满足自定义安全中心信息来源和自定义安全中心信息来源群组中所述的不变量。如果配置文件的格式不符合上述要求,则系统会完全停用该功能。解析此文件还得到 CTS 和 GTS 测试的支持,这些测试可以在文件格式不正确的情况下提供额外的上下文(在 logcat 设备日志之上)。
Google 服务设备
在 GMS 设备上,系统会对此文件施加一些限制。GTS 测试支持此功能。
AOSP 设备
在 AOSP 设备上,配置文件的格式必须正确,并通过安全中心的 CTS 测试。测试会验证文件的格式是否正确。GMS 设备还必须通过这些测试。