Merge "Pass bearerData and serviceCategory to CB module for CDMA"
diff --git a/api/system-current.txt b/api/system-current.txt
index 78cac92..166132c 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -7316,7 +7316,7 @@
public abstract class CellBroadcastService extends android.app.Service {
ctor public CellBroadcastService();
method @CallSuper public android.os.IBinder onBind(android.content.Intent);
- method public abstract void onCdmaCellBroadcastSms(int, byte[]);
+ method public abstract void onCdmaCellBroadcastSms(int, byte[], int);
method public abstract void onGsmCellBroadcastSms(int, byte[]);
field public static final String CELL_BROADCAST_SERVICE_INTERFACE = "android.telephony.CellBroadcastService";
}
diff --git a/telephony/java/android/telephony/CellBroadcastService.java b/telephony/java/android/telephony/CellBroadcastService.java
index d5e447e..46eb9df 100644
--- a/telephony/java/android/telephony/CellBroadcastService.java
+++ b/telephony/java/android/telephony/CellBroadcastService.java
@@ -21,6 +21,7 @@
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
+import android.telephony.cdma.CdmaSmsCbProgramData;
/**
* A service which exposes the cell broadcast handling module to the system.
@@ -69,9 +70,11 @@
/**
* Handle a CDMA cell broadcast SMS message forwarded from the system.
* @param slotIndex the index of the slot which received the message
- * @param message the SMS PDU
+ * @param bearerData the CDMA SMS bearer data
+ * @param serviceCategory the CDMA SCPT service category
*/
- public abstract void onCdmaCellBroadcastSms(int slotIndex, byte[] message);
+ public abstract void onCdmaCellBroadcastSms(int slotIndex, byte[] bearerData,
+ @CdmaSmsCbProgramData.Category int serviceCategory);
/**
* If overriding this method, call through to the super method for any unknown actions.
@@ -102,11 +105,14 @@
/**
* Handle a CDMA cell broadcast SMS.
* @param slotIndex the index of the slot which received the broadcast
- * @param message the SMS message PDU
+ * @param bearerData the CDMA SMS bearer data
+ * @param serviceCategory the CDMA SCPT service category
*/
@Override
- public void handleCdmaCellBroadcastSms(int slotIndex, byte[] message) {
- CellBroadcastService.this.onCdmaCellBroadcastSms(slotIndex, message);
+ public void handleCdmaCellBroadcastSms(int slotIndex, byte[] bearerData,
+ int serviceCategory) {
+ CellBroadcastService.this.onCdmaCellBroadcastSms(slotIndex, bearerData,
+ serviceCategory);
}
}
}
diff --git a/telephony/java/android/telephony/ICellBroadcastService.aidl b/telephony/java/android/telephony/ICellBroadcastService.aidl
index eff64a2..bcd6cc5 100644
--- a/telephony/java/android/telephony/ICellBroadcastService.aidl
+++ b/telephony/java/android/telephony/ICellBroadcastService.aidl
@@ -28,5 +28,5 @@
oneway void handleGsmCellBroadcastSms(int slotId, in byte[] message);
/** @see android.telephony.CellBroadcastService#onCdmaCellBroadcastSms */
- oneway void handleCdmaCellBroadcastSms(int slotId, in byte[] message);
+ oneway void handleCdmaCellBroadcastSms(int slotId, in byte[] bearerData, int serviceCategory);
}
diff --git a/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java b/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
index 4654437..b357fa4 100644
--- a/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
+++ b/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
@@ -900,6 +900,20 @@
}
/**
+ * @return the bearer data byte array
+ */
+ public byte[] getEnvelopeBearerData() {
+ return mEnvelope.bearerData;
+ }
+
+ /**
+ * @return the 16-bit CDMA SCPT service category
+ */
+ public @CdmaSmsCbProgramData.Category int getEnvelopeServiceCategory() {
+ return mEnvelope.serviceCategory;
+ }
+
+ /**
* {@inheritDoc}
*/
@Override
diff --git a/telephony/java/com/android/internal/telephony/cdma/sms/SmsEnvelope.java b/telephony/java/com/android/internal/telephony/cdma/sms/SmsEnvelope.java
index 2787b24..c924ab3 100644
--- a/telephony/java/com/android/internal/telephony/cdma/sms/SmsEnvelope.java
+++ b/telephony/java/com/android/internal/telephony/cdma/sms/SmsEnvelope.java
@@ -57,17 +57,17 @@
// CMAS alert service category assignments, see 3GPP2 C.R1001 table 9.3.3-1
public static final int SERVICE_CATEGORY_CMAS_PRESIDENTIAL_LEVEL_ALERT =
- CdmaSmsCbProgramData.CATEGORY_CMAS_PRESIDENTIAL_LEVEL_ALERT;
+ CdmaSmsCbProgramData.CATEGORY_CMAS_PRESIDENTIAL_LEVEL_ALERT; // = 4096
public static final int SERVICE_CATEGORY_CMAS_EXTREME_THREAT =
- CdmaSmsCbProgramData.CATEGORY_CMAS_EXTREME_THREAT;
+ CdmaSmsCbProgramData.CATEGORY_CMAS_EXTREME_THREAT; // = 4097
public static final int SERVICE_CATEGORY_CMAS_SEVERE_THREAT =
- CdmaSmsCbProgramData.CATEGORY_CMAS_SEVERE_THREAT;
+ CdmaSmsCbProgramData.CATEGORY_CMAS_SEVERE_THREAT; // = 4098
public static final int SERVICE_CATEGORY_CMAS_CHILD_ABDUCTION_EMERGENCY =
- CdmaSmsCbProgramData.CATEGORY_CMAS_CHILD_ABDUCTION_EMERGENCY;
+ CdmaSmsCbProgramData.CATEGORY_CMAS_CHILD_ABDUCTION_EMERGENCY; // = 4099
public static final int SERVICE_CATEGORY_CMAS_TEST_MESSAGE =
- CdmaSmsCbProgramData.CATEGORY_CMAS_TEST_MESSAGE;
+ CdmaSmsCbProgramData.CATEGORY_CMAS_TEST_MESSAGE; // = 4100
public static final int SERVICE_CATEGORY_CMAS_LAST_RESERVED_VALUE =
- CdmaSmsCbProgramData.CATEGORY_CMAS_LAST_RESERVED_VALUE;
+ CdmaSmsCbProgramData.CATEGORY_CMAS_LAST_RESERVED_VALUE; // = 4351
/**
* Provides the type of a SMS message like point to point, broadcast or acknowledge