Language

PccService.OnReceiveData(Bundle, String) Method

Definition

This method is the data ingress point for a PCC service.

[Android.Runtime.Register("onReceiveData", "(Landroid/os/Bundle;Ljava/lang/String;)V", "GetOnReceiveData_Landroid_os_Bundle_Ljava_lang_String_Handler", ApiSince=37)]
public abstract void OnReceiveData(Android.OS.Bundle data, string packageName);
[<Android.Runtime.Register("onReceiveData", "(Landroid/os/Bundle;Ljava/lang/String;)V", "GetOnReceiveData_Landroid_os_Bundle_Ljava_lang_String_Handler", ApiSince=37)>]
abstract member OnReceiveData : Android.OS.Bundle * string -> unit

Parameters

data
Bundle

A Bundle containing the data sent by the client.

packageName
String

The package name for the app that calls sendData.

Attributes

Remarks

This method is the data ingress point for a PCC service. When a client sends data via the sendData api, the service will receive that data in this endpoint and can process it.

The data Bundle is already sanitised by the system if sent from outside PCC sandbox. This sanitization process makes sure that any object to establish 2 way communication are not passed.

To enforce a strictly one-way data flow, if the caller isn't allowed two way communication with PCC components, the Bundle is sanitized to prevent objects that can be used to establish a two-way communication channel like IBinder, Messenger, etc.

Allowed data types are: Primitives and their arrays (e.g., int, char, boolean, String, byte[]); PersistableBundle; Read-only ParcelFileDescriptor; SharedMemory. If it has write access, it will be silently restricted to read-only; Bitmap; Custom Parcelable objects must be serialized as a byte []; Nested Bundle objects, which are recursively sanitized up to a depth of 100

Android reference for android.app.privatecompute.PccService.onReceiveData.

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