Safety Center Overview

This page describes the security and privacy settings in Android and how to access the settings (including the structure, integration, and customization) through Safety Center.

Starting in Android 13, Safety Center combines security and privacy items into a single page called Security & privacy. Safety Center is also accessible from a Quick Settings tile .

Safety Center provides redirection entries so that users can access specific security and privacy settings. Safety Center also identifies issues that users can fix on their devices or accounts, by combining dynamic data received from multiple sources. This data provides users with a general safety status with specific recommendations.

Security & privacy settings Security & privacy settings

Figure 1. Safety Center screen.

Integration requirements and guidelines

  • Android 13 and Mainline M-2022-11 or higher
  • Android framework configuration file to enable Safety Center:
  • Server-side requirements (Android 13 only):

    • The DeviceConfig flag safety_center_is_enabled is set to true (default true from Android 14).

Guidelines

  • GMS OEMs who aren't implementing Safety Center can opt out by setting the config.xml file’s overlayable config_enableSafetyCenter field to false (the default is true). For additional information, see Enable or disable Safety Center.
  • To avoid a bug in the lockscreen integration in Android 13, see About PendingIntent and PendingIntent workaround. No need to do this in Android 14 or Android 13 QPR, as the issue has been fixed.

Integrate with Safety Center

  1. Enable Safety Center on your device.
  2. (Optional) Modify Safety Center configuration file to change how data is provided. See Update the configuration file. Changes to the configuration file must meet customization requirements and must be tested with a GTS test that imposes strict constraints on modifications.
  3. (Optional) Modify your Settings app to add or change the Security & privacy entry.
  4. Add or change support for the safety sources to ensure that Safety Center works with signals such as the lock screen or biometrics (if supported). This might require some changes in the Settings app to implement this correctly. For example, changing the Settings package name in the configuration file to the appropriate one, and using the Safety Center source APIs in your Settings app.
  5. (Optional) Customize the Safety Center UI by overlaying themes, padding, and other features.
  6. Run and pass the associated GTS and CTS tests.
  7. In 13, ensure that you submitted device fingerprints for server-side allowlisting. No need to do this in 14.

Safety Center sources

A Safety Center source provides data to the Safety Center. A source is generally owned by a separate app on the device. Currently only system apps are allowed safety sources. Third-party apps aren't safety sources.

Here are some example Safety Center sources:

  • Lock screen
  • Biometrics
  • Security updates
  • Find My Device
  • Google Play Protect
  • Google Account Security Checkup
  • Privacy signals

A Safety Center source can provide these types of data:

  • An entry in the Safety Center UI to redirect the user to another screen. This entry has a status representing whether the user is at risk along with additional metadata associated with the status, for example, title and summary.
  • Warning cards (also called issues) that can be resolved directly from Safety Center or by redirecting a user to another screen. Each issue also has additional metadata associated with it such as the title, summary, button labels, and actions.
  • Potential errors that occurred when trying to provide data to Safety Center.
  • The reason a source is sending data to Safety Center.

Configuration file

Safety Center sources are listed in a configuration file that acts as an allowlist. This file also provides default data for each UI entry. The configuration file can specify static redirection entries that can't affect the Safety Center status or issues (also called static safety sources). For more information, see Update the configuration file.

Mainline module

Safety Center is primarily part of the PermissionController Mainline module, so Google can update this feature as part of a Mainline update for GMS OEM devices that support Mainline.

Non-GMS OEM devices and GMS OEM devices that don't support Mainline can use Safety Center if this feature is included in their system image; however they should use the code from M-2022-11 or higher. See Enable or disable Safety Center for requirements.

Safety Center APIs

Safety Center APIs are written in Java and the code samples on this page are written in Java. However, because Kotlin is interoperable with Java, the Safety Center APIs are usable in Kotlin. Several parts of the PermissionController system app that interact with Safety Center are written in Kotlin.

You can use APIs to interact with Safety Center. These APIs are primarily accessible through SafetyCenterManager, which is a System API. For more information, see Interact with Safety Center.

Intent actions and extras

Starting in Android 13, a public intent action (accessible by third-party apps) is defined in the Intent class to redirect to Safety Center.

Additional actions and extras are defined in SafetyCenterManager and are accessible only by system apps to allow, for example, redirecting to a specific issue.

Safety Center enabled API

SafetyCenterManager exposes an API that returns whether the Safety Center is enabled on the device. The API confirms whether the device meets Safety Center requirements such as whether the device has the right Mainline module version installed. This verification is used to determine whether Safety Center is shown in Settings and other places. This can also be used to determine whether data should be provided to Safety Center. For information on how to turn Safety Center on or off, see Enabling or disabling Safety Center.

Safety Center source APIs

Safety Center sources use Safety Center source APIs to provide dynamic data to Safety Center. Safety Center source APIs perform the following functions:

  • Set the data for a given Safety Center source.
  • Get the latest data set for a given Safety Center source.
  • Report an error for a given Safety Center source.

Safety Center sources can opt in to receive a signal to send data to Safety Center on special occasions, for example, when the Safety Center page is opened, to ensure that the data provided is up to date.

Internal Safety Center APIs

Some Safety Center APIs are internal and used only by the PermissionController Mainline module except for shell and tests. For technical reasons, these APIs aren't hidden and are exposed by SafetyCenterManager.

Safety Center APIs perform the following functions:

  • Send a signal to Safety Center sources to refresh their data.
  • Get a representation of the configuration file.
  • Get merged data from multiple Safety Center sources.
  • Subscribe and unsubscribe to data changes.
  • Dismiss warning cards.
  • Execute a warning card action.

Test APIs

SafetyCenterManager includes Safety Center test APIs that are used for testing.

Safety Center test APIs can:

  • Clear all data stored by Safety Center.
  • Override the configuration file and clearing the override.

Shell commands

Some shell commands are provided to interact with Safety Center through Android Debug Bridge Shell (adb shell). Use adb shell cmd safety_center help to see the list of commands and what they can do.

Safety Center user interface

The Safety Center user interface is defined in the PermissionController system app inside the PermissionController module. The UI is composed of an activity and several fragments that make use of the APIs described in Internal Safety Center APIs. The Quick Settings tile exposed by Safety Center uses the same UI components with some minor changes to how things are laid out.

The look and feel of this page can be changed using overlays. For additional information, see Customizing Safety Center UI.