AI-generated Key Takeaways
-
The
AppSearchOptions.Builderclass is used to construct instances ofAppSearchOptions. -
You can build the configured object using the
build()method. -
The
setWorkerExecutor()method allows you to specify anExecutorfor dispatching listener events and callbacks, overriding the default main thread usage. -
The specified
ExecutorforsetWorkerExecutoris only effective on Android P (API Level 29) and above.
Builder to construct instances of AppSearchOptions.
Public Constructor Summary
|
Builder()
|
Public Method Summary
| AppSearchOptions |
build()
Build the configured object.
|
| AppSearchOptions.Builder |
setWorkerExecutor(Executor
workerExecutor)
Sets a workerExecutor used to dispatch listener events and callbacks for
ServiceConnection,
otherwise the main thread is used by default.
|
Inherited Method Summary
Public Constructors
public Builder ()
Public Methods
public AppSearchOptions build ()
Build the configured object.
public AppSearchOptions.Builder setWorkerExecutor (Executor workerExecutor)
Sets a workerExecutor used to dispatch listener events and callbacks for
ServiceConnection,
otherwise the main thread is used by default. We use the same Executor
for
Task.addOnCompleteListener(Activity, OnCompleteListener) for all APIs.
NOTE: The Executor
is only effective for Android P (API Level 29) and above. Pre-P devices will deadlock
if they attempt to make blocking AppSearch API calls from the main thread as the same
thread is used by default for connection callbacks.
Returns
- the same Builder instance.