# Telephony.ServiceStateTable

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

# ServiceStateTable

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/provider/Telephony.ServiceStateTable "View this page in Java")  

```
class ServiceStateTable
```

|---|----------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                               ||
| ↳ | [android.provider.Telephony.ServiceStateTable](https://developer.android.com/reference/kotlin/android/provider/Telephony.ServiceStateTable#) |

Constants for interfacing with the ServiceStateProvider and the different fields of the[ServiceState](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#)class accessible through the provider.

## Summary

|                                                                                                                                                           Constants                                                                                                                                                            ||
|----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [AUTHORITY](https://developer.android.com/reference/kotlin/android/provider/Telephony.ServiceStateTable#AUTHORITY:kotlin.String) The authority string for the ServiceStateProvider                                                     |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DATA_NETWORK_TYPE](https://developer.android.com/reference/kotlin/android/provider/Telephony.ServiceStateTable#DATA_NETWORK_TYPE:kotlin.String) The current data network type.                                                        |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DATA_REG_STATE](https://developer.android.com/reference/kotlin/android/provider/Telephony.ServiceStateTable#DATA_REG_STATE:kotlin.String) An integer value indicating the current data service state.                                 |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DUPLEX_MODE](https://developer.android.com/reference/kotlin/android/provider/Telephony.ServiceStateTable#DUPLEX_MODE:kotlin.String) An integer value indicating the current duplex mode if the radio technology is LTE, LTE-CA or NR. |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [IS_MANUAL_NETWORK_SELECTION](https://developer.android.com/reference/kotlin/android/provider/Telephony.ServiceStateTable#IS_MANUAL_NETWORK_SELECTION:kotlin.String) The current network selection mode.                               |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [VOICE_OPERATOR_NUMERIC](https://developer.android.com/reference/kotlin/android/provider/Telephony.ServiceStateTable#VOICE_OPERATOR_NUMERIC:kotlin.String) The current registered operator numeric id.                                 |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [VOICE_REG_STATE](https://developer.android.com/reference/kotlin/android/provider/Telephony.ServiceStateTable#VOICE_REG_STATE:kotlin.String) An integer value indicating the current voice service state.                              |

|                                                                                                                                                                                                                                                                                                                     Public methods                                                                                                                                                                                                                                                                                                                      ||
|------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)! | [getUriForSubscriptionId](https://developer.android.com/reference/kotlin/android/provider/Telephony.ServiceStateTable#getUriForSubscriptionId(kotlin.Int))`(`subscriptionId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Generates a content[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)used to receive updates on every field in the ServiceState provider.                                                                                                                                     |
| static[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)! | [getUriForSubscriptionIdAndField](https://developer.android.com/reference/kotlin/android/provider/Telephony.ServiceStateTable#getUriForSubscriptionIdAndField(kotlin.Int,%20kotlin.String))`(`subscriptionId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `field:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Generates a content[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)used to receive updates on a specific field in the ServiceState provider. |

|                                                                                                                                    Properties                                                                                                                                    ||
|------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)! | [CONTENT_URI](https://developer.android.com/reference/kotlin/android/provider/Telephony.ServiceStateTable#CONTENT_URI:android.net.Uri) The`content://`style URL for the ServiceStateProvider |

## Constants

### AUTHORITY

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

```
static val AUTHORITY: String
```

The authority string for the ServiceStateProvider  

    Value: "service-state"

### DATA_NETWORK_TYPE

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

```
static val DATA_NETWORK_TYPE: String
```

The current data network type.

This is the same as[TelephonyManager.getDataNetworkType()](https://developer.android.com/reference/kotlin/android/telephony/TelephonyManager.html#getDataNetworkType()).  

    Value: "data_network_type"

### DATA_REG_STATE

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

```
static val DATA_REG_STATE: String
```

An integer value indicating the current data service state.

Valid values:[ServiceState.STATE_IN_SERVICE](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#STATE_IN_SERVICE:kotlin.Int),[ServiceState.STATE_OUT_OF_SERVICE](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#STATE_OUT_OF_SERVICE:kotlin.Int),[ServiceState.STATE_EMERGENCY_ONLY](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#STATE_EMERGENCY_ONLY:kotlin.Int),[ServiceState.STATE_POWER_OFF](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#STATE_POWER_OFF:kotlin.Int).  

    Value: "data_reg_state"

### DUPLEX_MODE

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

```
static val DUPLEX_MODE: String
```

An integer value indicating the current duplex mode if the radio technology is LTE, LTE-CA or NR.

Valid values:[ServiceState.DUPLEX_MODE_UNKNOWN](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#DUPLEX_MODE_UNKNOWN:kotlin.Int),[ServiceState.DUPLEX_MODE_FDD](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#DUPLEX_MODE_FDD:kotlin.Int),[ServiceState.DUPLEX_MODE_TDD](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#DUPLEX_MODE_TDD:kotlin.Int).

This is the same as[ServiceState.getDuplexMode()](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#getDuplexMode()).  

    Value: "duplex_mode"

### IS_MANUAL_NETWORK_SELECTION

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

```
static val IS_MANUAL_NETWORK_SELECTION: String
```

The current network selection mode.

This is the same as[ServiceState.getIsManualSelection()](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#getIsManualSelection()).  

    Value: "is_manual_network_selection"

### VOICE_OPERATOR_NUMERIC

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

```
static val VOICE_OPERATOR_NUMERIC: String
```

The current registered operator numeric id.

In GSM/UMTS, numeric format is 3 digit country code plus 2 or 3 digit network code.

This is the same as[ServiceState.getOperatorNumeric()](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#getOperatorNumeric()).  

    Value: "voice_operator_numeric"

### VOICE_REG_STATE

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

```
static val VOICE_REG_STATE: String
```

An integer value indicating the current voice service state.

Valid values:[ServiceState.STATE_IN_SERVICE](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#STATE_IN_SERVICE:kotlin.Int),[ServiceState.STATE_OUT_OF_SERVICE](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#STATE_OUT_OF_SERVICE:kotlin.Int),[ServiceState.STATE_EMERGENCY_ONLY](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#STATE_EMERGENCY_ONLY:kotlin.Int),[ServiceState.STATE_POWER_OFF](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#STATE_POWER_OFF:kotlin.Int).

This is the same as[ServiceState.getState()](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#getState()).  

    Value: "voice_reg_state"

## Public methods

### getUriForSubscriptionId

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

```
static fun getUriForSubscriptionId(subscriptionId: Int): Uri!
```

Generates a content[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)used to receive updates on every field in the ServiceState provider.

Use this[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)with a[ContentObserver](https://developer.android.com/reference/kotlin/android/database/ContentObserver.html#)to be notified of changes to the[ServiceState](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#)while your app is running. You can also use a[android.app.job.JobService](https://developer.android.com/reference/kotlin/android/app/job/JobService.html#)to ensure your app is notified of changes to the[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)even when it is not running. Note, however, that using a[android.app.job.JobService](https://developer.android.com/reference/kotlin/android/app/job/JobService.html#)does not guarantee timely delivery of updates to the[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#).

|                                                              Parameters                                                               ||
|------------------|---------------------------------------------------------------------------------------------------------------------|
| `subscriptionId` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):the subscriptionId to receive updates on |

|                                                                                                     Return                                                                                                      ||
|------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)! | the Uri used to observe[ServiceState](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#)changes |

### getUriForSubscriptionIdAndField

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

```
static fun getUriForSubscriptionIdAndField(
    subscriptionId: Int, 
    field: String!
): Uri!
```

Generates a content[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)used to receive updates on a specific field in the ServiceState provider.

Use this[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)with a[ContentObserver](https://developer.android.com/reference/kotlin/android/database/ContentObserver.html#)to be notified of changes to the[ServiceState](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#)while your app is running. You can also use a[android.app.job.JobService](https://developer.android.com/reference/kotlin/android/app/job/JobService.html#)to ensure your app is notified of changes to the[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)even when it is not running. Note, however, that using a[android.app.job.JobService](https://developer.android.com/reference/kotlin/android/app/job/JobService.html#)does not guarantee timely delivery of updates to the[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#).

|                                                                    Parameters                                                                    ||
|------------------|--------------------------------------------------------------------------------------------------------------------------------|
| `subscriptionId` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):the subscriptionId to receive updates on            |
| `field`          | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the ServiceState field to receive updates on |

|                                                                                                     Return                                                                                                      ||
|------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)! | the Uri used to observe[ServiceState](https://developer.android.com/reference/kotlin/android/telephony/ServiceState.html#)changes |

## Properties

### CONTENT_URI

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

```
static val CONTENT_URI: Uri!
```

The`content://`style URL for the ServiceStateProvider