共用方式為


DevicePolicyManager.RetrieveSecurityLogs(ComponentName) Method

Definition

Called by device owner or profile owner of an organization-owned managed profile to retrieve all new security logging entries since the last call to this API after device boots.

[Android.Runtime.Register("retrieveSecurityLogs", "(Landroid/content/ComponentName;)Ljava/util/List;", "GetRetrieveSecurityLogs_Landroid_content_ComponentName_Handler", ApiSince=24)]
[Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_SECURITY_LOGGING")]
public virtual System.Collections.Generic.IList<Android.App.Admin.SecurityLog.SecurityEvent>? RetrieveSecurityLogs (Android.Content.ComponentName? admin);
[<Android.Runtime.Register("retrieveSecurityLogs", "(Landroid/content/ComponentName;)Ljava/util/List;", "GetRetrieveSecurityLogs_Landroid_content_ComponentName_Handler", ApiSince=24)>]
[<Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_SECURITY_LOGGING")>]
abstract member RetrieveSecurityLogs : Android.Content.ComponentName -> System.Collections.Generic.IList<Android.App.Admin.SecurityLog.SecurityEvent>
override this.RetrieveSecurityLogs : Android.Content.ComponentName -> System.Collections.Generic.IList<Android.App.Admin.SecurityLog.SecurityEvent>

Parameters

admin
ComponentName

Which device admin this request is associated with, or null if called by a delegated app.

Returns

the new batch of security logs which is a list of SecurityEvent, or null if rate limitation is exceeded or if logging is currently disabled.

Attributes

Remarks

Called by device owner or profile owner of an organization-owned managed profile to retrieve all new security logging entries since the last call to this API after device boots.

Access to the logs is rate limited and it will only return new logs after the admin has been notified via DeviceAdminReceiver#onSecurityLogsAvailable.

When called by a device owner, if there is any other user or profile on the device, it must be affiliated with the device. Otherwise a SecurityException will be thrown. See #isAffiliatedUser.

Java documentation for android.app.admin.DevicePolicyManager.retrieveSecurityLogs(android.content.ComponentName).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to