Merge "Store ETWS primary information in the database" into rvc-dev
This commit is contained in:
@@ -4324,6 +4324,15 @@ public final class Telephony {
|
|||||||
*/
|
*/
|
||||||
public static final String ETWS_WARNING_TYPE = "etws_warning_type";
|
public static final String ETWS_WARNING_TYPE = "etws_warning_type";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ETWS (Earthquake and Tsunami Warning System) primary message or not (ETWS alerts only).
|
||||||
|
* <p>See {@link android.telephony.SmsCbEtwsInfo}</p>
|
||||||
|
* <P>Type: BOOLEAN</P>
|
||||||
|
*
|
||||||
|
* @hide // TODO: Unhide this for S.
|
||||||
|
*/
|
||||||
|
public static final String ETWS_IS_PRIMARY = "etws_is_primary";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CMAS (Commercial Mobile Alert System) message class (CMAS alerts only).
|
* CMAS (Commercial Mobile Alert System) message class (CMAS alerts only).
|
||||||
* <p>See {@link android.telephony.SmsCbCmasInfo}</p>
|
* <p>See {@link android.telephony.SmsCbCmasInfo}</p>
|
||||||
@@ -4464,37 +4473,6 @@ public final class Telephony {
|
|||||||
CMAS_URGENCY,
|
CMAS_URGENCY,
|
||||||
CMAS_CERTAINTY
|
CMAS_CERTAINTY
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Query columns for instantiating {@link android.telephony.SmsCbMessage} objects.
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public static final String[] QUERY_COLUMNS_FWK = {
|
|
||||||
_ID,
|
|
||||||
SLOT_INDEX,
|
|
||||||
SUBSCRIPTION_ID,
|
|
||||||
GEOGRAPHICAL_SCOPE,
|
|
||||||
PLMN,
|
|
||||||
LAC,
|
|
||||||
CID,
|
|
||||||
SERIAL_NUMBER,
|
|
||||||
SERVICE_CATEGORY,
|
|
||||||
LANGUAGE_CODE,
|
|
||||||
MESSAGE_BODY,
|
|
||||||
MESSAGE_FORMAT,
|
|
||||||
MESSAGE_PRIORITY,
|
|
||||||
ETWS_WARNING_TYPE,
|
|
||||||
CMAS_MESSAGE_CLASS,
|
|
||||||
CMAS_CATEGORY,
|
|
||||||
CMAS_RESPONSE_TYPE,
|
|
||||||
CMAS_SEVERITY,
|
|
||||||
CMAS_URGENCY,
|
|
||||||
CMAS_CERTAINTY,
|
|
||||||
RECEIVED_TIME,
|
|
||||||
MESSAGE_BROADCASTED,
|
|
||||||
GEOMETRIES,
|
|
||||||
MAXIMUM_WAIT_TIME
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -594,6 +594,7 @@ public final class SmsCbMessage implements Parcelable {
|
|||||||
SmsCbEtwsInfo etwsInfo = getEtwsWarningInfo();
|
SmsCbEtwsInfo etwsInfo = getEtwsWarningInfo();
|
||||||
if (etwsInfo != null) {
|
if (etwsInfo != null) {
|
||||||
cv.put(CellBroadcasts.ETWS_WARNING_TYPE, etwsInfo.getWarningType());
|
cv.put(CellBroadcasts.ETWS_WARNING_TYPE, etwsInfo.getWarningType());
|
||||||
|
cv.put(CellBroadcasts.ETWS_IS_PRIMARY, etwsInfo.isPrimary());
|
||||||
}
|
}
|
||||||
|
|
||||||
SmsCbCmasInfo cmasInfo = getCmasWarningInfo();
|
SmsCbCmasInfo cmasInfo = getCmasWarningInfo();
|
||||||
@@ -667,9 +668,12 @@ public final class SmsCbMessage implements Parcelable {
|
|||||||
|
|
||||||
SmsCbEtwsInfo etwsInfo;
|
SmsCbEtwsInfo etwsInfo;
|
||||||
int etwsWarningTypeColumn = cursor.getColumnIndex(CellBroadcasts.ETWS_WARNING_TYPE);
|
int etwsWarningTypeColumn = cursor.getColumnIndex(CellBroadcasts.ETWS_WARNING_TYPE);
|
||||||
if (etwsWarningTypeColumn != -1 && !cursor.isNull(etwsWarningTypeColumn)) {
|
int etwsIsPrimaryColumn = cursor.getColumnIndex(CellBroadcasts.ETWS_IS_PRIMARY);
|
||||||
|
if (etwsWarningTypeColumn != -1 && !cursor.isNull(etwsWarningTypeColumn)
|
||||||
|
&& etwsIsPrimaryColumn != -1 && !cursor.isNull(etwsIsPrimaryColumn)) {
|
||||||
int warningType = cursor.getInt(etwsWarningTypeColumn);
|
int warningType = cursor.getInt(etwsWarningTypeColumn);
|
||||||
etwsInfo = new SmsCbEtwsInfo(warningType, false, false, false, null);
|
boolean isPrimary = cursor.getInt(etwsIsPrimaryColumn) != 0;
|
||||||
|
etwsInfo = new SmsCbEtwsInfo(warningType, false, false, isPrimary, null);
|
||||||
} else {
|
} else {
|
||||||
etwsInfo = null;
|
etwsInfo = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user