# InputContentInfoCompat

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/view/inputmethod/InputContentInfoCompat "View this page in Java")

<br />

```
class InputContentInfoCompat
```

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                                                                                                                                                                                                                       ### Public constructors                                                                                                                                                                                                                                                                                                                       |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [InputContentInfoCompat](https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/InputContentInfoCompat#InputContentInfoCompat(android.net.Uri,android.content.ClipDescription,android.net.Uri))`(` ` contentUri: `[Uri](https://developer.android.com/reference/android/net/Uri.html)`,` ` description: `[ClipDescription](https://developer.android.com/reference/android/content/ClipDescription.html)`,` ` linkUri: `[Uri](https://developer.android.com/reference/android/net/Uri.html)`?` `)` Constructs[InputContentInfoCompat](https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/InputContentInfoCompat). |

|                                                              ### Public functions                                                               |
|-------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html)                                                                             | [getContentUri](https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/InputContentInfoCompat#getContentUri())`()`                                                                                                                                                                                      |
| [ClipDescription](https://developer.android.com/reference/android/content/ClipDescription.html)                                                 | [getDescription](https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/InputContentInfoCompat#getDescription())`()`                                                                                                                                                                                    |
| [Uri](https://developer.android.com/reference/android/net/Uri.html)`?`                                                                          | [getLinkUri](https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/InputContentInfoCompat#getLinkUri())`()`                                                                                                                                                                                            |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                   | [releasePermission](https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/InputContentInfoCompat#releasePermission())`()` Releases a temporary read-only access permission for content URI associated with this object.                                                                                |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                   | [requestPermission](https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/InputContentInfoCompat#requestPermission())`()` Requests a temporary read-only access permission for content URI associated with this object.                                                                                |
| [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?`                                                                  | [unwrap](https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/InputContentInfoCompat#unwrap())`()` Gets the underlying framework android.view.inputmethod.InputContentInfo object.                                                                                                                    |
| `java-static `[InputContentInfoCompat](https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/InputContentInfoCompat)`?` | [wrap](https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/InputContentInfoCompat#wrap(java.lang.Object))`(inputContentInfo: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` 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)  

```
InputContentInfoCompat(
    contentUri: Uri,
    description: ClipDescription,
    linkUri: Uri?
)
```

Constructs[InputContentInfoCompat](https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/InputContentInfoCompat).  

|                                                   Parameters                                                   |
|----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `contentUri: `[Uri](https://developer.android.com/reference/android/net/Uri.html)                              | content URI to be exported from the input method. This cannot be`null`.                                                                                                                                                                                                                                                                                                                       |
| `description: `[ClipDescription](https://developer.android.com/reference/android/content/ClipDescription.html) | a[ClipDescription](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[getLabel](https://developer.android.com/reference/android/content/ClipDescription.html#getLabel())should be describing the content specified by`contentUri`for accessibility reasons. |
| `linkUri: `[Uri](https://developer.android.com/reference/android/net/Uri.html)`?`                              | 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 functions

### getContentUri

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

```
fun getContentUri(): Uri
```  

|                               Returns                               |
|---------------------------------------------------------------------|-----------------------------------------------------|
| [Uri](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)  

```
fun getDescription(): ClipDescription
```  

|                                             Returns                                             |
|-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ClipDescription](https://developer.android.com/reference/android/content/ClipDescription.html) | [ClipDescription](https://developer.android.com/reference/android/content/ClipDescription.html)object that contains the metadata of`#getContentUri()`such as MIME type(s).[getLabel](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)  

```
fun getLinkUri(): Uri?
```  

|                                Returns                                 |
|------------------------------------------------------------------------|----------------------------------------------------------------|
| [Uri](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)  

```
fun releasePermission(): Unit
```

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)  

```
fun requestPermission(): Unit
```

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[releasePermission](https://developer.android.com/reference/kotlin/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)  

```
fun unwrap(): Any?
```

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

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

|                                    Returns                                     |
|--------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
| [Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.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)  

```
java-static fun wrap(inputContentInfo: Any?): InputContentInfoCompat?
```

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

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

|                                             Parameters                                             |
|----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| `inputContentInfo: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?` | an android.view.inputmethod.InputContentInfo object, or`null`if none. |

|                                                              Returns                                                              |
|-----------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [InputContentInfoCompat](https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/InputContentInfoCompat)`?` | an equivalent[InputContentInfoCompat](https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/InputContentInfoCompat)object, or`null`if not supported. |