Added data coding scheme and location check time support

AT&T requires showing data coding scheme, location check
time, whether shown to the user or not in the test menu.
Expanded database to support this.

Bug: 144152683
Test: Manully sending fake messages and verified database
Change-Id: Ib5b78802e7548da9f92492aae4c94ed3488b5e3d
This commit is contained in:
Jack Yu
2020-01-24 13:24:41 -08:00
parent 9652ad9514
commit 641db9a36a
4 changed files with 51 additions and 6 deletions

View File

@@ -9703,6 +9703,7 @@ package android.provider {
field public static final String CMAS_SEVERITY = "cmas_severity";
field public static final String CMAS_URGENCY = "cmas_urgency";
field @NonNull public static final android.net.Uri CONTENT_URI;
field public static final String DATA_CODING_SCHEME = "dcs";
field public static final String DEFAULT_SORT_ORDER = "date DESC";
field public static final String DELIVERY_TIME = "date";
field public static final String ETWS_WARNING_TYPE = "etws_warning_type";
@@ -9710,9 +9711,11 @@ package android.provider {
field public static final String GEOMETRIES = "geometries";
field public static final String LAC = "lac";
field public static final String LANGUAGE_CODE = "language";
field public static final String LOCATION_CHECK_TIME = "location_check_time";
field public static final String MAXIMUM_WAIT_TIME = "maximum_wait_time";
field public static final String MESSAGE_BODY = "body";
field public static final String MESSAGE_BROADCASTED = "message_broadcasted";
field public static final String MESSAGE_DISPLAYED = "message_displayed";
field public static final String MESSAGE_FORMAT = "format";
field @NonNull @RequiresPermission(android.Manifest.permission.READ_CELL_BROADCASTS) public static final android.net.Uri MESSAGE_HISTORY_URI;
field public static final String MESSAGE_PRIORITY = "priority";
@@ -12047,11 +12050,12 @@ package android.telephony {
}
public final class SmsCbMessage implements android.os.Parcelable {
ctor public SmsCbMessage(int, int, int, @NonNull android.telephony.SmsCbLocation, int, @Nullable String, @Nullable String, int, @Nullable android.telephony.SmsCbEtwsInfo, @Nullable android.telephony.SmsCbCmasInfo, int, @Nullable java.util.List<android.telephony.CbGeoUtils.Geometry>, long, int, int);
ctor public SmsCbMessage(int, int, int, @NonNull android.telephony.SmsCbLocation, int, @Nullable String, int, @Nullable String, int, @Nullable android.telephony.SmsCbEtwsInfo, @Nullable android.telephony.SmsCbCmasInfo, int, @Nullable java.util.List<android.telephony.CbGeoUtils.Geometry>, long, int, int);
method @NonNull public static android.telephony.SmsCbMessage createFromCursor(@NonNull android.database.Cursor);
method public int describeContents();
method @Nullable public android.telephony.SmsCbCmasInfo getCmasWarningInfo();
method @NonNull public android.content.ContentValues getContentValues();
method public int getDataCodingScheme();
method @Nullable public android.telephony.SmsCbEtwsInfo getEtwsWarningInfo();
method public int getGeographicalScope();
method @NonNull public java.util.List<android.telephony.CbGeoUtils.Geometry> getGeometries();

View File

@@ -2846,6 +2846,7 @@ package android.provider {
field public static final String CMAS_SEVERITY = "cmas_severity";
field public static final String CMAS_URGENCY = "cmas_urgency";
field @NonNull public static final android.net.Uri CONTENT_URI;
field public static final String DATA_CODING_SCHEME = "dcs";
field public static final String DEFAULT_SORT_ORDER = "date DESC";
field public static final String DELIVERY_TIME = "date";
field public static final String ETWS_WARNING_TYPE = "etws_warning_type";
@@ -2853,9 +2854,11 @@ package android.provider {
field public static final String GEOMETRIES = "geometries";
field public static final String LAC = "lac";
field public static final String LANGUAGE_CODE = "language";
field public static final String LOCATION_CHECK_TIME = "location_check_time";
field public static final String MAXIMUM_WAIT_TIME = "maximum_wait_time";
field public static final String MESSAGE_BODY = "body";
field public static final String MESSAGE_BROADCASTED = "message_broadcasted";
field public static final String MESSAGE_DISPLAYED = "message_displayed";
field public static final String MESSAGE_FORMAT = "format";
field @NonNull @RequiresPermission(android.Manifest.permission.READ_CELL_BROADCASTS) public static final android.net.Uri MESSAGE_HISTORY_URI;
field public static final String MESSAGE_PRIORITY = "priority";

View File

@@ -4276,6 +4276,15 @@ public final class Telephony {
*/
public static final String LANGUAGE_CODE = "language";
/**
* Dats coding scheme of the message.
* <p>
* The data coding scheme (dcs) value defined in 3GPP TS 23.038 section 4
* </p>
* <P>Type: INTEGER</P>
*/
public static final String DATA_CODING_SCHEME = "dcs";
/**
* Message body.
* <P>Type: TEXT</P>
@@ -4364,17 +4373,31 @@ public final class Telephony {
public static final String DEFAULT_SORT_ORDER = DELIVERY_TIME + " DESC";
/**
* The timestamp in millisecond of when the device received the message.
* The timestamp in millisecond, reported by {@link System#currentTimeMillis()}, when the
* device received the message.
* <P>Type: BIGINT</P>
*/
public static final String RECEIVED_TIME = "received_time";
/**
* The timestamp in millisecond, reported by {@link System#currentTimeMillis()}, when
* location was checked last time. Note this is only applicable to geo-targeting message.
* For non geo-targeting message. the field will be set to -1.
* <P>Type: BIGINT</P>
*/
public static final String LOCATION_CHECK_TIME = "location_check_time";
/**
* Indicates that whether the message has been broadcasted to the application.
* <P>Type: BOOLEAN</P>
*/
public static final String MESSAGE_BROADCASTED = "message_broadcasted";
/**
* Indicates that whether the message has been displayed to the user.
* <P>Type: BOOLEAN</P>
*/
public static final String MESSAGE_DISPLAYED = "message_displayed";
/**
* The Warning Area Coordinates Elements. This element is used for geo-fencing purpose.
*

View File

@@ -177,6 +177,9 @@ public final class SmsCbMessage implements Parcelable {
@Nullable
private final String mLanguage;
/** The 8-bit data coding scheme defined in 3GPP TS 23.038 section 4. */
private final int mDataCodingScheme;
/** Message body, as a String. */
@Nullable
private final String mBody;
@@ -220,7 +223,7 @@ public final class SmsCbMessage implements Parcelable {
@Nullable SmsCbCmasInfo cmasWarningInfo, int slotIndex, int subId) {
this(messageFormat, geographicalScope, serialNumber, location, serviceCategory, language,
body, priority, etwsWarningInfo, cmasWarningInfo, 0 /* maximumWaitingTime */,
0, body, priority, etwsWarningInfo, cmasWarningInfo, 0 /* maximumWaitingTime */,
null /* geometries */, System.currentTimeMillis(), slotIndex, subId);
}
@@ -230,8 +233,8 @@ public final class SmsCbMessage implements Parcelable {
*/
public SmsCbMessage(int messageFormat, int geographicalScope, int serialNumber,
@NonNull SmsCbLocation location, int serviceCategory,
@Nullable String language, @Nullable String body, int priority,
@Nullable SmsCbEtwsInfo etwsWarningInfo,
@Nullable String language, int dataCodingScheme, @Nullable String body,
int priority, @Nullable SmsCbEtwsInfo etwsWarningInfo,
@Nullable SmsCbCmasInfo cmasWarningInfo, int maximumWaitTimeSec,
@Nullable List<Geometry> geometries, long receivedTimeMillis, int slotIndex,
int subId) {
@@ -241,6 +244,7 @@ public final class SmsCbMessage implements Parcelable {
mLocation = location;
mServiceCategory = serviceCategory;
mLanguage = language;
mDataCodingScheme = dataCodingScheme;
mBody = body;
mPriority = priority;
mEtwsWarningInfo = etwsWarningInfo;
@@ -263,6 +267,7 @@ public final class SmsCbMessage implements Parcelable {
mLocation = new SmsCbLocation(in);
mServiceCategory = in.readInt();
mLanguage = in.readString();
mDataCodingScheme = in.readInt();
mBody = in.readString();
mPriority = in.readInt();
int type = in.readInt();
@@ -305,6 +310,7 @@ public final class SmsCbMessage implements Parcelable {
mLocation.writeToParcel(dest, flags);
dest.writeInt(mServiceCategory);
dest.writeString(mLanguage);
dest.writeInt(mDataCodingScheme);
dest.writeString(mBody);
dest.writeInt(mPriority);
if (mEtwsWarningInfo != null) {
@@ -397,6 +403,15 @@ public final class SmsCbMessage implements Parcelable {
return mLanguage;
}
/**
* Get data coding scheme of the message
*
* @return The 8-bit data coding scheme defined in 3GPP TS 23.038 section 4.
*/
public int getDataCodingScheme() {
return mDataCodingScheme;
}
/**
* Get the body of this message, or null if no body available
*
@@ -718,7 +733,7 @@ public final class SmsCbMessage implements Parcelable {
cursor.getColumnIndexOrThrow(CellBroadcasts.MAXIMUM_WAIT_TIME));
return new SmsCbMessage(format, geoScope, serialNum, location, category,
language, body, priority, etwsInfo, cmasInfo, maximumWaitTimeSec, geometries,
language, 0, body, priority, etwsInfo, cmasInfo, maximumWaitTimeSec, geometries,
receivedTimeMillis, slotIndex, subId);
}