SecurityStateManagerCompat
open 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 |
|
|---|---|
const String |
The kernel version key returned as part of the {@code Bundle} from {@code getGlobalSecurityState}. |
const String |
The system SPL key returned as part of the {@code Bundle} from {@code getGlobalSecurityState}. |
const String |
The vendor SPL key returned as part of the {@code Bundle} from {@code getGlobalSecurityState}. |
Public constructors |
|---|
SecurityStateManagerCompat(context: Context) |
Public functions |
|
|---|---|
open Bundle |
getGlobalSecurityState(moduleMetadataProviderPackageName: String)Retrieves the global security state of the device, compiling various security patch levels and module information into a Bundle. |
Constants
KEY_KERNEL_VERSION
const val KEY_KERNEL_VERSION: String
The kernel version key returned as part of the {@code Bundle} from {@code getGlobalSecurityState}.
KEY_SYSTEM_SPL
const val KEY_SYSTEM_SPL: String
The system SPL key returned as part of the {@code Bundle} from {@code getGlobalSecurityState}.
KEY_VENDOR_SPL
const val KEY_VENDOR_SPL: String
The vendor SPL key returned as part of the {@code Bundle} from {@code getGlobalSecurityState}.
Public constructors
Public functions
getGlobalSecurityState
open fun getGlobalSecurityState(
moduleMetadataProviderPackageName: String = ANDROID_MODULE_METADATA_PROVIDER
): Bundle
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.
| Parameters | |
|---|---|
moduleMetadataProviderPackageName: String = ANDROID_MODULE_METADATA_PROVIDER |
Specifies package name for system modules metadata. |
| Returns | |
|---|---|
Bundle |
A Bundle containing keys and values representing the security state of the system, vendor, and kernel. |