com.motorola.oem.network
Class Network

java.lang.Object
  extended by OEM
      extended by com.motorola.oem.network.Network

public class Network
extends OEM

 Provides control over the Network features.
 
Most of the Network class service methods are static and may be used w/o creating an object.
The Network class also provides event handler methods which may be overridden only after instantiation.


Field Summary
static int CLIP_SS_STATUS_ACTIVE_UNKNOWN
           
static int CLIP_SS_STATUS_CONFLICT
           
static int CLIP_SS_STATUS_ERROR
           
static int CLIP_SS_STATUS_NO_CONFLICT
           
static int CLIP_SS_STATUS_NOT_ACTIVE
           
static int CLIP_SS_STATUS_NOT_SUBSCRIBED
           
static int CLIP_SS_STATUS_UNKNOWN
           
static int CLIR_SUBSCRIP_ALLOW
           
static int CLIR_SUBSCRIP_ERROR
           
static int CLIR_SUBSCRIP_NOT_SPECIFIED
           
static int CLIR_SUBSCRIP_PERMANENT
           
static int CLIR_SUBSCRIP_RESTRICT
           
static int COVERAGE_EDGE
          Packet Switch Coverage Status.
static int COVERAGE_GPRS
          Packet Switch Coverage Status.
static int COVERAGE_NO_GPRS
          Packet Switch Coverage Status.
static int COVERAGE_UNDEFINED
          Packet Switch Coverage Status.
static int GPRS_STATE_NOT_REG_NOT_SEARCH
          GPRS Network service is neither registered nor Searching for an operator.
static int GPRS_STATE_NOT_REG_SEARCH
          GPRS Network service is NOT registered, but is still searching for network.
static int GPRS_STATE_REG_DENIED
          GPRS Network service is NOT registered - Registration denied.
static int GPRS_STATE_REG_HOME
          GPRS Network service is registered to its home network.
static int GPRS_STATE_REG_ROAM
          GPRS Network service is registered, Roaming.
static int GPRS_STATE_UNKNOWN
          GPRS Network service availability is Unknown.
static int GSM_STATE_NOT_REG_NOT_SEARCH
          GSM Network service is neither registered nor Searching for a network.
static int GSM_STATE_NOT_REG_SEARCH
          GSM Network service is NOT registered, but is still searching for network.
static int GSM_STATE_REG_DENIED
          GSM Network service is NOT registered - Registration denied.
static int GSM_STATE_REG_HOME
          GSM Network service is registered to its home network.
static int GSM_STATE_REG_ROAM
          GSM Network service is registered, Roaming.
static int GSM_STATE_UNKNOWN
          GSM Network service availability is Unknown.
 
Method Summary
static void addOperatorNumericNameToPreferredList(java.lang.String numericName, int insertIndex)
          Add a new Network to the Preferred Operators' List
static void deleteOperatorFromPreferredList(int deleteIndex)
          Deletes a Network from the Preferred Operators' List
 java.lang.String[] getAvailableNetworks(int format)
          Gets Available Networks.
 java.lang.String getCellID()
          Gets the current network cell's ID.
 java.lang.String getCellLAC()
          Gets the current network cell's Location Area Code.
static int getGPRSRegState()
          Gets the current GPRS service registration's state.
static int getGSMRegState()
          Get the current GSM service registration's state.
static Network getInstance()
          Returns a reference to the class's single instance.
 int getLineIdPresentationStatus()
          Gets the Calling Line ID Presentation status(CLIP) from the network.
 int[] getLineIdRestrictionStatus()
          Gets the Calling Line ID Restriction status(CLIR) from the network.
static java.lang.String getNITZClock()
          Gets Network's Clock - date, time and signed time zone.
static java.lang.String getOperatorNameAlpha()
          Gets the selected network operator name in alpha numeric format.
static java.lang.String getOperatorNameNumeric()
          Gets the selected network operator PLMN code.
static int getPacketSwitchCoverage()
          Gets Packet Switch Coverage status
static java.lang.String[] getPreferredOperatorsListInAlphaNames()
          Gets Networks Alpha names from Preferred Operators' list.
static int getPreferredOperatorsListMaximalLimit()
          Gets the maximum number of PLMNs in Preferred List can be stored in SIM.
static int getSignalStrengthBER()
          Gets the Bit Error Rate (BER) of the device.
static int getSignalStrengthRSSI()
          Gets the value for Received Signal Strength Indication (RSSI) from the device.
static void manualOperatorSelect(java.lang.String operatorName, int nameFormat)
          Selects a new operator This is a Network request and needs no confirmation answer.
 NetworkUSSDResponseData sendUSSD(java.lang.String stringToSend)
          Deprecated. replaced by NetworkUSSD.sendUSSD(String).
static void setLineIdRestriction(int n)
          Sets the Calling Line ID Restriction status (Enable/Disable).
 void setNetworkCellInfoListener(NetworkCellInfoListener networkCellInfoListener)
          Sets a listener for cell information changes.
 void setNetworkRegistrationListener(NetworkRegistrationListener networkRegistrationListener)
          Sets a listener for GSM/GPRS network registration state changes.
 void setNetworkSignalListener(NetworkSignalListener networkSignalListener)
          Sets a listener for signal strength level changes.
 void terminateUSSD()
          Deprecated. replaced by NetworkUSSD.terminateUSSD().
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLIP_SS_STATUS_NOT_SUBSCRIBED

public static final int CLIP_SS_STATUS_NOT_SUBSCRIBED
See Also:
Constant Field Values

CLIP_SS_STATUS_NOT_ACTIVE

public static final int CLIP_SS_STATUS_NOT_ACTIVE
See Also:
Constant Field Values

CLIP_SS_STATUS_CONFLICT

public static final int CLIP_SS_STATUS_CONFLICT
See Also:
Constant Field Values

CLIP_SS_STATUS_NO_CONFLICT

public static final int CLIP_SS_STATUS_NO_CONFLICT
See Also:
Constant Field Values

CLIP_SS_STATUS_ACTIVE_UNKNOWN

public static final int CLIP_SS_STATUS_ACTIVE_UNKNOWN
See Also:
Constant Field Values

CLIP_SS_STATUS_UNKNOWN

public static final int CLIP_SS_STATUS_UNKNOWN
See Also:
Constant Field Values

CLIP_SS_STATUS_ERROR

public static final int CLIP_SS_STATUS_ERROR
See Also:
Constant Field Values

CLIR_SUBSCRIP_NOT_SPECIFIED

public static final int CLIR_SUBSCRIP_NOT_SPECIFIED
See Also:
Constant Field Values

CLIR_SUBSCRIP_PERMANENT

public static final int CLIR_SUBSCRIP_PERMANENT
See Also:
Constant Field Values

CLIR_SUBSCRIP_RESTRICT

public static final int CLIR_SUBSCRIP_RESTRICT
See Also:
Constant Field Values

CLIR_SUBSCRIP_ALLOW

public static final int CLIR_SUBSCRIP_ALLOW
See Also:
Constant Field Values

CLIR_SUBSCRIP_ERROR

public static final int CLIR_SUBSCRIP_ERROR
See Also:
Constant Field Values

COVERAGE_NO_GPRS

public static final int COVERAGE_NO_GPRS
Packet Switch Coverage Status. No GPRS coverage.

See Also:
Constant Field Values

COVERAGE_GPRS

public static final int COVERAGE_GPRS
Packet Switch Coverage Status. GPRS coverage.

See Also:
Constant Field Values

COVERAGE_EDGE

public static final int COVERAGE_EDGE
Packet Switch Coverage Status. EDGE coverage.

See Also:
Constant Field Values

COVERAGE_UNDEFINED

public static final int COVERAGE_UNDEFINED
Packet Switch Coverage Status. Unknown coverage.

See Also:
Constant Field Values

GSM_STATE_NOT_REG_NOT_SEARCH

public static final int GSM_STATE_NOT_REG_NOT_SEARCH
GSM Network service is neither registered nor Searching for a network.

See Also:
Constant Field Values

GSM_STATE_REG_HOME

public static final int GSM_STATE_REG_HOME
GSM Network service is registered to its home network.

See Also:
Constant Field Values

GSM_STATE_NOT_REG_SEARCH

public static final int GSM_STATE_NOT_REG_SEARCH
GSM Network service is NOT registered, but is still searching for network.

See Also:
Constant Field Values

GSM_STATE_REG_DENIED

public static final int GSM_STATE_REG_DENIED
GSM Network service is NOT registered - Registration denied.

See Also:
Constant Field Values

GSM_STATE_UNKNOWN

public static final int GSM_STATE_UNKNOWN
GSM Network service availability is Unknown.

See Also:
Constant Field Values

GSM_STATE_REG_ROAM

public static final int GSM_STATE_REG_ROAM
GSM Network service is registered, Roaming.

See Also:
Constant Field Values

GPRS_STATE_NOT_REG_NOT_SEARCH

public static final int GPRS_STATE_NOT_REG_NOT_SEARCH
GPRS Network service is neither registered nor Searching for an operator.

See Also:
Constant Field Values

GPRS_STATE_REG_HOME

public static final int GPRS_STATE_REG_HOME
GPRS Network service is registered to its home network.

See Also:
Constant Field Values

GPRS_STATE_NOT_REG_SEARCH

public static final int GPRS_STATE_NOT_REG_SEARCH
GPRS Network service is NOT registered, but is still searching for network.

See Also:
Constant Field Values

GPRS_STATE_REG_DENIED

public static final int GPRS_STATE_REG_DENIED
GPRS Network service is NOT registered - Registration denied.

See Also:
Constant Field Values

GPRS_STATE_UNKNOWN

public static final int GPRS_STATE_UNKNOWN
GPRS Network service availability is Unknown.

See Also:
Constant Field Values

GPRS_STATE_REG_ROAM

public static final int GPRS_STATE_REG_ROAM
GPRS Network service is registered, Roaming.

See Also:
Constant Field Values
Method Detail

getInstance

public static Network getInstance()
                           throws NetworkException
Returns a reference to the class's single instance. If the instance does not exist, then it is created and its reference is returned.

Returns:
reference to class Network's instance
Throws:
NetworkException - Failed to construct the Network object.

getGSMRegState

public static int getGSMRegState()
Get the current GSM service registration's state.

Returns:
GSM registration state: GSM_STATE_NOT_REG_NOT_SEARCH, GSM_STATE_REG_HOME, GSM_STATE_NOT_REG_SEARCH, GSM_STATE_REG_DENIED, GSM_STATE_UNKNOWN, GSM_STATE_REG_ROAM.

getGPRSRegState

public static int getGPRSRegState()
Gets the current GPRS service registration's state.

Returns:
GPRS registration state: GPRS_STATE_NOT_REG_NOT_SEARCH, GPRS_STATE_REG_HOME, GPRS_STATE_NOT_REG_SEARCH, GPRS_STATE_REG_DENIED, GPRS_STATE_UNKNOWN, GPRS_STATE_REG_ROAM.

getCellLAC

public java.lang.String getCellLAC()
Gets the current network cell's Location Area Code.

Returns:
Location Area Code string of hexadecimal value

getCellID

public java.lang.String getCellID()
Gets the current network cell's ID.

Returns:
ID string of hexadecimal value

getSignalStrengthRSSI

public static int getSignalStrengthRSSI()
Gets the value for Received Signal Strength Indication (RSSI) from the device.

Returns:
Value for Signal Strength RSSI (2 bytes)
 [0 through 31] - Cover the range of -113 dbm (or less) to -51dbm (or greater)

getSignalStrengthBER

public static int getSignalStrengthBER()
Gets the Bit Error Rate (BER) of the device.

Returns:
Value for Bit Error Rate
 Channel bit error rate (in percent)
 
  • 07 RXQUAL values in the GSM 05.08 table
  • 99 Unknown or not detectable

  • getOperatorNameAlpha

    public static java.lang.String getOperatorNameAlpha()
                                                 throws NetworkException
    Gets the selected network operator name in alpha numeric format.

    Returns:
    The selected operator name in alpha numeric format (up to 16 characters)
    Throws:
    NetworkException - Illegal operator name(error code NetworkException.ILLEGAL_OPEARTOR_NAME_ERROR)

    getOperatorNameNumeric

    public static java.lang.String getOperatorNameNumeric()
                                                   throws NetworkException
    Gets the selected network operator PLMN code.

    Returns:
    The selected operator PLMN code in numeric format
    Throws:
    NetworkException - Illegal operator name (error code NetworkException.ILLEGAL_OPEARTOR_NAME_ERROR)

    getLineIdPresentationStatus

    public int getLineIdPresentationStatus()
                                    throws NetworkException
    Gets the Calling Line ID Presentation status(CLIP) from the network. Indicates whether CLI will be presented to the device within an MT call. Important Note: This method will block the thread until it receives back a notification. If this method is called from inside a listener's implementation, it must be done in a separate thread.

    Returns:
    ssStatus - Shows the subscriber's CLIP service status in the network:

    CLIP_SS_STATUS_NOT_SUBSCRIBED, CLIP_SS_STATUS_NOT_ACTIVE, CLIP_SS_STATUS_CONFLICT, CLIP_SS_STATUS_NO_CONFLICT, CLIP_SS_STATUS_ACTIVE_UNKNOWN, CLIP_SS_STATUS_UNKNOWN, CLIP_SS_STATUS_ERROR
    Throws:
    NetworkException - Platform failure(error code NetworkException.UNABLE_REGISTER_CNF_EVENT_ERROR)
    NetworkException - Platform failure(error code NetworkException.INVALID_ACQUIRE_HANDLER_ERROR)
    NetworkException - Illegal CLIP SS Identifier(error code NetworkException.ILLEGAL_CLIP_SS_ID_ERROR)
    NetworkException - No network service(error code NetworkException.CLIP_NO_NETWORK_ERROR)
    NetworkException - Synchronization failure

    getLineIdRestrictionStatus

    public int[] getLineIdRestrictionStatus()
                                     throws NetworkException
    Gets the Calling Line ID Restriction status(CLIR) from the network. Indicates whether CLIR will be sent within an MO call. Important Note: This method will block the thread until it receives back a notification. If this method is called from inside a listener's implementation, it must be done in a separate thread.

    Returns:
    int[] array. 1-st element sets the adjustment for outgoing call:

    clirState = 0 - Not set clirState = 1 - Restriction invoked clirState = 2 - Restriction suppressed 2-nd element shows the subscriber's CLIR service status in the network:

    CLIR_SUBSCRIP_NOT_SPECIFIED
    CLIR_SUBSCRIP_PERMANENT
    CLIR_SUBSCRIP_RESTRICT
    CLIR_SUBSCRIP_ALLOW
    CLIR_SUBSCRIP_ERROR

    Throws:
    NetworkException - Platform failure(error code NetworkException.UNABLE_REGISTER_CNF_EVENT_ERROR)
    NetworkException - Platform failure(error code NetworkException.INVALID_ACQUIRE_HANDLER_ERROR)
    NetworkException - Illegal CLIR SS Identifier(error code NetworkException.ILLEGAL_CLIR_SS_ID_ERROR)
    NetworkException - Synchronization failure

    setLineIdRestriction

    public static void setLineIdRestriction(int n)
                                     throws NetworkException
    Sets the Calling Line ID Restriction status (Enable/Disable). Indicates whether CLI will be presented to the device within an MO call.

    Parameters:
    n -
    0 - According to subscription,
    1 - Restriction invocation,
    2 - Restriction suppression.
    Throws:
    NetworkException - Storing 'n' in memory has failed(error code NetworkException.CLIR_MEMORY_ERROR)

    getNITZClock

    public static java.lang.String getNITZClock()
                                         throws NetworkException
    Gets Network's Clock - date, time and signed time zone.

    Returns:
    String Value of date, month, year, hour, minute, second and time zone
    Throws:
    NetworkException - Clock is not defined(error code NetworkException.CLOCK_ERROR)

    getPreferredOperatorsListMaximalLimit

    public static int getPreferredOperatorsListMaximalLimit()
                                                     throws NetworkException
    Gets the maximum number of PLMNs in Preferred List can be stored in SIM.

    Returns:
    Networks' max number
    Throws:
    NetworkException - Getting SIM Preferred Operators' list maximal limit failed(error code NetworkException.GET_PREFERRED_LIST_ERROR)

    getPreferredOperatorsListInAlphaNames

    public static java.lang.String[] getPreferredOperatorsListInAlphaNames()
                                                                    throws NetworkException
    Gets Networks Alpha names from Preferred Operators' list.

    Returns:
    Array of Strings - Networks' names in Alpha format
    Throws:
    NetworkException - Getting SIM Preferred Operators' list failed(error code NetworkException.GET_PREFERRED_LIST_ERROR)

    addOperatorNumericNameToPreferredList

    public static void addOperatorNumericNameToPreferredList(java.lang.String numericName,
                                                             int insertIndex)
                                                      throws NetworkException
    Add a new Network to the Preferred Operators' List

    Parameters:
    numericName - String value of new network in Numeric format
    insertIndex - Index of the new operator in the list. (from 1 to number of operators, allowed by SIM)
    Throws:
    NetworkException - Adding to SIM Preferred Operators list syntax error(error code NetworkException.ADD_TO_PREFERRED_LIST_SYNTAX_ERROR)
    NetworkException - Adding to SIM Preferred Operators list failed(error code NetworkException.ADD_TO_PREFERRED_LIST_FAIL_ERROR)
    NetworkException - Adding to SIM Preferred Operators list - invalid index(error code NetworkException.ADD_TO_PREFERRED_LIST_INDEX_ERROR)

    deleteOperatorFromPreferredList

    public static void deleteOperatorFromPreferredList(int deleteIndex)
                                                throws NetworkException
    Deletes a Network from the Preferred Operators' List

    Parameters:
    deleteIndex - Index of the deleted operator in the list. (from 1 to number of operators, allowed by SIM)
    Throws:
    NetworkException - Deleting from SIM Preferred Operators list failed(error code NetworkException.DELETE_FROM_PREFERRED_LIST_FAIL_ERROR)
    NetworkException - Deleting from SIM Preferred Operators list - invalid index(error code NetworkException.DELETE_FROM_PREFERRED_LIST_INDEX_ERROR)

    manualOperatorSelect

    public static void manualOperatorSelect(java.lang.String operatorName,
                                            int nameFormat)
                                     throws NetworkException
    Selects a new operator This is a Network request and needs no confirmation answer.

    Parameters:
    operatorName - string numeric name of operator to be selected
    nameFormat - 0 - alpha format, 1 - numeric format
    Throws:
    NetworkException - Call state is not IDLE(error code NetworkException.OP_SELECT_CALL_STATE_INVALID_ERROR)
    NetworkException - No network service(error code NetworkException.OP_SELECT_NO_NETWORK_ERROR)
    NetworkException - Invalid registation state(error code NetworkException.OP_SELECT_INVALID_REG_STATE_ERROR)
    NetworkException - Wrong name of operator(error code NetworkException.OP_SELECT_INVALID_NAME_ERROR)
    NetworkException - Wrong operator format(error code NetworkException.OP_SELECT_UNKNOWN_FORMAT_ERROR)

    getAvailableNetworks

    public java.lang.String[] getAvailableNetworks(int format)
                                            throws NetworkException
    Gets Available Networks.

    Important Note: This method will block the thread until it receives back a notification. If this method is called from inside a listener's implementation, it must be done in a separate thread.

    Parameters:
    format - Presentation format of requested networks: 0 - Alpha, 1 - Numeric.
    Returns:
    String[] Array of available networks.
    Throws:
    NetworkException - Platform failure(error code NetworkException.UNABLE_REGISTER_CNF_EVENT_ERROR)
    NetworkException - Platform failure(error code NetworkException.INVALID_ACQUIRE_HANDLER_ERROR)
    NetworkException - Invalid registration state(error code NetworkException.GET_AVAIL_NET_INVALID_REG_STATE_ERROR)
    NetworkException - Wrong opeartor format(error code NetworkException.GET_AVAIL_NET_WRONG_FORMAT_ERROR)
    NetworkException - Network busy(error code NetworkException.GET_AVAIL_NET_BUSY_ERROR)
    NetworkException - Synchronization failure

    getPacketSwitchCoverage

    public static int getPacketSwitchCoverage()
                                       throws NetworkException
    Gets Packet Switch Coverage status

    Returns:
    current coverage status:

    COVERAGE_NO_GPRS, COVERAGE_GPRS, COVERAGE_EDGE, COVERAGE_UNDEFINED
    Throws:
    NetworkException - Undefined coverage(error code NetworkException.GET_PACKET_SWITCH_ERROR)

    sendUSSD

    public NetworkUSSDResponseData sendUSSD(java.lang.String stringToSend)
                                     throws NetworkException
    Deprecated. replaced by NetworkUSSD.sendUSSD(String).

    Send a USSD string to the network

    Important Note: This method will block the thread until it receives back a notification. If this method is called from inside a listener's implementation, it must be done in a separate thread. It is prohibited to use this method and NetworkUSSD.sendUSSD(java.lang.String, byte) method at the same time in the code.

    Parameters:
    stringToSend - Sontains the USSD command sent to the network
    Returns:
    NetworkUSSDResponseData Contains relevant network response data
    Throws:
    NetworkException - Unable to register CLIR confirmation event(error code NetworkException.UNABLE_REGISTER_CNF_EVENT_ERROR)
    NetworkException - Unable to acquire confirmation handler(error code NetworkException.INVALID_ACQUIRE_HANDLER_ERROR)
    NetworkException - Request string syntax error(error code NetworkException.USSD_ERROR)
    NetworkException - Synchronization failure
    NetworkException - Platform failure(error code NetworkException.UNABLE_REGISTER_CNF_EVENT_ERROR)
    NetworkException - Platform failure(error code NetworkException.INVALID_ACQUIRE_HANDLER_ERROR)
    NetworkException - Request string syntax error(error code NetworkException.USSD_ERROR)
    NetworkException - Synchronization failure

    terminateUSSD

    public void terminateUSSD()
    Deprecated. replaced by NetworkUSSD.terminateUSSD().

    Send a USSD request for a transaction termination to the network


    setNetworkRegistrationListener

    public void setNetworkRegistrationListener(NetworkRegistrationListener networkRegistrationListener)
    Sets a listener for GSM/GPRS network registration state changes.
    NetworkRegistrationListener.onGSMRegStateChanged(int) or NetworkRegistrationListener.onGPRSRegStateChanged(int) will be called upon a GSM/GPRS network registration state change accordingly.


    setNetworkSignalListener

    public void setNetworkSignalListener(NetworkSignalListener networkSignalListener)
    Sets a listener for signal strength level changes.
    NetworkSignalListener.onSignalStrengthLevelChanged(int, int) will be called upon a signal strength level change.


    setNetworkCellInfoListener

    public void setNetworkCellInfoListener(NetworkCellInfoListener networkCellInfoListener)
    Sets a listener for cell information changes.
    NetworkCellInfoListener.onCellInfoChanged(int, int) will be called upon a cell information change.