# InputContentInfoCompat

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/view/inputmethod/InputContentInfoCompat.java+class:androidx.core.view.inputmethod.InputContentInfoCompat) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***


```
public final class InputContentInfoCompat
```

<br />

*** ** * ** ***

Helper for accessing features in InputContentInfo introduced after API level 13 in a backwards compatible fashion.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/core/view/inputmethod/InputContentInfoCompat#InputContentInfoCompat(android.net.Uri,android.content.ClipDescription,android.net.Uri)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html contentUri, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/ClipDescription.html description, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/net/Uri.html linkUri )` Constructs `https://developer.android.com/reference/androidx/core/view/inputmethod/InputContentInfoCompat`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html` | `https://developer.android.com/reference/androidx/core/view/inputmethod/InputContentInfoCompat#getContentUri()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/ClipDescription.html` | `https://developer.android.com/reference/androidx/core/view/inputmethod/InputContentInfoCompat#getDescription()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/net/Uri.html` | `https://developer.android.com/reference/androidx/core/view/inputmethod/InputContentInfoCompat#getLinkUri()()` |
| `void` | `https://developer.android.com/reference/androidx/core/view/inputmethod/InputContentInfoCompat#releasePermission()()` Releases a temporary read-only access permission for content URI associated with this object. |
| `void` | `https://developer.android.com/reference/androidx/core/view/inputmethod/InputContentInfoCompat#requestPermission()()` Requests a temporary read-only access permission for content URI associated with this object. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` | `https://developer.android.com/reference/androidx/core/view/inputmethod/InputContentInfoCompat#unwrap()()` Gets the underlying framework android.view.inputmethod.InputContentInfo object. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/inputmethod/InputContentInfoCompat` | `https://developer.android.com/reference/androidx/core/view/inputmethod/InputContentInfoCompat#wrap(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html inputContentInfo)` Creates an instance from a framework android.view.inputmethod.InputContentInfo object. |

## Public constructors

### InputContentInfoCompat

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

```
public InputContentInfoCompat(
    @NonNull Uri contentUri,
    @NonNull ClipDescription description,
    @Nullable Uri linkUri
)
```

Constructs `https://developer.android.com/reference/androidx/core/view/inputmethod/InputContentInfoCompat`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html contentUri` | content URI to be exported from the input method. This cannot be `null`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/ClipDescription.html description` | a `https://developer.android.com/reference/android/content/ClipDescription.html` object that contains the metadata of `contentUri` such as MIME type(s). This object cannot be `null`. Also `https://developer.android.com/reference/android/content/ClipDescription.html#getLabel()` should be describing the content specified by `contentUri` for accessibility reasons. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/net/Uri.html linkUri` | an optional `http` or `https` URI. The editor author may provide a way to navigate the user to the specified web page if this is not `null`. |

## Public methods

### getContentUri

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

```
public @NonNull Uri getContentUri()
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html` | content URI with which the content can be obtained. |

### getDescription

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

```
public @NonNull ClipDescription getDescription()
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/ClipDescription.html` | `https://developer.android.com/reference/android/content/ClipDescription.html` object that contains the metadata of `#getContentUri()` such as MIME type(s). `https://developer.android.com/reference/android/content/ClipDescription.html#getLabel()` can be used for accessibility purpose. |

### getLinkUri

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

```
public @Nullable Uri getLinkUri()
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/net/Uri.html` | an optional `http` or `https` URI that is related to this content. |

### releasePermission

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

```
public void releasePermission()
```

Releases a temporary read-only access permission for content URI associated with this object.

Does nothing if the temporary permission is not granted.

### requestPermission

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

```
public void requestPermission()
```

Requests a temporary read-only access permission for content URI associated with this object.

The lifecycle of the permission granted here is tied to this object instance. If the permission is not released explicitly via `https://developer.android.com/reference/androidx/core/view/inputmethod/InputContentInfoCompat#releasePermission()`, it will be released automatically when there are no more references to this object.

Does nothing if the temporary permission is already granted.

### unwrap

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

```
public @Nullable Object unwrap()
```

Gets the underlying framework android.view.inputmethod.InputContentInfo object.

This method always returns `null` on API \<= 24.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` | an equivalent android.view.inputmethod.InputContentInfo object, or `null` if not supported. |

### wrap

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

```
public static @Nullable InputContentInfoCompat wrap(@Nullable Object inputContentInfo)
```

Creates an instance from a framework android.view.inputmethod.InputContentInfo object.

This method always returns `null` on API \<= 24.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html inputContentInfo` | an android.view.inputmethod.InputContentInfo object, or `null` if none. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/inputmethod/InputContentInfoCompat` | an equivalent `https://developer.android.com/reference/androidx/core/view/inputmethod/InputContentInfoCompat` object, or `null` if not supported. |