Stay organized with collections
Save and categorize content based on your preferences.
VoicemailContract
open class VoicemailContract
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
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
Status
class.
The minimum permission needed to access this content provider is android.Manifest.permission#ADD_VOICEMAIL
or carrier privileges (see 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 PARAM_KEY_SOURCE_PACKAGE
in the URI to identify its package.
In addition to the 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:
Summary
Nested classes |
|
Defines fields exposed through the /status path of this content provider.
|
|
Defines fields exposed through the /voicemail path of this content provider.
|
Constants |
static String |
Broadcast intent to request a voicemail source to fetch voicemail content of a specific voicemail from the remote server.
|
static String |
Broadcast intent when a new voicemail record is inserted.
|
static String |
Broadcast intent to request all voicemail sources to perform a sync with the remote server.
|
static String |
The authority used by the voicemail provider.
|
static String |
Extra included in ACTION_SYNC_VOICEMAIL broadcast intents to indicate which PhoneAccountHandle to sync.
|
static String |
Extra included in Intent.ACTION_PROVIDER_CHANGED broadcast intents to indicate if the receiving package made this change.
|
static String |
Parameter key used in the URI to specify the voicemail source package name.
|
Constants
ACTION_FETCH_VOICEMAIL
static val ACTION_FETCH_VOICEMAIL: String
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 Voicemails.HAS_CONTENT
to 1;
Value: "android.intent.action.FETCH_VOICEMAIL"
ACTION_NEW_VOICEMAIL
static val ACTION_NEW_VOICEMAIL: String
Broadcast intent when a new voicemail record is inserted.
Value: "android.intent.action.NEW_VOICEMAIL"
ACTION_SYNC_VOICEMAIL
static val ACTION_SYNC_VOICEMAIL: String
Broadcast intent to request all voicemail sources to perform a sync with the remote server.
Value: "android.provider.action.SYNC_VOICEMAIL"
AUTHORITY
static val AUTHORITY: String
The authority used by the voicemail provider.
Value: "com.android.voicemail"
EXTRA_PHONE_ACCOUNT_HANDLE
static val EXTRA_PHONE_ACCOUNT_HANDLE: String
Extra included in ACTION_SYNC_VOICEMAIL
broadcast intents to indicate which PhoneAccountHandle
to sync.
Value: "android.provider.extra.PHONE_ACCOUNT_HANDLE"
static val EXTRA_SELF_CHANGE: String
Extra included in Intent.ACTION_PROVIDER_CHANGED
broadcast intents to indicate if the receiving package made this change.
Value: "com.android.voicemail.extra.SELF_CHANGE"
PARAM_KEY_SOURCE_PACKAGE
static val PARAM_KEY_SOURCE_PACKAGE: String
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.
Value: "source_package"
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# VoicemailContract\n\nAdded in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nVoicemailContract\n=================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/provider/VoicemailContract \"View this page in Java\") \n\n```\nopen class VoicemailContract\n```\n\n|---|-----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.provider.VoicemailContract](#) |\n\nThe contract between the voicemail provider and applications. Contains definitions for the supported URIs and columns.\n\nThe content providers exposes two tables through this interface:\n\n- Voicemails table: This stores the actual voicemail records. The columns and URIs for accessing this table are defined by the [Voicemails](/reference/kotlin/android/provider/VoicemailContract.Voicemails) class.\n- 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 [Status](/reference/kotlin/android/provider/VoicemailContract.Status) class.\n\nThe minimum permission needed to access this content provider is [android.Manifest.permission#ADD_VOICEMAIL](../Manifest.permission.html#ADD_VOICEMAIL:kotlin.String) or carrier privileges (see [android.telephony.TelephonyManager#hasCarrierPrivileges](../telephony/TelephonyManager.html#hasCarrierPrivileges())).\n\nVoicemails 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 [PARAM_KEY_SOURCE_PACKAGE](#PARAM_KEY_SOURCE_PACKAGE:kotlin.String) in the URI to identify its package.\n\nIn addition to the [ContentObserver](../database/ContentObserver.html#) 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:\n\n- [ACTION_NEW_VOICEMAIL](#ACTION_NEW_VOICEMAIL:kotlin.String) is generated for each new voicemail inserted.\n- [Intent.ACTION_PROVIDER_CHANGED](../content/Intent.html#ACTION_PROVIDER_CHANGED:kotlin.String) is generated for any change made into the database, including new voicemail.\n\nSummary\n-------\n\n| Nested classes ||\n|---|------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [Status](/reference/kotlin/android/provider/VoicemailContract.Status) Defines fields exposed through the /status path of this content provider. |\n| | [Voicemails](/reference/kotlin/android/provider/VoicemailContract.Voicemails) Defines fields exposed through the /voicemail path of this content provider. |\n\n| Constants ||\n|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ACTION_FETCH_VOICEMAIL](#ACTION_FETCH_VOICEMAIL:kotlin.String) Broadcast intent to request a voicemail source to fetch voicemail content of a specific voicemail from the remote server. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ACTION_NEW_VOICEMAIL](#ACTION_NEW_VOICEMAIL:kotlin.String) Broadcast intent when a new voicemail record is inserted. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ACTION_SYNC_VOICEMAIL](#ACTION_SYNC_VOICEMAIL:kotlin.String) Broadcast intent to request all voicemail sources to perform a sync with the remote server. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [AUTHORITY](#AUTHORITY:kotlin.String) The authority used by the voicemail provider. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [EXTRA_PHONE_ACCOUNT_HANDLE](#EXTRA_PHONE_ACCOUNT_HANDLE:kotlin.String) Extra included in [ACTION_SYNC_VOICEMAIL](#ACTION_SYNC_VOICEMAIL:kotlin.String) broadcast intents to indicate which [PhoneAccountHandle](../telecom/PhoneAccountHandle.html#) to sync. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [EXTRA_SELF_CHANGE](#EXTRA_SELF_CHANGE:kotlin.String) Extra included in [Intent.ACTION_PROVIDER_CHANGED](../content/Intent.html#ACTION_PROVIDER_CHANGED:kotlin.String) broadcast intents to indicate if the receiving package made this change. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [PARAM_KEY_SOURCE_PACKAGE](#PARAM_KEY_SOURCE_PACKAGE:kotlin.String) Parameter key used in the URI to specify the voicemail source package name. |\n\nConstants\n---------\n\n### ACTION_FETCH_VOICEMAIL\n\nAdded in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ACTION_FETCH_VOICEMAIL: String\n```\n\nBroadcast 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.\n\nAll voicemail sources are expected to handle this event. After storing the content the application should also set [Voicemails.HAS_CONTENT](/reference/kotlin/android/provider/VoicemailContract.Voicemails#HAS_CONTENT:kotlin.String) to 1; \n\n Value: \"android.intent.action.FETCH_VOICEMAIL\"\n\n### ACTION_NEW_VOICEMAIL\n\nAdded in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ACTION_NEW_VOICEMAIL: String\n```\n\nBroadcast intent when a new voicemail record is inserted. \n\n Value: \"android.intent.action.NEW_VOICEMAIL\"\n\n### ACTION_SYNC_VOICEMAIL\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ACTION_SYNC_VOICEMAIL: String\n```\n\nBroadcast intent to request all voicemail sources to perform a sync with the remote server. \n\n Value: \"android.provider.action.SYNC_VOICEMAIL\"\n\n### AUTHORITY\n\nAdded in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val AUTHORITY: String\n```\n\nThe authority used by the voicemail provider. \n\n Value: \"com.android.voicemail\"\n\n### EXTRA_PHONE_ACCOUNT_HANDLE\n\nAdded in [API level 25](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val EXTRA_PHONE_ACCOUNT_HANDLE: String\n```\n\nExtra included in [ACTION_SYNC_VOICEMAIL](#ACTION_SYNC_VOICEMAIL:kotlin.String) broadcast intents to indicate which [PhoneAccountHandle](../telecom/PhoneAccountHandle.html#) to sync. \n\n Value: \"android.provider.extra.PHONE_ACCOUNT_HANDLE\"\n\n### EXTRA_SELF_CHANGE\n\nAdded in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val EXTRA_SELF_CHANGE: String\n```\n\nExtra included in [Intent.ACTION_PROVIDER_CHANGED](../content/Intent.html#ACTION_PROVIDER_CHANGED:kotlin.String) broadcast intents to indicate if the receiving package made this change. \n\n Value: \"com.android.voicemail.extra.SELF_CHANGE\"\n\n### PARAM_KEY_SOURCE_PACKAGE\n\nAdded in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val PARAM_KEY_SOURCE_PACKAGE: String\n```\n\nParameter key used in the URI to specify the voicemail source package name.\n\nThis field must be set in all requests that originate from a voicemail source. \n\n Value: \"source_package\""]]