IT. Expert System.

Android Reference

SmsCbMessage


android.telephony

Class SmsCbMessage

  • All Implemented Interfaces:
    Parcelable


    public class SmsCbMessage
    extends Object
    implements Parcelable
    Parcelable object containing a received cell broadcast message. There are four different types of Cell Broadcast messages:
    • opt-in informational broadcasts, e.g. news, weather, stock quotes, sports scores
    • cell information messages, broadcast on channel 50, indicating the current cell name for roaming purposes (required to display on the idle screen in Brazil)
    • emergency broadcasts for the Japanese Earthquake and Tsunami Warning System (ETWS)
    • emergency broadcasts for the American Commercial Mobile Alert Service (CMAS)

    There are also four different CB message formats: GSM, ETWS Primary Notification (GSM only), UMTS, and CDMA. Some fields are only applicable for some message formats. Other fields were unified under a common name, avoiding some names, such as "Message Identifier", that refer to two completely different concepts in 3GPP and CDMA.

    The GSM/UMTS Message Identifier field is available via getServiceCategory(), the name of the equivalent field in CDMA. In both cases the service category is a 16-bit value, but 3GPP and 3GPP2 have completely different meanings for the respective values. For ETWS and CMAS, the application should

    The CDMA Message Identifier field is available via getSerialNumber(), which is used to detect the receipt of a duplicate message to be discarded. In CDMA, the message ID is unique to the current PLMN. In GSM/UMTS, there is a 16-bit serial number containing a 2-bit Geographical Scope field which indicates whether the 10-bit message code and 4-bit update number are considered unique to the PLMN, to the current cell, or to the current Location Area (or Service Area in UMTS). The relevant values are concatenated into a single String which will be unique if the messages are not duplicates.

    The SMS dispatcher does not detect duplicate messages. However, it does concatenate the pages of a GSM multi-page cell broadcast into a single SmsCbMessage object.

    Interested applications with RECEIVE_SMS_PERMISSION can register to receive SMS_CB_RECEIVED_ACTION broadcast intents for incoming non-emergency broadcasts. Only system applications such as the CellBroadcastReceiver may receive notifications for emergency broadcasts (ETWS and CMAS). This is intended to prevent any potential for delays or interference with the immediate display of the alert message and playing of the alert sound and vibration pattern, which could be caused by poorly written or malicious non-system code.

    • Field Detail

      • GEOGRAPHICAL_SCOPE_CELL_WIDE_IMMEDIATE

        public static final int GEOGRAPHICAL_SCOPE_CELL_WIDE_IMMEDIATE
        Cell wide geographical scope with immediate display (GSM/UMTS only).
        See Also:
        Constant Field Values
      • GEOGRAPHICAL_SCOPE_PLMN_WIDE

        public static final int GEOGRAPHICAL_SCOPE_PLMN_WIDE
        PLMN wide geographical scope (GSM/UMTS and all CDMA broadcasts).
        See Also:
        Constant Field Values
      • GEOGRAPHICAL_SCOPE_LA_WIDE

        public static final int GEOGRAPHICAL_SCOPE_LA_WIDE
        Location / service area wide geographical scope (GSM/UMTS only).
        See Also:
        Constant Field Values
      • GEOGRAPHICAL_SCOPE_CELL_WIDE

        public static final int GEOGRAPHICAL_SCOPE_CELL_WIDE
        Cell wide geographical scope (GSM/UMTS only).
        See Also:
        Constant Field Values
      • MESSAGE_FORMAT_3GPP

        public static final int MESSAGE_FORMAT_3GPP
        GSM or UMTS format cell broadcast.
        See Also:
        Constant Field Values
      • MESSAGE_FORMAT_3GPP2

        public static final int MESSAGE_FORMAT_3GPP2
        CDMA format cell broadcast.
        See Also:
        Constant Field Values
      • MESSAGE_PRIORITY_NORMAL

        public static final int MESSAGE_PRIORITY_NORMAL
        Normal message priority.
        See Also:
        Constant Field Values
      • MESSAGE_PRIORITY_INTERACTIVE

        public static final int MESSAGE_PRIORITY_INTERACTIVE
        Interactive message priority.
        See Also:
        Constant Field Values
      • MESSAGE_PRIORITY_URGENT

        public static final int MESSAGE_PRIORITY_URGENT
        Urgent message priority.
        See Also:
        Constant Field Values
      • MESSAGE_PRIORITY_EMERGENCY

        public static final int MESSAGE_PRIORITY_EMERGENCY
        Emergency message priority.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SmsCbMessage

        public SmsCbMessage(int messageFormat,
                    int geographicalScope,
                    int serialNumber,
                    SmsCbLocation location,
                    int serviceCategory,
                    String language,
                    String body,
                    int priority,
                    SmsCbEtwsInfo etwsWarningInfo,
                    SmsCbCmasInfo cmasWarningInfo)
        Create a new SmsCbMessage with the specified data.
      • SmsCbMessage

        public SmsCbMessage(Parcel in)
        Create a new SmsCbMessage object from a Parcel.
    • Method Detail

      • writeToParcel

        public void writeToParcel(Parcel dest,
                         int flags)
        Flatten this object into a Parcel.
        Specified by:
        writeToParcel in interface Parcelable
        Parameters:
        dest - The Parcel in which the object should be written.
        flags - Additional flags about how the object should be written (ignored).
      • getGeographicalScope

        public int getGeographicalScope()
        Return the geographical scope of this message (GSM/UMTS only).
        Returns:
        Geographical scope
      • getSerialNumber

        public int getSerialNumber()
        Return the broadcast serial number of broadcast (message identifier for CDMA, or geographical scope + message code + update number for GSM/UMTS). The serial number plus the location code uniquely identify a cell broadcast for duplicate detection.
        Returns:
        the 16-bit CDMA message identifier or GSM/UMTS serial number
      • getLocation

        public SmsCbLocation getLocation()
        Return the location identifier for this message, consisting of the MCC/MNC as a 5 or 6-digit decimal string. In addition, for GSM/UMTS, if the Geographical Scope of the message is not binary 01, the Location Area is included. If the GS is 00 or 11, the cell ID is also included. The SmsCbLocation object includes a method to test if the location is included within another location area or within a PLMN and CellLocation.
        Returns:
        the geographical location code for duplicate message detection
      • getServiceCategory

        public int getServiceCategory()
        Return the 16-bit CDMA service category or GSM/UMTS message identifier. The interpretation of the category is radio technology specific. For ETWS and CMAS warnings, the information provided by the category is available via getEtwsWarningInfo() or getCmasWarningInfo() in a radio technology independent format.
        Returns:
        the radio technology specific service category
      • getLanguageCode

        public String getLanguageCode()
        Get the ISO-639-1 language code for this message, or null if unspecified
        Returns:
        Language code
      • getMessageBody

        public String getMessageBody()
        Get the body of this message, or null if no body available
        Returns:
        Body, or null
      • getEtwsWarningInfo

        public SmsCbEtwsInfo getEtwsWarningInfo()
        If this is an ETWS warning notification then this method will return an object containing the ETWS warning type, the emergency user alert flag, and the popup flag. If this is an ETWS primary notification (GSM only), there will also be a 7-byte timestamp and 43-byte digital signature. As of Release 10, 3GPP TS 23.041 states that the UE shall ignore the ETWS primary notification timestamp and digital signature if received.
        Returns:
        an SmsCbEtwsInfo object, or null if this is not an ETWS warning notification
      • getCmasWarningInfo

        public SmsCbCmasInfo getCmasWarningInfo()
        If this is a CMAS warning notification then this method will return an object containing the CMAS message class, category, response type, severity, urgency and certainty. The message class is always present. Severity, urgency and certainty are present for CDMA warning notifications containing a type 1 elements record and for GSM and UMTS warnings except for the Presidential-level alert category. Category and response type are only available for CDMA notifications containing a type 1 elements record.
        Returns:
        an SmsCbCmasInfo object, or null if this is not a CMAS warning notification
      • isEmergencyMessage

        public boolean isEmergencyMessage()
        Return whether this message is an emergency (PWS) message type.
        Returns:
        true if the message is a public warning notification; false otherwise
      • isEtwsMessage

        public boolean isEtwsMessage()
        Return whether this message is an ETWS warning alert.
        Returns:
        true if the message is an ETWS warning notification; false otherwise
      • isCmasMessage

        public boolean isCmasMessage()
        Return whether this message is a CMAS warning alert.
        Returns:
        true if the message is a CMAS warning notification; false otherwise
      • toString

        public String toString()
        Description copied from class: Object
        Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
           getClass().getName() + '@' + Integer.toHexString(hashCode())

        See Writing a useful toString method if you intend implementing your own toString method.

        Overrides:
        toString in class Object
        Returns:
        a printable representation of this object.
      • describeContents

        public int describeContents()
        Describe the kinds of special objects contained in the marshalled representation.
        Specified by:
        describeContents in interface Parcelable
        Returns:
        a bitmask indicating this Parcelable contains no special objects


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 666 / 158856580. Delta: 0.04284 с