CallIdentification.Builder

public static class CallIdentification.Builder
extends Object

java.lang.Object
   ↳ android.telecom.CallIdentification.Builder


Builder for CallIdentification instances.

A CallScreeningService uses this class to create new instances of CallIdentification for a screened call.

Summary

Public constructors

CallIdentification.Builder()

Default builder constructor.

Public methods

CallIdentification build()

Creates a new instance of CallIdentification based on the parameters set in this builder.

CallIdentification.Builder setDescription(String description)

Sets the description associated with the CallIdentification being built.

CallIdentification.Builder setDetails(String details)

Sets the details associated with the CallIdentification being built.

CallIdentification.Builder setName(String name)

Sets the name associated with the CallIdentification being built.

CallIdentification.Builder setNuisanceConfidence(int nuisanceConfidence)

Sets the nuisance confidence with the CallIdentification being built.

CallIdentification.Builder setPhoto(Icon photo)

Sets the photo associated with the CallIdentification being built.

Inherited methods

Public constructors

CallIdentification.Builder

public CallIdentification.Builder ()

Default builder constructor.

Public methods

build

public CallIdentification build ()

Creates a new instance of CallIdentification based on the parameters set in this builder.

Returns
CallIdentification CallIdentification instance.

setDescription

public CallIdentification.Builder setDescription (String description)

Sets the description associated with the CallIdentification being built.

A description of the call as identified by a CallScreeningService. The description is typically presented by Dialer apps after the CallIdentification#getName() to provide a short piece of relevant information about the call. This could include a location, address, or a message regarding the potential nature of the call (e.g. potential telemarketer).

Parameters
description String: The call description, or null if none is provided. This value may be null.

Returns
CallIdentification.Builder Builder instance.

setDetails

public CallIdentification.Builder setDetails (String details)

Sets the details associated with the CallIdentification being built.

The details is typically presented by Dialer apps after the CallIdentification#getName() and CallIdentification#getDescription() to provide further clarifying information about the call. This could include, for example, the opening hours of a business, or a stats about the number of times a call has been reported as spam.

Parameters
details String: The call details, or null if none is provided. This value may be null.

Returns
CallIdentification.Builder Builder instance.

setName

public CallIdentification.Builder setName (String name)

Sets the name associated with the CallIdentification being built.

Could be a business name, for example.

Parameters
name String: The name associated with the call, or null if none is provided. This value may be null.

Returns
CallIdentification.Builder Builder instance.

setNuisanceConfidence

public CallIdentification.Builder setNuisanceConfidence (int nuisanceConfidence)

Sets the nuisance confidence with the CallIdentification being built.

This can be used to specify how confident the CallScreeningService is that a call is or is not a nuisance call.

Parameters
nuisanceConfidence int: The nuisance confidence. Value is CallIdentification.CONFIDENCE_NUISANCE, CallIdentification.CONFIDENCE_LIKELY_NUISANCE, CallIdentification.CONFIDENCE_UNKNOWN, CallIdentification.CONFIDENCE_LIKELY_NOT_NUISANCE, or CallIdentification.CONFIDENCE_NOT_NUISANCE

Returns
CallIdentification.Builder The builder.

setPhoto

public CallIdentification.Builder setPhoto (Icon photo)

Sets the photo associated with the CallIdentification being built.

This could be, for example, a business logo, or a photo of the caller.

Parameters
photo Icon: The photo associated with the call, or null if none was provided. This value may be null.

Returns
CallIdentification.Builder Builder instance.