AppSearchAccount
public
final
class
AppSearchAccount
extends GenericDocument
| java.lang.Object | ||
| ↳ | android.app.appsearch.GenericDocument | |
| ↳ | android.app.appsearch.AppSearchAccount | |
Encapsulates a GenericDocument representing an Account.
In AppSearch, an Account is used to partition data and manage its lifecycle. By associating
indexed documents with an AppSearchAccount, the system can perform automated wipeout
documents when an account is removed from the device.
This class provides a standardized way for AppSearch to recognize which data belongs to which user identity in multi-login or synced environments.
This class is a higher level implement of GenericDocument.
Summary
Nested classes | |
|---|---|
class |
AppSearchAccount.Builder
The builder class for |
Constants | |
|---|---|
String |
SCHEMA_TYPE
The name of the schema type for |
Fields | |
|---|---|
public
static
final
AppSearchSchema |
SCHEMA
|
Public constructors | |
|---|---|
AppSearchAccount(GenericDocument document)
Creates a new |
|
Public methods | |
|---|---|
String
|
getAccountId()
Gets the account id of |
String
|
getAccountName()
Gets the name of |
String
|
getAccountType()
Gets the type of |
Inherited methods | |
|---|---|
Constants
SCHEMA_TYPE
public static final String SCHEMA_TYPE
The name of the schema type for AppSearchAccount documents.
Constant Value: "builtin:Account"
Fields
Public constructors
AppSearchAccount
public AppSearchAccount (GenericDocument document)
Creates a new AppSearchAccount from the contents of an existing GenericDocument.
| Parameters | |
|---|---|
document |
GenericDocument: The GenericDocument containing the Account content.
This value cannot be null. |
Public methods
getAccountId
public String getAccountId ()
Gets the account id of AppSearchAccount or null if it's not been set yet.
| Returns | |
|---|---|
String |
|
getAccountName
public String getAccountName ()
Gets the name of AppSearchAccount or null if it's not been set yet.
| Returns | |
|---|---|
String |
|
getAccountType
public String getAccountType ()
Gets the type of AppSearchAccount or null if it's not been set yet.
| Returns | |
|---|---|
String |
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-03-26 UTC.