Fields Summary |
---|
public static final int | ETWS_WARNING_TYPE_EARTHQUAKEETWS warning type for earthquake. |
public static final int | ETWS_WARNING_TYPE_TSUNAMIETWS warning type for tsunami. |
public static final int | ETWS_WARNING_TYPE_EARTHQUAKE_AND_TSUNAMIETWS warning type for earthquake and tsunami. |
public static final int | ETWS_WARNING_TYPE_TEST_MESSAGEETWS warning type for test messages. |
public static final int | ETWS_WARNING_TYPE_OTHER_EMERGENCYETWS warning type for other emergency types. |
public static final int | ETWS_WARNING_TYPE_UNKNOWNUnknown ETWS warning type. |
private final int | mWarningTypeOne of the ETWS warning type constants defined in this class. |
private final boolean | mEmergencyUserAlertWhether or not to activate the emergency user alert tone and vibration. |
private final boolean | mActivatePopupWhether or not to activate a popup alert. |
private final byte[] | mWarningSecurityInformation50-byte security information (ETWS primary notification for GSM only). As of Release 10,
3GPP TS 23.041 states that the UE shall ignore the ETWS primary notification timestamp
and digital signature if received. Therefore it is treated as a raw byte array and
parceled with the broadcast intent if present, but the timestamp is only computed if an
application asks for the individual components. |
public static final Creator | CREATORCreator for unparcelling objects. |
Methods Summary |
---|
public int | describeContents()Describe the kinds of special objects contained in the marshalled representation.
return 0;
|
public byte[] | getPrimaryNotificationSignature()Returns the digital signature (GSM primary notifications only). As of Release 10,
3GPP TS 23.041 states that the UE shall ignore this value if received.
if (mWarningSecurityInformation == null || mWarningSecurityInformation.length < 50) {
return null;
}
return Arrays.copyOfRange(mWarningSecurityInformation, 7, 50);
|
public long | getPrimaryNotificationTimestamp()Returns the Warning-Security-Information timestamp (GSM primary notifications only).
As of Release 10, 3GPP TS 23.041 states that the UE shall ignore this value if received.
if (mWarningSecurityInformation == null || mWarningSecurityInformation.length < 7) {
return 0;
}
int year = IccUtils.gsmBcdByteToInt(mWarningSecurityInformation[0]);
int month = IccUtils.gsmBcdByteToInt(mWarningSecurityInformation[1]);
int day = IccUtils.gsmBcdByteToInt(mWarningSecurityInformation[2]);
int hour = IccUtils.gsmBcdByteToInt(mWarningSecurityInformation[3]);
int minute = IccUtils.gsmBcdByteToInt(mWarningSecurityInformation[4]);
int second = IccUtils.gsmBcdByteToInt(mWarningSecurityInformation[5]);
// For the timezone, the most significant bit of the
// least significant nibble is the sign byte
// (meaning the max range of this field is 79 quarter-hours,
// which is more than enough)
byte tzByte = mWarningSecurityInformation[6];
// Mask out sign bit.
int timezoneOffset = IccUtils.gsmBcdByteToInt((byte) (tzByte & (~0x08)));
timezoneOffset = ((tzByte & 0x08) == 0) ? timezoneOffset : -timezoneOffset;
Time time = new Time(Time.TIMEZONE_UTC);
// We only need to support years above 2000.
time.year = year + 2000;
time.month = month - 1;
time.monthDay = day;
time.hour = hour;
time.minute = minute;
time.second = second;
// Timezone offset is in quarter hours.
return time.toMillis(true) - timezoneOffset * 15 * 60 * 1000;
|
public int | getWarningType()Returns the ETWS warning type.
return mWarningType;
|
public boolean | isEmergencyUserAlert()Returns the ETWS emergency user alert flag.
return mEmergencyUserAlert;
|
public boolean | isPopupAlert()Returns the ETWS activate popup flag.
return mActivatePopup;
|
public java.lang.String | toString()
return "SmsCbEtwsInfo{warningType=" + mWarningType + ", emergencyUserAlert="
+ mEmergencyUserAlert + ", activatePopup=" + mActivatePopup + '}";
|
public void | writeToParcel(android.os.Parcel dest, int flags)Flatten this object into a Parcel.
dest.writeInt(mWarningType);
dest.writeInt(mEmergencyUserAlert ? 1 : 0);
dest.writeInt(mActivatePopup ? 1 : 0);
dest.writeByteArray(mWarningSecurityInformation);
|