Class: CallForwarding

CallForwarding

new CallForwarding()

The module initializes the call forwarding icon states and update the icons when call forwarding states changed.

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.

Source:
Requires:
  • module:SIMSlotManager
  • module:SettingsHelper

Requires

  • module:SIMSlotManager
  • module:SettingsHelper

Methods

_addEventHandlers()

Add related event handlers.

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.

Source:

_initCallForwardingState(slot)

Initialize the icon states based on iccId and cached information.

Initialize the icon states based on iccId and cached information.

Parameters:
Name Type Description
slot SIMSlot

The target sim slot.

Source:

_onCallForwardingStateChanged(index, enabled)

Gets called when 'ril.cf.carrier.enabled' changes.

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.

Source:

_start()

Start the module.

Start the module.

Source:

_updateCallForwardingIconState(slot, event)

Gets called when receiving "cfstatechange".

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.

Source: