# PermissionInfoCompat

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

*** ** * ** ***


```
public final class PermissionInfoCompat
```

<br />

*** ** * ** ***

Helper for accessing features in `https://developer.android.com/reference/android/content/pm/PermissionInfo.html`.

## Summary

| ### Public methods |
|---|---|
| `static int` | `https://developer.android.com/reference/androidx/core/content/pm/PermissionInfoCompat#getProtection(android.content.pm.PermissionInfo)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/pm/PermissionInfo.html permissionInfo)` Return the base permission type of a `https://developer.android.com/reference/android/content/pm/PermissionInfo.html`. |
| `static int` | `https://developer.android.com/reference/androidx/core/content/pm/PermissionInfoCompat#getProtectionFlags(android.content.pm.PermissionInfo)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/pm/PermissionInfo.html permissionInfo)` Return the additional protection flags of a `https://developer.android.com/reference/android/content/pm/PermissionInfo.html`. |

## Public methods

### getProtection

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

```
public static int getProtection(@NonNull PermissionInfo permissionInfo)
```

Return the base permission type of a `https://developer.android.com/reference/android/content/pm/PermissionInfo.html`.

Value is one of the following:

- `PermissionInfo.PROTECTION_NORMAL`
- `PermissionInfo.PROTECTION_DANGEROUS`
- `PermissionInfo.PROTECTION_SIGNATURE`
- `PermissionInfo.PROTECTION_SIGNATURE_OR_SYSTEM`

<br />

### getProtectionFlags

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

```
public static int getProtectionFlags(@NonNull PermissionInfo permissionInfo)
```

Return the additional protection flags of a `https://developer.android.com/reference/android/content/pm/PermissionInfo.html`.

Value is either `0` or a combination of the following:

- `PermissionInfo.PROTECTION_FLAG_PRIVILEGED`
- `PermissionInfo.PROTECTION_FLAG_SYSTEM`
- `PermissionInfo.PROTECTION_FLAG_DEVELOPMENT`
- `PermissionInfo.PROTECTION_FLAG_APPOP`
- `PermissionInfo.PROTECTION_FLAG_PRE23`
- `PermissionInfo.PROTECTION_FLAG_INSTALLER`
- `PermissionInfo.PROTECTION_FLAG_VERIFIER`
- `PermissionInfo.PROTECTION_FLAG_PREINSTALLED`
- `PermissionInfo.PROTECTION_FLAG_SETUP`
- `PermissionInfo.PROTECTION_FLAG_INSTANT`
- `PermissionInfo.PROTECTION_FLAG_RUNTIME_ONLY`

<br />