func update()

in AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/InfoHeaderViewModel.swift [127:164]


    func update(localUserState: LocalUserState,
                remoteParticipantsState: RemoteParticipantsState,
                callingState: CallingState,
                visibilityState: VisibilityState,
                callScreenInfoHeaderState: CallScreenInfoHeaderState,
                buttonViewDataState: ButtonViewDataState
    ) {
        isHoldingCall(callingState: callingState)
        let shouldDisplayInfoHeaderValue = shouldDisplayInfoHeader(for: callingStatus)
        let newDisplayInfoHeaderValue = shouldDisplayInfoHeader(for: callingState.status)
        callingStatus = callingState.status
        if isVoiceOverEnabled && newDisplayInfoHeaderValue != shouldDisplayInfoHeaderValue {
            updateInfoHeaderAvailability()
        }

        let updatedRemoteparticipantCount = getParticipantCount(remoteParticipantsState)

        if participantsCount != updatedRemoteparticipantCount
            && callScreenInfoHeaderState.title == nil {
            participantsCount = updatedRemoteparticipantCount
            updateInfoLabel()
        }

        if visibilityState.currentStatus == .pipModeEntered {
            hideInfoHeader()
        }
        if callScreenInfoHeaderState.title != nil
            && callScreenInfoHeaderState.title != self.title {
            self.title = (callScreenInfoHeaderState.title)!
            self.accessibilityLabelTitle = self.title
        }
        if callScreenInfoHeaderState.subtitle != nil
            && callScreenInfoHeaderState.subtitle != self.subtitle {
            self.subtitle = callScreenInfoHeaderState.subtitle
            self.accessibilityLabelSubtitle = self.subtitle ?? ""
        }
        updateCustomButtons(buttonViewDataState)
    }