# PlatformStorage

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

*** ** * ** ***

<br />

```
@RequiresApi(value = Build.VERSION_CODES.S)
public final class PlatformStorage
```

<br />

*** ** * ** ***

An AppSearch storage system which stores data in the central AppSearch service, available on Android S+.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/appsearch/platformstorage/PlatformStorage.GlobalSearchContext` Contains information relevant to creating a global search session. |
| `public final class https://developer.android.com/reference/androidx/appsearch/platformstorage/PlatformStorage.GlobalSearchContext.Builder` Builder for `https://developer.android.com/reference/androidx/appsearch/platformstorage/PlatformStorage.GlobalSearchContext` objects. |
| `public final class https://developer.android.com/reference/androidx/appsearch/platformstorage/PlatformStorage.SearchContext` Contains information about how to create the search session. |
| `public final class https://developer.android.com/reference/androidx/appsearch/platformstorage/PlatformStorage.SearchContext.Builder` Builder for `https://developer.android.com/reference/androidx/appsearch/platformstorage/PlatformStorage.SearchContext` objects. |

| ### Public methods |
|---|---|
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<https://developer.android.com/reference/androidx/appsearch/app/EnterpriseGlobalSearchSession>` | `@https://developer.android.com/reference/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/androidx/appsearch/app/Features.ENTERPRISE_GLOBAL_SEARCH_SESSION) @https://developer.android.com/reference/androidx/annotation/RequiresApi(value = https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#TIRAMISU) https://developer.android.com/reference/androidx/appsearch/platformstorage/PlatformStorage#createEnterpriseGlobalSearchSessionAsync(androidx.appsearch.platformstorage.PlatformStorage.GlobalSearchContext)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/platformstorage/PlatformStorage.GlobalSearchContext context )` Opens a new `https://developer.android.com/reference/androidx/appsearch/app/EnterpriseGlobalSearchSession` on this storage. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<https://developer.android.com/reference/androidx/appsearch/app/GlobalSearchSession>` | `https://developer.android.com/reference/androidx/appsearch/platformstorage/PlatformStorage#createGlobalSearchSessionAsync(androidx.appsearch.platformstorage.PlatformStorage.GlobalSearchContext)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/platformstorage/PlatformStorage.GlobalSearchContext context )` Opens a new `https://developer.android.com/reference/androidx/appsearch/app/GlobalSearchSession` on this storage. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<https://developer.android.com/reference/androidx/appsearch/app/AppSearchSession>` | `https://developer.android.com/reference/androidx/appsearch/platformstorage/PlatformStorage#createSearchSessionAsync(androidx.appsearch.platformstorage.PlatformStorage.SearchContext)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/platformstorage/PlatformStorage.SearchContext context)` Opens a new `https://developer.android.com/reference/androidx/appsearch/app/AppSearchSession` on this storage. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/app/Features` | `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi https://developer.android.com/reference/androidx/appsearch/platformstorage/PlatformStorage#getFeatures(android.content.Context)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context)` Returns the `https://developer.android.com/reference/androidx/appsearch/app/Features` to check for the availability of certain features for this AppSearch storage. |

## Public methods

### createEnterpriseGlobalSearchSessionAsync

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

```
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ENTERPRISE_GLOBAL_SEARCH_SESSION)
@RequiresApi(value = Build.VERSION_CODES.TIRAMISU)
public static @NonNull ListenableFuture<EnterpriseGlobalSearchSession> createEnterpriseGlobalSearchSessionAsync(
    @NonNull PlatformStorage.GlobalSearchContext context
)
```

Opens a new `https://developer.android.com/reference/androidx/appsearch/app/EnterpriseGlobalSearchSession` on this storage.

### createGlobalSearchSessionAsync

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

```
public static @NonNull ListenableFuture<GlobalSearchSession> createGlobalSearchSessionAsync(
    @NonNull PlatformStorage.GlobalSearchContext context
)
```

Opens a new `https://developer.android.com/reference/androidx/appsearch/app/GlobalSearchSession` on this storage.

### createSearchSessionAsync

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

```
public static @NonNull ListenableFuture<AppSearchSession> createSearchSessionAsync(@NonNull PlatformStorage.SearchContext context)
```

Opens a new `https://developer.android.com/reference/androidx/appsearch/app/AppSearchSession` on this storage.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/platformstorage/PlatformStorage.SearchContext context` | The `https://developer.android.com/reference/androidx/appsearch/platformstorage/PlatformStorage.SearchContext` contains all information to create a new `https://developer.android.com/reference/androidx/appsearch/app/AppSearchSession` |

### getFeatures

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

```
@ExperimentalAppSearchApi
public static @NonNull Features getFeatures(@NonNull Context context)
```

Returns the `https://developer.android.com/reference/androidx/appsearch/app/Features` to check for the availability of certain features for this AppSearch storage.