The Developer Preview for Android 11 is now available; test it out and share your feedback.

DevicePolicyKeyguardService

public class DevicePolicyKeyguardService
extends Service

java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.Service
         ↳ android.app.admin.DevicePolicyKeyguardService


Client interface for providing the SystemUI with secondary lockscreen information.

An implementation must be provided by the device admin app when DevicePolicyManager#setSecondaryLockscreenEnabled is set to true and the service must be declared in the manifest as handling the action DevicePolicyManager#ACTION_BIND_SECONDARY_LOCKSCREEN_SERVICE, otherwise the keyguard will fail to bind to the service and continue to unlock.

Summary

Inherited constants

Public constructors

DevicePolicyKeyguardService()

Public methods

void dismiss()

Signals to keyguard that the secondary lock screen is ready to be dismissed.

final IBinder onBind(Intent intent)

Return the communication channel to the service.

SurfaceControl onSurfaceReady(IBinder hostInputToken)

Called by keyguard once the host surface for the secondary lockscreen is ready to display remote content.

Inherited methods

Public constructors

DevicePolicyKeyguardService

public DevicePolicyKeyguardService ()

Public methods

dismiss

public void dismiss ()

Signals to keyguard that the secondary lock screen is ready to be dismissed.

Returns
void This value may be null.

onBind

public final IBinder onBind (Intent intent)

Return the communication channel to the service. May return null if clients can not bind to the service. The returned IBinder is usually for a complex interface that has been described using aidl.

Note that unlike other application components, calls on to the IBinder interface returned here may not happen on the main thread of the process. More information about the main thread can be found in Processes and Threads.

Parameters
intent Intent: This value may be null.

Returns
IBinder This value may be null.

onSurfaceReady

public SurfaceControl onSurfaceReady (IBinder hostInputToken)

Called by keyguard once the host surface for the secondary lockscreen is ready to display remote content.

Parameters
hostInputToken IBinder: This value may be null.

Returns
SurfaceControl the SurfaceControl for the Surface the secondary lockscreen content is attached to. This value may be null.