Class CallDetailsBuilder

java.lang.Object
org.robolectric.shadows.CallDetailsBuilder

public class CallDetailsBuilder extends Object
Builder for Call.Details.
  • Method Details

    • newBuilder

      public static CallDetailsBuilder newBuilder()
      Creates a new, empty builder for Call.Details.
    • newBuilder

      public static CallDetailsBuilder newBuilder(Call.Details original)
      Creates a new builder populated with data from the given Call.Details.
    • setState

      @CanIgnoreReturnValue public CallDetailsBuilder setState(int state)
      Sets the state of the call.
      Parameters:
      state - the call state (e.g., Call.STATE_ACTIVE)
      Returns:
      this builder instance
    • setCallDirection

      @CanIgnoreReturnValue public CallDetailsBuilder setCallDirection(int callDirection)
      Sets the direction of the call (e.g., incoming or outgoing).
      Parameters:
      callDirection - the call direction (e.g., Call.Details.DIRECTION_INCOMING)
      Returns:
      this builder instance
    • setVideoState

      @CanIgnoreReturnValue public CallDetailsBuilder setVideoState(int videoState)
      Sets the video state of the call.
      Parameters:
      videoState - the video state (e.g., VideoProfile.STATE_AUDIO_ONLY)
      Returns:
      this builder instance
    • setAccountHandle

      @CanIgnoreReturnValue public CallDetailsBuilder setAccountHandle(PhoneAccountHandle handle)
      Sets the phone account handle associated with the call.
      Parameters:
      handle - the phone account handle for the call
      Returns:
      this builder instance
    • setContactDisplayName

      @CanIgnoreReturnValue public CallDetailsBuilder setContactDisplayName(String name)
      Sets the display name of the contact.
      Parameters:
      name - the display name of the contact
      Returns:
      this builder instance
    • setHandle

      @CanIgnoreReturnValue public CallDetailsBuilder setHandle(Uri handle)
      Sets the handle (e.g. phone number) for the call.
      Parameters:
      handle - the handle for the call
      Returns:
      this builder instance
    • setConnectTimeMillis

      @CanIgnoreReturnValue public CallDetailsBuilder setConnectTimeMillis(long connectTimeMillis)
      Sets the time the call connected in milliseconds.
      Parameters:
      connectTimeMillis - the time the call connected in milliseconds
      Returns:
      this builder instance
    • setDisconnectCause

      @CanIgnoreReturnValue public CallDetailsBuilder setDisconnectCause(DisconnectCause disconnectCause)
      Sets the disconnect cause for the call.
      Parameters:
      disconnectCause - the disconnect cause for the call
      Returns:
      this builder instance
    • setCallProperties

      @CanIgnoreReturnValue public CallDetailsBuilder setCallProperties(int properties)
      Sets properties associated with the call.
      Parameters:
      properties - the properties associated with the call
      Returns:
      this builder instance
    • setExtras

      @CanIgnoreReturnValue public CallDetailsBuilder setExtras(Bundle extras)
      Sets the extras bundle for the call details.
      Parameters:
      extras - the extras bundle for the call details
      Returns:
      this builder instance
    • build

      public Call.Details build()
      Builds and returns a new Call.Details instance with the configured values.
      Returns:
      the constructed Call.Details object.