Index

CallForwarding

new CallForwarding()

The module initializes the call forwarding icon states and update the icons
when call forwarding states changed.
As we are not able to query the current call forwarding states from the
carrier on startup, we initialized the icon state based on the cached
information. When call forwarding states are changed, the module caches
the state along with the corresponding iccId.

Methods

_addEventHandlers()

Add related event handlers. The sim cards may not be ready when starting.
We register to "simslot-cardstatechange" and "simslot-iccinfochange" for
updating the icons when ready. When users query the current call
forwarding states in settings app, 'ril.cf.carrier.enabled' is used to
notify the state changes. When users change the call forwarding states in
settings app, we will receive the 'cfstatechange' event. All the events
must be watched to have correct icon states.

_initCallForwardingState(slot)

Initialize the icon states based on iccId and cached information.

Parameters:
Name Type Description
slot SIMSlot

The target sim slot.

_onCallForwardingStateChanged(index, enabled)

Gets called when 'ril.cf.carrier.enabled' changes. It updates the cached
information and icon states.

Parameters:
Name Type Description
index Number

The index of the sim card being changed.

enabled Boolean

The call forwarding state.

_updateCallForwardingIconState(slot, event)

Gets called when receiving "cfstatechange". It updates the cached
information and icon states.

Parameters:
Name Type Description
slot SIMSlot

The target sim slot.

event Event

The event.

start()

Start the module.