GetSchemaResponse.Builder
  public
  static
  final
  
  class
  GetSchemaResponse.Builder
  
    extends Object
  
  
  
  
  
  
| java.lang.Object | |
| ↳ | android.app.appsearch.GetSchemaResponse.Builder | 
Builder for GetSchemaResponse objects.
Summary
| Public constructors | |
|---|---|
| 
      Builder()
      Creates a new  | |
| 
      Builder(GetSchemaResponse getSchemaResponse)
      Creates a new  | |
| Public methods | |
|---|---|
| 
        
        
        
        
        
        GetSchemaResponse.Builder | 
      addSchema(AppSearchSchema schema)
      Adds one  | 
| 
        
        
        
        
        
        GetSchemaResponse.Builder | 
      addSchemaTypeNotDisplayedBySystem(String schemaType)
      Sets whether or not documents from the provided  | 
| 
        
        
        
        
        
        GetSchemaResponse | 
      build()
      Builds a  | 
| 
        
        
        
        
        
        GetSchemaResponse.Builder | 
      clearPubliclyVisibleSchema(String schemaType)
      Clears the visibility setting that specifies that the given schema type should be publicly available to packages which already have visibility to a specified package. | 
| 
        
        
        
        
        
        GetSchemaResponse.Builder | 
      clearRequiredPermissionsForSchemaTypeVisibility(String schemaType)
      Clears the set of required  | 
| 
        
        
        
        
        
        GetSchemaResponse.Builder | 
      clearSchemaTypeNotDisplayedBySystem(String schemaType)
      Clears the visibility setting for the given schema type that prevents the schema from being displayed and visible on any system UI surface. | 
| 
        
        
        
        
        
        GetSchemaResponse.Builder | 
      clearSchemaTypeVisibleToConfigs(String schemaType)
      Clears the  | 
| 
        
        
        
        
        
        GetSchemaResponse.Builder | 
      clearSchemaTypeVisibleToPackages(String schemaType)
      Clears the set of packages that can read the given schema type. | 
| 
        
        
        
        
        
        GetSchemaResponse.Builder | 
      clearSchemas()
      Clears all  | 
| 
        
        
        
        
        
        GetSchemaResponse.Builder | 
      setPubliclyVisibleSchema(String schemaType, PackageIdentifier packageIdentifier)
      Specify that the schema should be publicly available, to packages which already have
 visibility to  | 
| 
        
        
        
        
        
        GetSchemaResponse.Builder | 
      setRequiredPermissionsForSchemaTypeVisibility(String schemaType, Set<Set<Integer>> visibleToPermissionSets)
      Sets a set of required  | 
| 
        
        
        
        
        
        GetSchemaResponse.Builder | 
      setSchemaTypeVisibleToConfigs(String schemaType, Set<SchemaVisibilityConfig> visibleToConfigs)
      Sets the documents from the provided  | 
| 
        
        
        
        
        
        GetSchemaResponse.Builder | 
      setSchemaTypeVisibleToPackages(String schemaType, Set<PackageIdentifier> packageIdentifiers)
      Sets whether or not documents from the provided  | 
| 
        
        
        
        
        
        GetSchemaResponse.Builder | 
      setVersion(int version)
      Sets the database overall schema version. | 
| Inherited methods | |
|---|---|
Public constructors
Builder
public Builder (GetSchemaResponse getSchemaResponse)
Creates a new Builder from the given GetSchemaResponse.
| Parameters | |
|---|---|
| getSchemaResponse | GetSchemaResponse: This value cannot benull. | 
Public methods
addSchema
public GetSchemaResponse.Builder addSchema (AppSearchSchema schema)
Adds one AppSearchSchema to the schema list.
| Parameters | |
|---|---|
| schema | AppSearchSchema: This value cannot benull. | 
| Returns | |
|---|---|
| GetSchemaResponse.Builder | This value cannot be null. | 
addSchemaTypeNotDisplayedBySystem
public GetSchemaResponse.Builder addSchemaTypeNotDisplayedBySystem (String schemaType)
Sets whether or not documents from the provided schemaType will be displayed and
 visible on any system UI surface.
| Parameters | |
|---|---|
| schemaType | String: The name of anAppSearchSchemawithin the sameGetSchemaResponse, which won't be displayed by system.
 This value cannot benull. | 
| Returns | |
|---|---|
| GetSchemaResponse.Builder | This value cannot be null. | 
build
public GetSchemaResponse build ()
Builds a GetSchemaResponse object.
| Returns | |
|---|---|
| GetSchemaResponse | This value cannot be null. | 
clearPubliclyVisibleSchema
public GetSchemaResponse.Builder clearPubliclyVisibleSchema (String schemaType)
Clears the visibility setting that specifies that the given schema type should be publicly available to packages which already have visibility to a specified package.
| Parameters | |
|---|---|
| schemaType | String: This value cannot benull. | 
| Returns | |
|---|---|
| GetSchemaResponse.Builder | This value cannot be null. | 
clearRequiredPermissionsForSchemaTypeVisibility
public GetSchemaResponse.Builder clearRequiredPermissionsForSchemaTypeVisibility (String schemaType)
Clears the set of required Manifest.permission combinations to read the
 given schema type.
| Parameters | |
|---|---|
| schemaType | String: This value cannot benull. | 
| Returns | |
|---|---|
| GetSchemaResponse.Builder | This value cannot be null. | 
clearSchemaTypeNotDisplayedBySystem
public GetSchemaResponse.Builder clearSchemaTypeNotDisplayedBySystem (String schemaType)
Clears the visibility setting for the given schema type that prevents the schema from being displayed and visible on any system UI surface.
| Parameters | |
|---|---|
| schemaType | String: This value cannot benull. | 
| Returns | |
|---|---|
| GetSchemaResponse.Builder | This value cannot be null. | 
clearSchemaTypeVisibleToConfigs
public GetSchemaResponse.Builder clearSchemaTypeVisibleToConfigs (String schemaType)
Clears the SchemaVisibilityConfigs for the given schema type which allow
 visibility to the schema if the caller matches ALL visibility requirements of ANY SchemaVisibilityConfig.
| Parameters | |
|---|---|
| schemaType | String: This value cannot benull. | 
| Returns | |
|---|---|
| GetSchemaResponse.Builder | This value cannot be null. | 
clearSchemaTypeVisibleToPackages
public GetSchemaResponse.Builder clearSchemaTypeVisibleToPackages (String schemaType)
Clears the set of packages that can read the given schema type.
| Parameters | |
|---|---|
| schemaType | String: This value cannot benull. | 
| Returns | |
|---|---|
| GetSchemaResponse.Builder | This value cannot be null. | 
clearSchemas
public GetSchemaResponse.Builder clearSchemas ()
Clears all AppSearchSchemas from the list of schemas.
| Returns | |
|---|---|
| GetSchemaResponse.Builder | This value cannot be null. | 
setPubliclyVisibleSchema
public GetSchemaResponse.Builder setPubliclyVisibleSchema (String schemaType, PackageIdentifier packageIdentifier)
Specify that the schema should be publicly available, to packages which already have
 visibility to packageIdentifier.
| Parameters | |
|---|---|
| schemaType | String: the schema to make publicly accessible.
 This value cannot benull. | 
| packageIdentifier | PackageIdentifier: the package from which the document schema is from.
 This value cannot benull. | 
| Returns | |
|---|---|
| GetSchemaResponse.Builder | This value cannot be null. | 
setRequiredPermissionsForSchemaTypeVisibility
public GetSchemaResponse.Builder setRequiredPermissionsForSchemaTypeVisibility (String schemaType, Set<Set<Integer>> visibleToPermissionSets)
Sets a set of required Manifest.permission combinations to the given
 schema type.
 
The querier could read the GenericDocument objects under the schemaType if they holds ALL required permissions of ANY of the individual value sets.
 
For example, if the Map contains {{permissionA, PermissionB},
 {PermissionC, PermissionD}, {PermissionE}}.
 
- A querier holds both PermissionA and PermissionB has access.
- A querier holds both PermissionC and PermissionD has access.
- A querier holds only PermissionE has access.
- A querier holds both PermissionA and PermissionE has access.
- A querier holds only PermissionA doesn't have access.
- A querier holds both PermissionA and PermissionC doesn't have access.
| Parameters | |
|---|---|
| schemaType | String: The schema type to set visibility on.
 This value cannot benull. | 
| visibleToPermissionSets | Set: The Sets of Android permissions that will be required to
     access the given schema.
 Value isSetSchemaRequest.READ_SMS,SetSchemaRequest.READ_CALENDAR,SetSchemaRequest.READ_CONTACTS,SetSchemaRequest.READ_EXTERNAL_STORAGE,SetSchemaRequest.READ_HOME_APP_SEARCH_DATA,SetSchemaRequest.READ_ASSISTANT_APP_SEARCH_DATA, android.app.appsearch.SetSchemaRequest.ENTERPRISE_ACCESS, android.app.appsearch.SetSchemaRequest.MANAGED_PROFILE_CONTACTS_ACCESS, android.app.appsearch.SetSchemaRequest.EXECUTE_APP_FUNCTIONS, or android.app.appsearch.SetSchemaRequest.PACKAGE_USAGE_STATS
 This value cannot benull. | 
| Returns | |
|---|---|
| GetSchemaResponse.Builder | This value cannot be null. | 
setSchemaTypeVisibleToConfigs
public GetSchemaResponse.Builder setSchemaTypeVisibleToConfigs (String schemaType, Set<SchemaVisibilityConfig> visibleToConfigs)
Sets the documents from the provided schemaType can be read by the caller if they
 match the ALL visibility requirements set in SchemaVisibilityConfig.
 
The requirements in a SchemaVisibilityConfig is "AND" relationship. A caller
 must match ALL requirements to access the schema. For example, a caller must hold
 required permissions AND it is a specified package.
 
The querier could have access if they match ALL requirements in ANY of the given
 SchemaVisibilityConfigs
 
For example, if the Set contains {{PackageA and Permission1},
 {PackageB and Permission2}}.
 
- A querier from packageA could read if they holds Permission1.
- A querier from packageA could NOT read if they only holds Permission2 instead of Permission1.
- A querier from packageB could read if they holds Permission2.
- A querier from packageC could never read.
- A querier holds both PermissionA and PermissionE has access.
| Parameters | |
|---|---|
| schemaType | String: The schema type to set visibility on.
 This value cannot benull. | 
| visibleToConfigs | Set: TheSchemaVisibilityConfigs hold all requirements that a
     call must to match to access the schema.
 This value cannot benull. | 
| Returns | |
|---|---|
| GetSchemaResponse.Builder | This value cannot be null. | 
setSchemaTypeVisibleToPackages
public GetSchemaResponse.Builder setSchemaTypeVisibleToPackages (String schemaType, Set<PackageIdentifier> packageIdentifiers)
Sets whether or not documents from the provided schemaType can be read by the
 specified package.
 
Each package is represented by a PackageIdentifier, containing a package name
 and a byte array of type PackageManager.CERT_INPUT_SHA256.
 
To opt into one-way data sharing with another application, the developer will need to explicitly grant the other application\u2019s package name and certificate Read access to its data.
For two-way data sharing, both applications need to explicitly grant Read access to one another.
| Parameters | |
|---|---|
| schemaType | String: The schema type to set visibility on.
 This value cannot benull. | 
| packageIdentifiers | Set: Represents the package that has access to the given schema
     type.
 This value cannot benull. | 
| Returns | |
|---|---|
| GetSchemaResponse.Builder | This value cannot be null. | 
setVersion
public GetSchemaResponse.Builder setVersion (int version)
Sets the database overall schema version.
Default version is 0
| Parameters | |
|---|---|
| version | int: Value is 0 or greater | 
| Returns | |
|---|---|
| GetSchemaResponse.Builder | This value cannot be null. | 
