# PlayServicesStorage.GlobalSearchContext

Artifact: [androidx.appsearch:appsearch-play-services-storage](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/playservicesstorage/PlayServicesStorage.java+class:androidx.appsearch.playservicesstorage.PlayServicesStorage.GlobalSearchContext) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
public final class PlayServicesStorage.GlobalSearchContext
```

<br />

*** ** * ** ***

Contains information relevant to creating a global search session.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage.GlobalSearchContext.Builder` Builder for `https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage.GlobalSearchContext` objects. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html` | `https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage.GlobalSearchContext#getContext()()` Returns the `https://developer.android.com/reference/android/content/Context.html` associated with the `https://developer.android.com/reference/androidx/appsearch/app/GlobalSearchSession` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/concurrent/Executor.html` | `https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage.GlobalSearchContext#getWorkerExecutor()()` Returns the worker executor associated with `https://developer.android.com/reference/androidx/appsearch/app/GlobalSearchSession`. |

## Public methods

### getContext

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public @NonNull Context getContext()
```

Returns the `https://developer.android.com/reference/android/content/Context.html` associated with the `https://developer.android.com/reference/androidx/appsearch/app/GlobalSearchSession`

### getWorkerExecutor

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public @NonNull Executor getWorkerExecutor()
```

Returns the worker executor associated with `https://developer.android.com/reference/androidx/appsearch/app/GlobalSearchSession`.

If an executor is not provided to `https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage.GlobalSearchContext.Builder`, the AppSearch default executor will be returned. You should never cast the executor to `https://developer.android.com/reference/java/util/concurrent/ExecutorService.html` and call `https://developer.android.com/reference/java/util/concurrent/ExecutorService.html#shutdownNow()`. It will cancel the futures it's returned. And since `https://developer.android.com/reference/java/util/concurrent/Executor.html#execute(java.lang.Runnable)` won't return anything, we will hang forever waiting for the execution.