Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#inhmethods)

# PhoneAccount.Builder

*** ** * ** ***

` public static class PhoneAccount.Builder `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.telecom.PhoneAccount.Builder |

<br />

*** ** * ** ***

Helper class for creating a `https://developer.android.com/reference/android/telecom/PhoneAccount`.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#Builder(android.telecom.PhoneAccount)(https://developer.android.com/reference/android/telecom/PhoneAccount phoneAccount) ` Creates an instance of the `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` from an existing `https://developer.android.com/reference/android/telecom/PhoneAccount`. |
| ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#Builder(android.telecom.PhoneAccountHandle,%20java.lang.CharSequence)(https://developer.android.com/reference/android/telecom/PhoneAccountHandle accountHandle, https://developer.android.com/reference/java/lang/CharSequence label) ` Creates a builder with the specified `https://developer.android.com/reference/android/telecom/PhoneAccountHandle` and label. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#addSupportedUriScheme(java.lang.String)(https://developer.android.com/reference/java/lang/String uriScheme) ` Specifies an additional URI scheme supported by the `https://developer.android.com/reference/android/telecom/PhoneAccount`. |
| ` https://developer.android.com/reference/android/telecom/PhoneAccount` | ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#build()() ` Creates an instance of a `https://developer.android.com/reference/android/telecom/PhoneAccount` based on the current builder settings. |
| ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#clearSimultaneousCallingRestriction()() ` Clears a previously set simultaneous calling restriction set when `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#Builder(android.telecom.PhoneAccount)` is used to create a new PhoneAccount from an existing one. |
| ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#setAddress(android.net.Uri)(https://developer.android.com/reference/android/net/Uri value) ` Sets the address. |
| ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#setCapabilities(int)(int value) ` Sets the capabilities. |
| ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#setExtras(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle extras) ` Specifies the extras associated with the `https://developer.android.com/reference/android/telecom/PhoneAccount`. |
| ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#setHighlightColor(int)(int value) ` Sets the highlight color. |
| ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#setIcon(android.graphics.drawable.Icon)(https://developer.android.com/reference/android/graphics/drawable/Icon icon) ` Sets the icon. |
| ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#setShortDescription(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence value) ` Sets the short description. |
| ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#setSimultaneousCallingRestriction(java.util.Set<android.telecom.PhoneAccountHandle>)(https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/telecom/PhoneAccountHandle> handles) ` Restricts the ability of this `https://developer.android.com/reference/android/telecom/PhoneAccount` to ONLY support simultaneous calling with the other `https://developer.android.com/reference/android/telecom/PhoneAccountHandle`s in this Set. |
| ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#setSubscriptionAddress(android.net.Uri)(https://developer.android.com/reference/android/net/Uri value) ` Sets the subscription address. |
| ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | ` https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#setSupportedUriSchemes(java.util.List<java.lang.String>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String> uriSchemes) ` Specifies the URI schemes supported by the `https://developer.android.com/reference/android/telecom/PhoneAccount`. |

### 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*.

## Public constructors

### Builder

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

```
public Builder (PhoneAccount phoneAccount)
```

Creates an instance of the `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` from an existing `https://developer.android.com/reference/android/telecom/PhoneAccount`.

<br />

| Parameters ||
|---|---|
| `phoneAccount` | `PhoneAccount`: The `https://developer.android.com/reference/android/telecom/PhoneAccount` used to initialize the builder. <br /> |

### Builder

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

```
public Builder (PhoneAccountHandle accountHandle, 
                CharSequence label)
```

Creates a builder with the specified `https://developer.android.com/reference/android/telecom/PhoneAccountHandle` and label.

Note: each CharSequence or String field is limited to 256 characters. This check is enforced when registering the PhoneAccount via `https://developer.android.com/reference/android/telecom/TelecomManager#registerPhoneAccount(android.telecom.PhoneAccount)` and will cause an `https://developer.android.com/reference/java/lang/IllegalArgumentException` to be thrown if the character field limit is over 256.

<br />

| Parameters ||
|---|---|
| `accountHandle` | `PhoneAccountHandle` <br /> |
| `label` | `CharSequence` <br /> |

## Public methods

### addSupportedUriScheme

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

```
public PhoneAccount.Builder addSupportedUriScheme (String uriScheme)
```

Specifies an additional URI scheme supported by the `https://developer.android.com/reference/android/telecom/PhoneAccount`.

Each URI scheme is limited to 256 characters. Adding a scheme over 256 characters will cause an `https://developer.android.com/reference/java/lang/IllegalArgumentException` to be thrown when the account is registered.

<br />

| Parameters ||
|---|---|
| `uriScheme` | `String`: The URI scheme. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | The builder. <br /> |

### build

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

```
public PhoneAccount build ()
```

Creates an instance of a `https://developer.android.com/reference/android/telecom/PhoneAccount` based on the current builder settings.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/PhoneAccount` | The `https://developer.android.com/reference/android/telecom/PhoneAccount`. <br /> |

### clearSimultaneousCallingRestriction

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

```
public PhoneAccount.Builder clearSimultaneousCallingRestriction ()
```

Clears a previously set simultaneous calling restriction set when `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#Builder(android.telecom.PhoneAccount)` is used to create a new PhoneAccount from an existing one.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | The Builder used to set up the new PhoneAccount. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#setSimultaneousCallingRestriction(java.util.Set<android.telecom.PhoneAccountHandle>)`

### setAddress

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

```
public PhoneAccount.Builder setAddress (Uri value)
```

Sets the address. See `https://developer.android.com/reference/android/telecom/PhoneAccount#getAddress()`.

Note: The entire URI value is limited to 256 characters. This check is enforced when registering the PhoneAccount via `https://developer.android.com/reference/android/telecom/TelecomManager#registerPhoneAccount(android.telecom.PhoneAccount)` and will cause an `https://developer.android.com/reference/java/lang/IllegalArgumentException` to be thrown if URI is over 256.

<br />

| Parameters ||
|---|---|
| `value` | `Uri`: The address of the phone account. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | The builder. <br /> |

### setCapabilities

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

```
public PhoneAccount.Builder setCapabilities (int value)
```

Sets the capabilities. See `https://developer.android.com/reference/android/telecom/PhoneAccount#getCapabilities()`.

<br />

| Parameters ||
|---|---|
| `value` | `int`: The capabilities to set. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | The builder. <br /> |

### setExtras

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

```
public PhoneAccount.Builder setExtras (Bundle extras)
```

Specifies the extras associated with the `https://developer.android.com/reference/android/telecom/PhoneAccount`.

`PhoneAccount`s only support extra values of type: `https://developer.android.com/reference/java/lang/String`, `https://developer.android.com/reference/java/lang/Integer`, and `https://developer.android.com/reference/java/lang/Boolean`. Extras which are not of these types are ignored.

Note: Each Bundle (Key, Value) String field is limited to 256 characters. Additionally, the bundle is limited to 100 (Key, Value) pairs total. This check is enforced when registering the PhoneAccount via `https://developer.android.com/reference/android/telecom/TelecomManager#registerPhoneAccount(android.telecom.PhoneAccount)` and will cause an `https://developer.android.com/reference/java/lang/IllegalArgumentException` to be thrown if the character field limit is over 256 or more than 100 (Key, Value) pairs are in the Bundle.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | <br /> |

### setHighlightColor

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

```
public PhoneAccount.Builder setHighlightColor (int value)
```

Sets the highlight color. See `https://developer.android.com/reference/android/telecom/PhoneAccount#getHighlightColor()`.

<br />

| Parameters ||
|---|---|
| `value` | `int`: The highlight color. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | The builder. <br /> |

### setIcon

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

```
public PhoneAccount.Builder setIcon (Icon icon)
```

Sets the icon. See `https://developer.android.com/reference/android/telecom/PhoneAccount#getIcon()`.

Note: An `https://developer.android.com/reference/java/lang/IllegalArgumentException` if the Icon cannot be written to memory. This check is enforced when registering the PhoneAccount via `https://developer.android.com/reference/android/telecom/TelecomManager#registerPhoneAccount(android.telecom.PhoneAccount)`

<br />

| Parameters ||
|---|---|
| `icon` | `Icon`: The icon to set. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | <br /> |

### setShortDescription

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

```
public PhoneAccount.Builder setShortDescription (CharSequence value)
```

Sets the short description. See `https://developer.android.com/reference/android/telecom/PhoneAccount#getShortDescription()`.

Note: Each CharSequence or String field is limited to 256 characters. This check is enforced when registering the PhoneAccount via `https://developer.android.com/reference/android/telecom/TelecomManager#registerPhoneAccount(android.telecom.PhoneAccount)` and will cause an `https://developer.android.com/reference/java/lang/IllegalArgumentException` to be thrown if the character field limit is over 256.

<br />

| Parameters ||
|---|---|
| `value` | `CharSequence`: The short description. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | The builder. <br /> |

### setSimultaneousCallingRestriction

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

```
public PhoneAccount.Builder setSimultaneousCallingRestriction (Set<PhoneAccountHandle> handles)
```

Restricts the ability of this `https://developer.android.com/reference/android/telecom/PhoneAccount` to ONLY support simultaneous calling with the other `https://developer.android.com/reference/android/telecom/PhoneAccountHandle`s in this Set.

If two or more `https://developer.android.com/reference/android/telecom/PhoneAccount`s support calling simultaneously, it means that Telecom allows the user to place additional outgoing calls and receive additional incoming calls using other `https://developer.android.com/reference/android/telecom/PhoneAccount`s while this PhoneAccount also has one or more active calls.

If this setter method is never called or cleared using `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#clearSimultaneousCallingRestriction()`, there is no restriction and all `https://developer.android.com/reference/android/telecom/PhoneAccount`s registered to Telecom by this package support simultaneous calling. If this setter is called and set as an empty Set, then this `https://developer.android.com/reference/android/telecom/PhoneAccount` does not support simultaneous calling with any other `https://developer.android.com/reference/android/telecom/PhoneAccount`s registered by the same application.

Note: Simultaneous calling restrictions can only be placed on `https://developer.android.com/reference/android/telecom/PhoneAccount`s that were registered by the same application. Simultaneous calling across applications is always possible as long as the `https://developer.android.com/reference/android/telecom/Connection` supports hold. If a `https://developer.android.com/reference/android/telecom/PhoneAccountHandle` is included here and the package name doesn't match this application's package name, `https://developer.android.com/reference/android/telecom/TelecomManager#registerPhoneAccount(android.telecom.PhoneAccount)` will throw a `https://developer.android.com/reference/java/lang/SecurityException`.

<br />

| Parameters ||
|---|---|
| `handles` | `Set`: The other `https://developer.android.com/reference/android/telecom/PhoneAccountHandle`s that support calling simultaneously with this one. Use `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder#clearSimultaneousCallingRestriction()` to remove the restriction and allow simultaneous calling to be supported across all `https://developer.android.com/reference/android/telecom/PhoneAccount`s registered by this package. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | The Builder used to set up the new PhoneAccount. This value cannot be `null`. <br /> |

### setSubscriptionAddress

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

```
public PhoneAccount.Builder setSubscriptionAddress (Uri value)
```

Sets the subscription address. See `https://developer.android.com/reference/android/telecom/PhoneAccount#getSubscriptionAddress()`.

<br />

| Parameters ||
|---|---|
| `value` | `Uri`: The subscription address. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | The builder. <br /> |

### setSupportedUriSchemes

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

```
public PhoneAccount.Builder setSupportedUriSchemes (List<String> uriSchemes)
```

Specifies the URI schemes supported by the `https://developer.android.com/reference/android/telecom/PhoneAccount`.

A max of 10 URI schemes can be added per account. Additionally, each URI scheme is limited to 256 characters. Adding more than 10 URI schemes or 256 characters on any scheme will cause an `https://developer.android.com/reference/java/lang/IllegalArgumentException` to be thrown when the account is registered.

<br />

| Parameters ||
|---|---|
| `uriSchemes` | `List`: The URI schemes. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/PhoneAccount.Builder` | The builder. <br /> |