AssistantQueryRequest


public final class AssistantQueryRequest
extends EgressRequest<AssistantQueryResponse> implements Parcelable

java.lang.Object
   ↳ android.app.privatecompute.EgressRequest<android.app.privatecompute.AssistantQueryResponse>
     ↳ android.app.privatecompute.AssistantQueryRequest


Request object specifically for Assistant Query Egress operations. Binds this request to the AssistantQueryResponse type.

These requests are subject to system validations, rate limits, and user consent. If the non-PCC process does not return the response in a reasonable timeframe, the platform will unbind from the non-PCC process and return PccEgressException.ERROR_NO_RESPONSE_FROM_EGRESS_SERVICE via the callback.

A request is considered invalid and will cause PccSandboxManager.egressData to throw IllegalArgumentException synchronously if:

  • The request or its Query payload is null.
  • The Query.getSessionId() or Query.getQueryString() is null.
  • The session ID has already been used (reused/replayed).
  • The query string size exceeds the maximum allowed limit (10 KB).
  • The calling package does not contain the user-chosen default Assistant.

A request will cause PccSandboxManager.egressData to throw IllegalStateException synchronously if:

  • The user has not consented to egress for the Assistant service.
  • The egress rate limit has been exceeded. The system enforces two limits:
    • A maximum of 100 successful egress calls in a rolling 24-hour window.
    • A maximum of 200 total egress attempts in a rolling 24-hour window.

Summary

Nested classes

class AssistantQueryRequest.Builder

Builder for AssistantQueryRequest

class AssistantQueryRequest.Query

Payload containing the raw query details to be routed to the non-PCC assistant process. 

Inherited constants

Fields

public static final Creator<AssistantQueryRequest> CREATOR

Creator for AssistantQueryRequest instance.

Inherited fields

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

AssistantQueryRequest.Query getQuery()

Returns the query payload associated with this request.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Fields

CREATOR

Added in API level 10000
public static final Creator<AssistantQueryRequest> CREATOR

Creator for AssistantQueryRequest instance.

Public methods

describeContents

Added in API level 10000
public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getQuery

Added in API level 10000
public AssistantQueryRequest.Query getQuery ()

Returns the query payload associated with this request.

Returns
AssistantQueryRequest.Query The Query payload.
This value cannot be null.

writeToParcel

Added in API level 10000
public void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following: