SecurityStateManagerCompat
public class SecurityStateManagerCompat
This class is a wrapper around AOSP android.os.SecurityStateManager service API added in SDK 35. Support for features on older SDKs is provided on a best effort basis.
Manages the retrieval and storage of security patch levels and module information for an Android device. This class provides methods to fetch the current security state of the system, including patch levels for the system, vendor, and kernel as well as module updates available through Android's update system.
It utilizes Android's PackageManager and other system services to retrieve detailed security-related information, which is crucial for maintaining the security integrity of the device.
Summary
Constants |
|
|---|---|
static final @NonNull String |
The kernel version key returned as part of the {@code Bundle} from {@code getGlobalSecurityState}. |
static final @NonNull String |
The system SPL key returned as part of the {@code Bundle} from {@code getGlobalSecurityState}. |
static final @NonNull String |
The system supplemental patches key returned as part of the {@code Bundle} from {@code getGlobalSecurityState}. |
static final @NonNull String |
The vendor SPL key returned as part of the {@code Bundle} from {@code getGlobalSecurityState}. |
static final @NonNull String |
The vendor supplemental patches key returned as part of the {@code Bundle} from {@code getGlobalSecurityState}. |
Public constructors |
|---|
SecurityStateManagerCompat( |
Public methods |
|
|---|---|
@NonNull Bundle |
getGlobalSecurityState(Retrieves the global security state of the device, compiling various security patch levels and module information into a Bundle. |
Constants
KEY_KERNEL_VERSION
public static final @NonNull String KEY_KERNEL_VERSION
The kernel version key returned as part of the {@code Bundle} from {@code getGlobalSecurityState}.
The value is a {@code String} representing the kernel version in "X.X.XX" format.
KEY_SYSTEM_SPL
public static final @NonNull String KEY_SYSTEM_SPL
The system SPL key returned as part of the {@code Bundle} from {@code getGlobalSecurityState}.
The value is a {@code String} representing the security patch level in "YYYY-MM-DD" format.
KEY_SYSTEM_SUPPLEMENTAL_PATCHES
public static final @NonNull String KEY_SYSTEM_SUPPLEMENTAL_PATCHES
The system supplemental patches key returned as part of the {@code Bundle} from {@code getGlobalSecurityState}.
The value is a {@code String[]} containing CVE IDs.
KEY_VENDOR_SPL
public static final @NonNull String KEY_VENDOR_SPL
The vendor SPL key returned as part of the {@code Bundle} from {@code getGlobalSecurityState}.
The value is a {@code String} representing the security patch level in "YYYY-MM-DD" format.
KEY_VENDOR_SUPPLEMENTAL_PATCHES
public static final @NonNull String KEY_VENDOR_SUPPLEMENTAL_PATCHES
The vendor supplemental patches key returned as part of the {@code Bundle} from {@code getGlobalSecurityState}.
The value is a {@code String[]} containing CVE IDs.
Public constructors
SecurityStateManagerCompat
public SecurityStateManagerCompat(
@NonNull Context context,
@NonNull String[] systemSupplementalPatchConfigFiles,
@NonNull String[] vendorSupplementalPatchConfigFiles
)
Public methods
getGlobalSecurityState
public @NonNull Bundle getGlobalSecurityState(
@NonNull String moduleMetadataProviderPackageName
)
Retrieves the global security state of the device, compiling various security patch levels and module information into a Bundle. This method can optionally use Google's module metadata providers to enhance the data returned.