Added in API level 37

DataMigrationToPccService


abstract class DataMigrationToPccService : Service
kotlin.Any
   ↳ android.content.Context
   ↳ android.content.ContextWrapper
   ↳ android.app.Service
   ↳ android.app.privatecompute.DataMigrationToPccService

Base class for a service that handles data migration to the Private Compute Core (PCC) storage of an application.

Applications with PCC components that need to migrate data to PCC storage should extend this class and implement #onMigrationRequested(). The service must require the caller to hold the android.permission.BIND_DATA_MIGRATION_FOR_PRIVATECOMPUTE permission.

Summary

Constants
static Long

The timeout in milliseconds for the migration service to complete its task.

static String

The Intent action that must be declared as handled by the service.

Inherited constants
Public constructors

Public methods
IBinder?
onBind(intent: Intent?)

Return the communication channel to the service.

abstract Unit

Called when the framework triggers a migration request on behalf of a PCC component.

Inherited functions

Constants

MIGRATION_TIMEOUT_MS

Added in API level 37
static val MIGRATION_TIMEOUT_MS: Long

The timeout in milliseconds for the migration service to complete its task. The system will unbind from the service after this timeout.

Value: 60000L

SERVICE_INTERFACE

Added in API level 37
static val SERVICE_INTERFACE: String

The Intent action that must be declared as handled by the service.

Value: "android.app.privatecompute.DataMigrationToPccService"

Public constructors

DataMigrationToPccService

DataMigrationToPccService()

Public methods

onBind

Added in API level 37
fun onBind(intent: Intent?): IBinder?

Return the communication channel to the service. May return null if clients can not bind to the service. The returned android.os.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.
Return
IBinder? This value may be null.

onMigrationRequested

Added in API level 37
abstract fun onMigrationRequested(callback: Consumer<MigrationRequestResult!>): Unit

Called when the framework triggers a migration request on behalf of a PCC component.

Parameters
callback Consumer<MigrationRequestResult!>: Use this to send a result back to the requesting PCC process and signal to the system whether migration has been accepted.
This value cannot be null.