DataMigrationToPccService


public abstract class DataMigrationToPccService
extends Service

java.lang.Object
   ↳ 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 ERROR(/#onMigrationRequested()). The service must require the caller to hold the ERROR(/android.permission.BIND_DATA_MIGRATION_FOR_PRIVATECOMPUTE) permission.

Summary

Constants

long MIGRATION_TIMEOUT_MS

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

String SERVICE_INTERFACE

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

Inherited constants

Public constructors

DataMigrationToPccService()

Public methods

final IBinder onBind(Intent intent)

Return the communication channel to the service.

abstract void onMigrationRequested(Consumer<MigrationRequestResult> callback)

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

Inherited methods

Constants

MIGRATION_TIMEOUT_MS

Added in API level 37
public static final long MIGRATION_TIMEOUT_MS

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

Constant Value: 60000 (0x000000000000ea60)

SERVICE_INTERFACE

Added in API level 37
public static final String SERVICE_INTERFACE

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

Constant Value: "android.app.privatecompute.DataMigrationToPccService"

Public constructors

DataMigrationToPccService

public DataMigrationToPccService ()

Public methods

onBind

Added in API level 37
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.

onMigrationRequested

Added in API level 37
public abstract void onMigrationRequested (Consumer<MigrationRequestResult> callback)

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

Parameters
callback Consumer: 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.