Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/provider/VoicemailContract#nestedclasses) \| [Constants](https://developer.android.com/reference/android/provider/VoicemailContract#constants) \| [Inherited Methods](https://developer.android.com/reference/android/provider/VoicemailContract#inhmethods)

# VoicemailContract

*** ** * ** ***

` public class VoicemailContract `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.provider.VoicemailContract |

<br />

*** ** * ** ***

The contract between the voicemail provider and applications. Contains definitions for the supported URIs and columns.

The content providers exposes two tables through this interface:

- Voicemails table: This stores the actual voicemail records. The columns and URIs for accessing this table are defined by the `https://developer.android.com/reference/android/provider/VoicemailContract.Voicemails` class.
- Status table: This provides a way for the voicemail source application to convey its current state to the system. The columns and URIS for accessing this table are defined by the `https://developer.android.com/reference/android/provider/VoicemailContract.Status` class.

The minimum permission needed to access this content provider is `https://developer.android.com/reference/android/Manifest.permission#ADD_VOICEMAIL` or carrier privileges (see `https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges()`).

Voicemails are inserted by what is called as a "voicemail source" application, which is responsible for syncing voicemail data between a remote server and the local voicemail content provider. "voicemail source" application should always set the `https://developer.android.com/reference/android/provider/VoicemailContract#PARAM_KEY_SOURCE_PACKAGE` in the URI to identify its package.

In addition to the `https://developer.android.com/reference/android/database/ContentObserver` notifications the voicemail provider also generates broadcast intents to notify change for applications that are not active and therefore cannot listen to ContentObserver notifications. Broadcast intents with following actions are generated:

- `https://developer.android.com/reference/android/provider/VoicemailContract#ACTION_NEW_VOICEMAIL` is generated for each new voicemail inserted.
- `https://developer.android.com/reference/android/content/Intent#ACTION_PROVIDER_CHANGED` is generated for any change made into the database, including new voicemail.

<br />

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/provider/VoicemailContract.Status` Defines fields exposed through the /status path of this content provider. |
| ` class` | `https://developer.android.com/reference/android/provider/VoicemailContract.Voicemails` Defines fields exposed through the /voicemail path of this content provider. |

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/VoicemailContract#ACTION_FETCH_VOICEMAIL` Broadcast intent to request a voicemail source to fetch voicemail content of a specific voicemail from the remote server. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/VoicemailContract#ACTION_NEW_VOICEMAIL` Broadcast intent when a new voicemail record is inserted. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/VoicemailContract#ACTION_SYNC_VOICEMAIL` Broadcast intent to request all voicemail sources to perform a sync with the remote server. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/VoicemailContract#AUTHORITY` The authority used by the voicemail provider. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/VoicemailContract#EXTRA_PHONE_ACCOUNT_HANDLE` Extra included in `https://developer.android.com/reference/android/provider/VoicemailContract#ACTION_SYNC_VOICEMAIL` broadcast intents to indicate which `https://developer.android.com/reference/android/telecom/PhoneAccountHandle` to sync. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/VoicemailContract#EXTRA_SELF_CHANGE` Extra included in `https://developer.android.com/reference/android/content/Intent#ACTION_PROVIDER_CHANGED` broadcast intents to indicate if the receiving package made this change. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/VoicemailContract#PARAM_KEY_SOURCE_PACKAGE` Parameter key used in the URI to specify the voicemail source package name. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### ACTION_FETCH_VOICEMAIL

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_FETCH_VOICEMAIL
```

Broadcast intent to request a voicemail source to fetch voicemail content of a specific voicemail from the remote server. The voicemail to fetch is specified by the data uri of the intent.

All voicemail sources are expected to handle this event. After storing the content the application should also set `https://developer.android.com/reference/android/provider/VoicemailContract.Voicemails#HAS_CONTENT` to 1;

<br />

Constant Value: "android.intent.action.FETCH_VOICEMAIL"

### ACTION_NEW_VOICEMAIL

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_NEW_VOICEMAIL
```

Broadcast intent when a new voicemail record is inserted.

<br />

Constant Value: "android.intent.action.NEW_VOICEMAIL"

### ACTION_SYNC_VOICEMAIL

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_SYNC_VOICEMAIL
```

Broadcast intent to request all voicemail sources to perform a sync with the remote server.

<br />

Constant Value: "android.provider.action.SYNC_VOICEMAIL"

### AUTHORITY

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String AUTHORITY
```

The authority used by the voicemail provider.

<br />

Constant Value: "com.android.voicemail"

### EXTRA_PHONE_ACCOUNT_HANDLE

Added in [API level 25](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_PHONE_ACCOUNT_HANDLE
```

Extra included in `https://developer.android.com/reference/android/provider/VoicemailContract#ACTION_SYNC_VOICEMAIL` broadcast intents to indicate which `https://developer.android.com/reference/android/telecom/PhoneAccountHandle` to sync.

<br />

Constant Value: "android.provider.extra.PHONE_ACCOUNT_HANDLE"

### EXTRA_SELF_CHANGE

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_SELF_CHANGE
```

Extra included in `https://developer.android.com/reference/android/content/Intent#ACTION_PROVIDER_CHANGED` broadcast intents to indicate if the receiving package made this change.

<br />

Constant Value: "com.android.voicemail.extra.SELF_CHANGE"

### PARAM_KEY_SOURCE_PACKAGE

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAM_KEY_SOURCE_PACKAGE
```

Parameter key used in the URI to specify the voicemail source package name.

This field must be set in all requests that originate from a voicemail source.

<br />

Constant Value: "source_package"