Added in API level 37

PccTarget


class PccTarget : OperationTarget
kotlin.Any
   ↳ android.os.storage.operations.targets.OperationTarget
   ↳ android.os.storage.operations.targets.PccTarget

A target representing the calling application's Private Compute Core (PCC) data directory.

Files directed to this target will be securely stored within the PCC component of the application. The optional path prefix can be used to organize files into subdirectories within the PCC storage area.

Example Usage:

<code>// Create a target that places files in a "processed_results" subdirectory within PCC
  PccTarget target = new PccTarget("processed_results/daily_logs");
 
  // If a file named "report.dat" is sent to this target, it will be stored at:
  // [PCC_ROOT]/processed_results/daily_logs/report.dat
  </code>

Prefix Requirements:

  • Must be relative: Absolute paths are rejected to prevent escaping the PCC root directory.
  • No Path Traversal: The prefix cannot contain ".." or "." segments that resolve to parent or current directories.
  • No Control Characters: Invisible or control characters (e.g., null, newline, surrogates) are prohibited for security.

Summary

Public constructors

Creates a new PCC target with no path prefix.

PccTarget(pathPrefix: String)

Creates a new PCC target with the specified path prefix.

Public methods
String

Returns a string representation of this target for debugging.

Public constructors

PccTarget

Added in API level 37
PccTarget()

Creates a new PCC target with no path prefix.

PccTarget

Added in API level 37
PccTarget(pathPrefix: String)

Creates a new PCC target with the specified path prefix.

Parameters
pathPrefix String: The prefix to be added to the destination path of files.
This value cannot be null.

Public methods

toString

Added in API level 37
fun toString(): String

Returns a string representation of this target for debugging.

Return
String A string containing the target type and prefix.
This value cannot be null.