am 6d492b6d: Merge "CB: Add CDMA CMAS"
# By Rika Brooks
# Via Gerrit Code Review (1) and Rika Brooks (1)
* commit '6d492b6d2d628dd2c97b3ca5dd9e0a031905cb15':
CB: Add CDMA CMAS
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 9b60968..92fda98 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -28,6 +28,7 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.VIBRATE" />
+ <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
<application android:name="CellBroadcastReceiverApp"
android:label="@string/app_label"
@@ -105,6 +106,14 @@
</intent-filter>
</receiver>
+ <!-- Require sender permission for querying latest area info broadcast -->
+ <receiver android:name="PrivilegedCellBroadcastReceiver"
+ android:permission="android.permission.READ_PHONE_STATE">
+ <intent-filter>
+ <action android:name="android.cellbroadcastreceiver.GET_LATEST_CB_AREA_INFO" />
+ </intent-filter>
+ </receiver>
+
<receiver android:name="CellBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertService.java b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertService.java
index 3cc821c..6e1b601 100644
--- a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertService.java
+++ b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertService.java
@@ -26,6 +26,7 @@
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.IBinder;
+import android.os.UserHandle;
import android.preference.PreferenceManager;
import android.provider.Telephony;
import android.telephony.CellBroadcastMessage;
@@ -52,6 +53,10 @@
/** Use the same notification ID for non-emergency alerts. */
static final int NOTIFICATION_ID = 1;
+ /** Sticky broadcast for latest area info broadcast received. */
+ static final String CB_AREA_INFO_RECEIVED_ACTION =
+ "android.cellbroadcastreceiver.CB_AREA_INFO_RECEIVED";
+
/** Container for message ID and geographical scope, for duplicate message detection. */
private static final class MessageIdAndScope {
private final int mMessageId;
@@ -245,6 +250,16 @@
}
}
+ if (message.getServiceCategory() == 50) {
+ // save latest area info broadcast for Settings display and send as broadcast
+ CellBroadcastReceiverApp.setLatestAreaInfo(message);
+ Intent intent = new Intent(CB_AREA_INFO_RECEIVED_ACTION);
+ intent.putExtra("message", message);
+ sendBroadcastAsUser(intent, UserHandle.ALL,
+ android.Manifest.permission.READ_PHONE_STATE);
+ return false; // area info broadcasts are displayed in Settings status screen
+ }
+
return true; // other broadcast messages are always enabled
}
@@ -339,7 +354,7 @@
messageList);
intent.putExtra(CellBroadcastAlertFullScreen.FROM_NOTIFICATION_EXTRA, true);
- PendingIntent pi = PendingIntent.getActivity(this, 0, intent,
+ PendingIntent pi = PendingIntent.getActivity(this, NOTIFICATION_ID, intent,
PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT);
// use default sound/vibration/lights for non-emergency broadcasts
diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastConfigService.java b/src/com/android/cellbroadcastreceiver/CellBroadcastConfigService.java
index 4258e5c..64c220b 100644
--- a/src/com/android/cellbroadcastreceiver/CellBroadcastConfigService.java
+++ b/src/com/android/cellbroadcastreceiver/CellBroadcastConfigService.java
@@ -17,6 +17,7 @@
package com.android.cellbroadcastreceiver;
import android.app.IntentService;
+import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
@@ -24,6 +25,7 @@
import android.preference.PreferenceManager;
import android.telephony.CellBroadcastMessage;
import android.telephony.SmsManager;
+import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
@@ -151,7 +153,13 @@
boolean enableEmergencyAlerts = prefs.getBoolean(
CellBroadcastSettings.KEY_ENABLE_EMERGENCY_ALERTS, true);
- boolean enableChannel50Alerts = res.getBoolean(R.bool.show_brazil_settings) &&
+ TelephonyManager tm = (TelephonyManager) getSystemService(
+ Context.TELEPHONY_SERVICE);
+
+ boolean enableChannel50Support = res.getBoolean(R.bool.show_brazil_settings) ||
+ "br".equals(tm.getSimCountryIso());
+
+ boolean enableChannel50Alerts = enableChannel50Support &&
prefs.getBoolean(CellBroadcastSettings.KEY_ENABLE_CHANNEL_50_ALERTS, true);
SmsManager manager = SmsManager.getDefault();
diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java b/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java
index ac5b1d8..c1eeeab 100644
--- a/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java
+++ b/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java
@@ -20,10 +20,15 @@
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.os.UserHandle;
import android.preference.PreferenceManager;
import android.provider.Telephony;
+import android.telephony.CellBroadcastMessage;
+import android.telephony.PhoneStateListener;
+import android.telephony.ServiceState;
import android.telephony.TelephonyManager;
import android.telephony.cdma.CdmaSmsCbProgramData;
import android.util.Log;
@@ -35,6 +40,9 @@
private static final String TAG = "CellBroadcastReceiver";
static final boolean DBG = true; // STOPSHIP: change to false before ship
+ private static final String GET_LATEST_CB_AREA_INFO_ACTION =
+ "android.cellbroadcastreceiver.GET_LATEST_CB_AREA_INFO";
+
@Override
public void onReceive(Context context, Intent intent) {
onReceiveWithPrivilege(context, intent, false);
@@ -46,7 +54,11 @@
String action = intent.getAction();
if (Intent.ACTION_BOOT_COMPLETED.equals(action)) {
- startConfigService(context);
+ if (DBG) log("Registering for ServiceState updates");
+ TelephonyManager tm = (TelephonyManager) context.getSystemService(
+ Context.TELEPHONY_SERVICE);
+ tm.listen(new ServiceStateListener(context.getApplicationContext()),
+ PhoneStateListener.LISTEN_SERVICE_STATE);
} else if (Intent.ACTION_AIRPLANE_MODE_CHANGED.equals(action)) {
boolean airplaneModeOn = intent.getBooleanExtra("state", false);
if (DBG) log("airplaneModeOn: " + airplaneModeOn);
@@ -78,6 +90,19 @@
} else {
loge("ignoring unprivileged action received " + action);
}
+ } else if (GET_LATEST_CB_AREA_INFO_ACTION.equals(action)) {
+ if (privileged) {
+ CellBroadcastMessage message = CellBroadcastReceiverApp.getLatestAreaInfo();
+ if (message != null) {
+ Intent areaInfoIntent = new Intent(
+ CellBroadcastAlertService.CB_AREA_INFO_RECEIVED_ACTION);
+ areaInfoIntent.putExtra("message", message);
+ context.sendBroadcastAsUser(areaInfoIntent, UserHandle.ALL,
+ android.Manifest.permission.READ_PHONE_STATE);
+ }
+ } else {
+ Log.e(TAG, "caller missing READ_PHONE_STATE permission, returning");
+ }
} else {
Log.w(TAG, "onReceive() unexpected action " + action);
}
@@ -177,6 +202,28 @@
return isCdma;
}
+ private static class ServiceStateListener extends PhoneStateListener {
+ private final Context mContext;
+ private int mServiceState = -1;
+
+ ServiceStateListener(Context context) {
+ mContext = context;
+ }
+
+ @Override
+ public void onServiceStateChanged(ServiceState ss) {
+ int newState = ss.getState();
+ if (newState != mServiceState) {
+ Log.d(TAG, "Service state changed! " + newState + " Full: " + ss);
+ mServiceState = newState;
+ if (newState == ServiceState.STATE_IN_SERVICE ||
+ newState == ServiceState.STATE_EMERGENCY_ONLY) {
+ startConfigService(mContext);
+ }
+ }
+ }
+ }
+
private static void log(String msg) {
Log.d(TAG, msg);
}
diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastReceiverApp.java b/src/com/android/cellbroadcastreceiver/CellBroadcastReceiverApp.java
index 65e8c72..b9e6039 100644
--- a/src/com/android/cellbroadcastreceiver/CellBroadcastReceiverApp.java
+++ b/src/com/android/cellbroadcastreceiver/CellBroadcastReceiverApp.java
@@ -42,6 +42,9 @@
private static final ArrayList<CellBroadcastMessage> sNewMessageList =
new ArrayList<CellBroadcastMessage>(4);
+ /** Latest area info cell broadcast received. */
+ private static CellBroadcastMessage sLatestAreaInfo;
+
/** Adds a new unread non-emergency message and returns the current list. */
static ArrayList<CellBroadcastMessage> addNewMessageToList(CellBroadcastMessage message) {
sNewMessageList.add(message);
@@ -52,4 +55,14 @@
static void clearNewMessageList() {
sNewMessageList.clear();
}
+
+ /** Saves the latest area info broadcast received. */
+ static void setLatestAreaInfo(CellBroadcastMessage areaInfo) {
+ sLatestAreaInfo = areaInfo;
+ }
+
+ /** Returns the latest area info broadcast received. */
+ static CellBroadcastMessage getLatestAreaInfo() {
+ return sLatestAreaInfo;
+ }
}
diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastSettings.java b/src/com/android/cellbroadcastreceiver/CellBroadcastSettings.java
index a7c7482..027ef96 100644
--- a/src/com/android/cellbroadcastreceiver/CellBroadcastSettings.java
+++ b/src/com/android/cellbroadcastreceiver/CellBroadcastSettings.java
@@ -16,6 +16,7 @@
package com.android.cellbroadcastreceiver;
+import android.content.Context;
import android.content.res.Resources;
import android.os.Bundle;
import android.preference.ListPreference;
@@ -25,6 +26,8 @@
import android.preference.PreferenceFragment;
import android.preference.PreferenceScreen;
import android.provider.Settings;
+import android.telephony.TelephonyManager;
+import android.util.Log;
/**
* Settings activity for the cell broadcast receiver.
@@ -163,7 +166,14 @@
findPreference(KEY_ENABLE_CMAS_SEVERE_THREAT_ALERTS));
alertCategory.removePreference(findPreference(KEY_ENABLE_CMAS_AMBER_ALERTS));
}
- if (!res.getBoolean(R.bool.show_brazil_settings)) {
+
+ TelephonyManager tm = (TelephonyManager) getActivity().getSystemService(
+ Context.TELEPHONY_SERVICE);
+
+ boolean enableChannel50Support = res.getBoolean(R.bool.show_brazil_settings) ||
+ "br".equals(tm.getSimCountryIso());
+
+ if (!enableChannel50Support) {
preferenceScreen.removePreference(findPreference(KEY_CATEGORY_BRAZIL_SETTINGS));
}
if (!enableDevSettings) {
diff --git a/tests/res/layout/test_buttons.xml b/tests/res/layout/test_buttons.xml
index 96103cb..4486433 100644
--- a/tests/res/layout/test_buttons.xml
+++ b/tests/res/layout/test_buttons.xml
@@ -42,6 +42,23 @@
</LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal">
+
+ <TextView android:id="@+id/category_id_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/category_id_label" />
+
+ <EditText android:id="@+id/category_id"
+ android:layout_width="80dp"
+ android:layout_height="wrap_content"
+ android:inputType="number" />
+
+ </LinearLayout>
+
<CheckBox android:id="@+id/button_delay_broadcast"
android:text="@string/button_delay_broadcast"
android:layout_marginLeft="20dp"
diff --git a/tests/res/values-af/strings.xml b/tests/res/values-af/strings.xml
index ac61760..4279e6c 100644
--- a/tests/res/values-af/strings.xml
+++ b/tests/res/values-af/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Stuur UMTS-UC-2 met taal"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Vertraag met 5 sekondes voordat gestuur word"</string>
<string name="message_id_label" msgid="4365322663037110887">"Boodskap-ID:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategorie:"</string>
</resources>
diff --git a/tests/res/values-am/strings.xml b/tests/res/values-am/strings.xml
index a011c2e..6fb42dc 100644
--- a/tests/res/values-am/strings.xml
+++ b/tests/res/values-am/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"UMTS UCS-2 በቋንቋ ላክ"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"ከመላኩ በፊት 5 ሰከንዶች አዘግይ"</string>
<string name="message_id_label" msgid="4365322663037110887">"የመልዕክት መታወቂያ፦"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"ምድብ፦"</string>
</resources>
diff --git a/tests/res/values-ar/strings.xml b/tests/res/values-ar/strings.xml
index 6c3b3f6..3e7ef5b 100644
--- a/tests/res/values-ar/strings.xml
+++ b/tests/res/values-ar/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"إرسال كود النظام العالمي لاتصالات الجوال عن بعد (UMTS) UCS-2 مع اللغة"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"التأخير 5 ثوانٍ قبل الإرسال"</string>
<string name="message_id_label" msgid="4365322663037110887">"معرف الرسالة:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"الفئة:"</string>
</resources>
diff --git a/tests/res/values-be/strings.xml b/tests/res/values-be/strings.xml
index a0d9275..6c4dcfc 100644
--- a/tests/res/values-be/strings.xml
+++ b/tests/res/values-be/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Адправіць UMTS UCS-2 на мове"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Затрымка 5 секунд перад адпраўкай"</string>
<string name="message_id_label" msgid="4365322663037110887">"Ідэнтыфікатар паведамлення:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Катэгорыя:"</string>
</resources>
diff --git a/tests/res/values-bg/strings.xml b/tests/res/values-bg/strings.xml
index 6d1a520..734bc81 100644
--- a/tests/res/values-bg/strings.xml
+++ b/tests/res/values-bg/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Изпращане на SMS в UCS-2 на даден език чрез универсална мобилна телекомуникационна услуга (UMTS)"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"5-секундно забавяне преди изпращане"</string>
<string name="message_id_label" msgid="4365322663037110887">"Идент. № на съобщението:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Категория:"</string>
</resources>
diff --git a/tests/res/values-ca/strings.xml b/tests/res/values-ca/strings.xml
index b0d7ef5..1236037 100644
--- a/tests/res/values-ca/strings.xml
+++ b/tests/res/values-ca/strings.xml
@@ -41,4 +41,6 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Envia UMTS UCS-2 amb idioma"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Retarda 5 segons abans d\'enviar"</string>
<string name="message_id_label" msgid="4365322663037110887">"Id. del missatge:"</string>
+ <!-- no translation found for category_id_label (8472814003810180738) -->
+ <skip />
</resources>
diff --git a/tests/res/values-cs/strings.xml b/tests/res/values-cs/strings.xml
index d2c12a0..0d0c2e3 100644
--- a/tests/res/values-cs/strings.xml
+++ b/tests/res/values-cs/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Odeslat UMTS (UCS-2) s jazykem"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Před odesláním prodleva 5 sekund"</string>
<string name="message_id_label" msgid="4365322663037110887">"ID zprávy:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategorie:"</string>
</resources>
diff --git a/tests/res/values-da/strings.xml b/tests/res/values-da/strings.xml
index 231422b..2a22682 100644
--- a/tests/res/values-da/strings.xml
+++ b/tests/res/values-da/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Send GSM UCS-2 With Language"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Vent 5 sekunder, før du sender"</string>
<string name="message_id_label" msgid="4365322663037110887">"Meddelelses-id:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategori:"</string>
</resources>
diff --git a/tests/res/values-de/strings.xml b/tests/res/values-de/strings.xml
index 8067c5d..e975dd7 100644
--- a/tests/res/values-de/strings.xml
+++ b/tests/res/values-de/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"UMTS UCS-2 - mit Sprache senden"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"5 Sekunden Verzögerung vor dem Senden"</string>
<string name="message_id_label" msgid="4365322663037110887">"Nachrichten-ID:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategorie:"</string>
</resources>
diff --git a/tests/res/values-el/strings.xml b/tests/res/values-el/strings.xml
index cdb3703..65c2d8c 100644
--- a/tests/res/values-el/strings.xml
+++ b/tests/res/values-el/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Αποστολή UMTS UCS-2 With Language"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Καθυστέρηση 5 δευτερόλεπτα πριν από την αποστολή"</string>
<string name="message_id_label" msgid="4365322663037110887">"Αναγνωριστικό μηνύματος:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Κατηγορία:"</string>
</resources>
diff --git a/tests/res/values-en-rGB/strings.xml b/tests/res/values-en-rGB/strings.xml
index b571708..dd5e082 100644
--- a/tests/res/values-en-rGB/strings.xml
+++ b/tests/res/values-en-rGB/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Send UMTS UCS-2 With Language"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Delay 5 seconds before sending"</string>
<string name="message_id_label" msgid="4365322663037110887">"Message-ID:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Category:"</string>
</resources>
diff --git a/tests/res/values-es-rUS/strings.xml b/tests/res/values-es-rUS/strings.xml
index ec0f45b..638e4af 100644
--- a/tests/res/values-es-rUS/strings.xml
+++ b/tests/res/values-es-rUS/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Enviar UMTS UCS-2 con idioma"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Retrasar 5 segundos antes de enviar"</string>
<string name="message_id_label" msgid="4365322663037110887">"ID de mensaje:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Categoría:"</string>
</resources>
diff --git a/tests/res/values-es/strings.xml b/tests/res/values-es/strings.xml
index e0a155e..1377517 100644
--- a/tests/res/values-es/strings.xml
+++ b/tests/res/values-es/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Enviar UMTS UCS-2 con idioma"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Retrasar 5 segundos antes de enviar"</string>
<string name="message_id_label" msgid="4365322663037110887">"ID de mensaje:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Categoría:"</string>
</resources>
diff --git a/tests/res/values-et/strings.xml b/tests/res/values-et/strings.xml
index 0c703da..f2e57d4 100644
--- a/tests/res/values-et/strings.xml
+++ b/tests/res/values-et/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Saada UMTS UCS-2 koos keelega"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Viivita 5 sekundit enne saatmist"</string>
<string name="message_id_label" msgid="4365322663037110887">"Sõnumi ID:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategooria:"</string>
</resources>
diff --git a/tests/res/values-fa/strings.xml b/tests/res/values-fa/strings.xml
index 7632c86..1c4ce5d 100644
--- a/tests/res/values-fa/strings.xml
+++ b/tests/res/values-fa/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"ارسال UMTS UCS-2 با زبان"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"۵ ثانیه تأخیر قبل از ارسال"</string>
<string name="message_id_label" msgid="4365322663037110887">"شناسه پیام:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"دسته:"</string>
</resources>
diff --git a/tests/res/values-fi/strings.xml b/tests/res/values-fi/strings.xml
index ad7c998..4af0776 100644
--- a/tests/res/values-fi/strings.xml
+++ b/tests/res/values-fi/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Lähetä GSM UCS-2 kielellä"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"5 sekunnin viive ennen lähettämistä"</string>
<string name="message_id_label" msgid="4365322663037110887">"Viestin tunnus:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Luokka:"</string>
</resources>
diff --git a/tests/res/values-fr/strings.xml b/tests/res/values-fr/strings.xml
index 9b19526..3a51385 100644
--- a/tests/res/values-fr/strings.xml
+++ b/tests/res/values-fr/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Envoyer en UMTS UCS-2 avec le langage"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Retarder l\'envoi de cinq secondes"</string>
<string name="message_id_label" msgid="4365322663037110887">"Identifiant du message :"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Catégorie :"</string>
</resources>
diff --git a/tests/res/values-hi/strings.xml b/tests/res/values-hi/strings.xml
index a859bc6..245902e 100644
--- a/tests/res/values-hi/strings.xml
+++ b/tests/res/values-hi/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"भाषा के साथ UMTS UCS-2 भेजें"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"भेजने से पहले 5 सेकंड का विलंब रखें"</string>
<string name="message_id_label" msgid="4365322663037110887">"संदेश ID:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"श्रेणी:"</string>
</resources>
diff --git a/tests/res/values-hr/strings.xml b/tests/res/values-hr/strings.xml
index 7272709..9588aa6 100644
--- a/tests/res/values-hr/strings.xml
+++ b/tests/res/values-hr/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Pošalji UMTS UCS-2 s jezikom"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Odgodi slanje za 5 sekundi"</string>
<string name="message_id_label" msgid="4365322663037110887">"ID poruke:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategorija:"</string>
</resources>
diff --git a/tests/res/values-hu/strings.xml b/tests/res/values-hu/strings.xml
index 75a42b3..fbcd971 100644
--- a/tests/res/values-hu/strings.xml
+++ b/tests/res/values-hu/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"UMTS UCS-2 küldése nyelvvel együtt"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"5 másodperces késleltetés küldés előtt"</string>
<string name="message_id_label" msgid="4365322663037110887">"Üzenetazonosító:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategória:"</string>
</resources>
diff --git a/tests/res/values-in/strings.xml b/tests/res/values-in/strings.xml
index 67f1c3a..ac87940 100644
--- a/tests/res/values-in/strings.xml
+++ b/tests/res/values-in/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Kirim UMTS UCS-2 Dengan Bahasa"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Tunda 5 detik sebelum mengirim"</string>
<string name="message_id_label" msgid="4365322663037110887">"ID Pesan:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategori:"</string>
</resources>
diff --git a/tests/res/values-it/strings.xml b/tests/res/values-it/strings.xml
index 1be65c4..ade32d4 100644
--- a/tests/res/values-it/strings.xml
+++ b/tests/res/values-it/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Invia UMTS UCS-2 con lingua"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Ritarda 5 secondi prima di inviare"</string>
<string name="message_id_label" msgid="4365322663037110887">"ID messaggio:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Categoria:"</string>
</resources>
diff --git a/tests/res/values-iw/strings.xml b/tests/res/values-iw/strings.xml
index 4daf73d..b57a139 100644
--- a/tests/res/values-iw/strings.xml
+++ b/tests/res/values-iw/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"שלח UMTS UCS-2 עם שפה"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"עיכוב של 5 שניות לפני שליחה"</string>
<string name="message_id_label" msgid="4365322663037110887">"מזהה הודעה:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"קטגוריה:"</string>
</resources>
diff --git a/tests/res/values-ja/strings.xml b/tests/res/values-ja/strings.xml
index 36ce498..ef764d6 100644
--- a/tests/res/values-ja/strings.xml
+++ b/tests/res/values-ja/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"言語と共にUMTS UCS-2を送信"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"送信を5秒遅らせる"</string>
<string name="message_id_label" msgid="4365322663037110887">"メッセージID:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"カテゴリ:"</string>
</resources>
diff --git a/tests/res/values-ko/strings.xml b/tests/res/values-ko/strings.xml
index 1e3640c..2899375 100644
--- a/tests/res/values-ko/strings.xml
+++ b/tests/res/values-ko/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"언어와 UMTS UCS-2 보내기"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"보내기 전에 5초 지연"</string>
<string name="message_id_label" msgid="4365322663037110887">"메시지 ID:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"카테고리:"</string>
</resources>
diff --git a/tests/res/values-lt/strings.xml b/tests/res/values-lt/strings.xml
index 7662d4a..f78381d 100644
--- a/tests/res/values-lt/strings.xml
+++ b/tests/res/values-lt/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Siųsti UMTS UCS-2 su kalba"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Atidėti 5 sek. prieš siunčiant"</string>
<string name="message_id_label" msgid="4365322663037110887">"Pranešimo ID:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategorija:"</string>
</resources>
diff --git a/tests/res/values-lv/strings.xml b/tests/res/values-lv/strings.xml
index f7fba62..5c86b5e 100644
--- a/tests/res/values-lv/strings.xml
+++ b/tests/res/values-lv/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Sūtīt UMTS UCS-2 formātā, ar valodu"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Pirms nosūtīšanas aizkavēt 5 sekundes"</string>
<string name="message_id_label" msgid="4365322663037110887">"Ziņojuma ID:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategorija:"</string>
</resources>
diff --git a/tests/res/values-ms/strings.xml b/tests/res/values-ms/strings.xml
index 016e580..e079f80 100644
--- a/tests/res/values-ms/strings.xml
+++ b/tests/res/values-ms/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Hantar UMTS UCS-2 Dengan Bahasa"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Lengah 5 saat sebelum menghantar"</string>
<string name="message_id_label" msgid="4365322663037110887">"ID Mesej:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategori:"</string>
</resources>
diff --git a/tests/res/values-nb/strings.xml b/tests/res/values-nb/strings.xml
index 31a0372..dd4178f 100644
--- a/tests/res/values-nb/strings.xml
+++ b/tests/res/values-nb/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Send UMTS UCS-2 med språk"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Send etter en fem sekunders forsinkelse"</string>
<string name="message_id_label" msgid="4365322663037110887">"Meldings-ID:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategori:"</string>
</resources>
diff --git a/tests/res/values-nl/strings.xml b/tests/res/values-nl/strings.xml
index 04abd72..a3c046c 100644
--- a/tests/res/values-nl/strings.xml
+++ b/tests/res/values-nl/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"UMTS UCS-2 met taal sturen"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Vertraging van vijf seconden voor verzending"</string>
<string name="message_id_label" msgid="4365322663037110887">"Bericht-ID:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Categorie:"</string>
</resources>
diff --git a/tests/res/values-pl/strings.xml b/tests/res/values-pl/strings.xml
index af770f7..5e7a5b7 100644
--- a/tests/res/values-pl/strings.xml
+++ b/tests/res/values-pl/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Wyślij UMTS UCS-2 z kodem języka"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Opóźnienie 5 sekund przed wysłaniem"</string>
<string name="message_id_label" msgid="4365322663037110887">"Identyfikator wiadomości:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategoria:"</string>
</resources>
diff --git a/tests/res/values-pt-rPT/strings.xml b/tests/res/values-pt-rPT/strings.xml
index 637fa0b..16b999e 100644
--- a/tests/res/values-pt-rPT/strings.xml
+++ b/tests/res/values-pt-rPT/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Enviar UCS-2 UMTS com Linguagem"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Atrasar 5 segundos antes de enviar"</string>
<string name="message_id_label" msgid="4365322663037110887">"ID da Mensagem:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Categoria:"</string>
</resources>
diff --git a/tests/res/values-pt/strings.xml b/tests/res/values-pt/strings.xml
index 347892b..5db0a51 100644
--- a/tests/res/values-pt/strings.xml
+++ b/tests/res/values-pt/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Enviar UMTS UCS-2 com idioma"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Demorar cinco segundos antes de enviar"</string>
<string name="message_id_label" msgid="4365322663037110887">"ID da mensagem:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Categoria:"</string>
</resources>
diff --git a/tests/res/values-ro/strings.xml b/tests/res/values-ro/strings.xml
index 6ef0934..49db7e8 100644
--- a/tests/res/values-ro/strings.xml
+++ b/tests/res/values-ro/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Trimiteţi un mesaj UMTS UCS-2 în care să precizaţi limba"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Întârziaţi 5 secunde înaintea trimiterii"</string>
<string name="message_id_label" msgid="4365322663037110887">"ID-ul mesajului:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Categorie:"</string>
</resources>
diff --git a/tests/res/values-ru/strings.xml b/tests/res/values-ru/strings.xml
index 9dd2799..3c1d34c 100644
--- a/tests/res/values-ru/strings.xml
+++ b/tests/res/values-ru/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Отправить UMTS-сообщение UCS-2 с языком"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Задержка перед отправкой 5 секунд"</string>
<string name="message_id_label" msgid="4365322663037110887">"Идентификатор сообщения:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Категория:"</string>
</resources>
diff --git a/tests/res/values-sk/strings.xml b/tests/res/values-sk/strings.xml
index 73993e4..5134b7a 100644
--- a/tests/res/values-sk/strings.xml
+++ b/tests/res/values-sk/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Odoslať UMTS UCS-2 s jazykom"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Pred odoslaním oneskoriť o 5 s"</string>
<string name="message_id_label" msgid="4365322663037110887">"ID správy:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategória:"</string>
</resources>
diff --git a/tests/res/values-sl/strings.xml b/tests/res/values-sl/strings.xml
index 7bbf81b..5f920d3 100644
--- a/tests/res/values-sl/strings.xml
+++ b/tests/res/values-sl/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Pošlji UMTS UCS-2 z jezikom"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Pred pošiljanjem počakaj 5 sekund"</string>
<string name="message_id_label" msgid="4365322663037110887">"ID sporočila:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategorija:"</string>
</resources>
diff --git a/tests/res/values-sr/strings.xml b/tests/res/values-sr/strings.xml
index e28de39..900b288 100644
--- a/tests/res/values-sr/strings.xml
+++ b/tests/res/values-sr/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Пошаљи UMTS UCS-2 са језиком"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Кашњење од пет секунди пре слања"</string>
<string name="message_id_label" msgid="4365322663037110887">"ИД поруке:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Категорија:"</string>
</resources>
diff --git a/tests/res/values-sv/strings.xml b/tests/res/values-sv/strings.xml
index 70b3183..0596156 100644
--- a/tests/res/values-sv/strings.xml
+++ b/tests/res/values-sv/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Skicka UMTS UCS-2 med språk"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Fördröj 5 sekunder före sändning"</string>
<string name="message_id_label" msgid="4365322663037110887">"Meddelande-ID:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategori:"</string>
</resources>
diff --git a/tests/res/values-sw/strings.xml b/tests/res/values-sw/strings.xml
index add354b..adecd5d 100644
--- a/tests/res/values-sw/strings.xml
+++ b/tests/res/values-sw/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Tuma UMTS UCS-2 na Lugha"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Chelewesha sekunde 5 kabla ya kutuma"</string>
<string name="message_id_label" msgid="4365322663037110887">"Kitambulisho cha Ujumbe:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kitengo:"</string>
</resources>
diff --git a/tests/res/values-th/strings.xml b/tests/res/values-th/strings.xml
index 7d3d941..b43dd7e 100644
--- a/tests/res/values-th/strings.xml
+++ b/tests/res/values-th/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"ส่ง UMTS UCS-2 ด้วยภาษา"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"หน่วงเวลา 5 วินาทีก่อนที่จะส่ง"</string>
<string name="message_id_label" msgid="4365322663037110887">"รหัสข้อความ:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"หมวดหมู่:"</string>
</resources>
diff --git a/tests/res/values-tl/strings.xml b/tests/res/values-tl/strings.xml
index 4273d64..dece3b4 100644
--- a/tests/res/values-tl/strings.xml
+++ b/tests/res/values-tl/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Ipadala ang UMTS UCS-2 With Language"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Iantala ng 5 segundo bago ipadala"</string>
<string name="message_id_label" msgid="4365322663037110887">"ID ng Mensahe:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategorya:"</string>
</resources>
diff --git a/tests/res/values-tr/strings.xml b/tests/res/values-tr/strings.xml
index 85d7384..20f01f4 100644
--- a/tests/res/values-tr/strings.xml
+++ b/tests/res/values-tr/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"UMTS UCS-2\'yi Dil Koduyla gönder"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Göndermeden önce 5 saniye beklet"</string>
<string name="message_id_label" msgid="4365322663037110887">"Mesaj Kimliği:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Kategori:"</string>
</resources>
diff --git a/tests/res/values-uk/strings.xml b/tests/res/values-uk/strings.xml
index 9d5d0eb..13071aa 100644
--- a/tests/res/values-uk/strings.xml
+++ b/tests/res/values-uk/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Надіслати UMTS-повідомлення з кодуванням UCS-2 для мови"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Затримка 5 секунд перед надсиланням"</string>
<string name="message_id_label" msgid="4365322663037110887">"Ідентифікатор повідомлення:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Категорія:"</string>
</resources>
diff --git a/tests/res/values-vi/strings.xml b/tests/res/values-vi/strings.xml
index ccd8a5c..a55c241 100644
--- a/tests/res/values-vi/strings.xml
+++ b/tests/res/values-vi/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Gửi UMTS UCS-2 có ngôn ngữ"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Trễ 5 giây trước khi gửi"</string>
<string name="message_id_label" msgid="4365322663037110887">"ID thư:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Danh mục:"</string>
</resources>
diff --git a/tests/res/values-zh-rCN/strings.xml b/tests/res/values-zh-rCN/strings.xml
index 656c8c0..fca084b 100644
--- a/tests/res/values-zh-rCN/strings.xml
+++ b/tests/res/values-zh-rCN/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"发送特定语言的 UMTS UCS-2 编码信息"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"延迟 5 秒后发送"</string>
<string name="message_id_label" msgid="4365322663037110887">"讯息 ID:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"类别:"</string>
</resources>
diff --git a/tests/res/values-zh-rTW/strings.xml b/tests/res/values-zh-rTW/strings.xml
index 5f944db..c4e24d0 100644
--- a/tests/res/values-zh-rTW/strings.xml
+++ b/tests/res/values-zh-rTW/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"傳送特定語言的 UMTS UCS-2 訊息"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"傳送前延遲 5 秒"</string>
<string name="message_id_label" msgid="4365322663037110887">"訊息編號:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"類別:"</string>
</resources>
diff --git a/tests/res/values-zu/strings.xml b/tests/res/values-zu/strings.xml
index ad0d3c8..8eb5697 100644
--- a/tests/res/values-zu/strings.xml
+++ b/tests/res/values-zu/strings.xml
@@ -41,4 +41,5 @@
<string name="button_gsm_ucs2_with_language_umts_type" msgid="1080788762601688380">"Thumela i-UMTS UCS-2 Ngezilimi"</string>
<string name="button_delay_broadcast" msgid="5138650276363839541">"Yephuza ngamasekhondi angu-5 ngaphambi kokuthumela"</string>
<string name="message_id_label" msgid="4365322663037110887">"I-ID yomlayezo:"</string>
+ <string name="category_id_label" msgid="8472814003810180738">"Isigaba:"</string>
</resources>
diff --git a/tests/res/values/strings.xml b/tests/res/values/strings.xml
index b1b1031..08560ac 100644
--- a/tests/res/values/strings.xml
+++ b/tests/res/values/strings.xml
@@ -40,4 +40,5 @@
<string name="button_gsm_ucs2_with_language_umts_type">Send UMTS UCS-2 With Language</string>
<string name="button_delay_broadcast">Delay 5 seconds before sending</string>
<string name="message_id_label">Message ID:</string>
+ <string name="category_id_label">Category:</string>
</resources>
diff --git a/tests/src/com/android/cellbroadcastreceiver/tests/SendTestBroadcastActivity.java b/tests/src/com/android/cellbroadcastreceiver/tests/SendTestBroadcastActivity.java
index f47ffd2..ca5a2a0 100644
--- a/tests/src/com/android/cellbroadcastreceiver/tests/SendTestBroadcastActivity.java
+++ b/tests/src/com/android/cellbroadcastreceiver/tests/SendTestBroadcastActivity.java
@@ -72,6 +72,15 @@
}
/**
+ * Return the value of the category field.
+ * @return the current value of the category text field
+ */
+ private int getCategory() {
+ EditText categoryField = (EditText) findViewById(R.id.category_id);
+ return Integer.parseInt(categoryField.getText().toString());
+ }
+
+ /**
* Initialization of the Activity after it is first created. Must at least
* call {@link android.app.Activity#setContentView(int)} to
* describe what is to be displayed in the screen.
@@ -85,7 +94,11 @@
/* Set message ID to a random value from 1-65535. */
EditText messageIdField = (EditText) findViewById(R.id.message_id);
messageIdField.setText(String.valueOf(new Random().nextInt(65535) + 1));
-
+
+ /* When category ID is non-zero, use it for the GSM/UMTS message identifier. */
+ EditText categoryIdField = (EditText) findViewById(R.id.category_id);
+ categoryIdField.setText("0");
+
/* Send an ETWS normal broadcast message to app. */
Button etwsNormalTypeButton = (Button) findViewById(R.id.button_etws_normal_type);
etwsNormalTypeButton.setOnClickListener(new OnClickListener() {
@@ -94,7 +107,8 @@
Message msg = mDelayHandler.obtainMessage(0, this);
mDelayHandler.sendMessageDelayed(msg, DELAY_BEFORE_SENDING_MSEC);
} else {
- SendTestMessages.testSendEtwsMessageNormal(SendTestBroadcastActivity.this);
+ SendTestMessages.testSendEtwsMessageNormal(SendTestBroadcastActivity.this,
+ getMessageId());
}
}
});
@@ -107,7 +121,8 @@
Message msg = mDelayHandler.obtainMessage(0, this);
mDelayHandler.sendMessageDelayed(msg, DELAY_BEFORE_SENDING_MSEC);
} else {
- SendTestMessages.testSendEtwsMessageCancel(SendTestBroadcastActivity.this);
+ SendTestMessages.testSendEtwsMessageCancel(SendTestBroadcastActivity.this,
+ getMessageId());
}
}
});
@@ -120,7 +135,8 @@
Message msg = mDelayHandler.obtainMessage(0, this);
mDelayHandler.sendMessageDelayed(msg, DELAY_BEFORE_SENDING_MSEC);
} else {
- SendTestMessages.testSendEtwsMessageTest(SendTestBroadcastActivity.this);
+ SendTestMessages.testSendEtwsMessageTest(SendTestBroadcastActivity.this,
+ getMessageId());
}
}
});
@@ -203,7 +219,8 @@
Message msg = mDelayHandler.obtainMessage(0, this);
mDelayHandler.sendMessageDelayed(msg, DELAY_BEFORE_SENDING_MSEC);
} else {
- SendTestMessages.testSendMessage7bit(SendTestBroadcastActivity.this);
+ SendTestMessages.testSendMessage7bit(SendTestBroadcastActivity.this,
+ getMessageId(), getCategory());
}
}
});
@@ -216,7 +233,8 @@
Message msg = mDelayHandler.obtainMessage(0, this);
mDelayHandler.sendMessageDelayed(msg, DELAY_BEFORE_SENDING_MSEC);
} else {
- SendTestMessages.testSendMessage7bitUmts(SendTestBroadcastActivity.this);
+ SendTestMessages.testSendMessage7bitUmts(SendTestBroadcastActivity.this,
+ getMessageId(), getCategory());
}
}
});
@@ -229,7 +247,8 @@
Message msg = mDelayHandler.obtainMessage(0, this);
mDelayHandler.sendMessageDelayed(msg, DELAY_BEFORE_SENDING_MSEC);
} else {
- SendTestMessages.testSendMessage7bitNoPadding(SendTestBroadcastActivity.this);
+ SendTestMessages.testSendMessage7bitNoPadding(SendTestBroadcastActivity.this,
+ getMessageId(), getCategory());
}
}
});
@@ -243,7 +262,8 @@
Message msg = mDelayHandler.obtainMessage(0, this);
mDelayHandler.sendMessageDelayed(msg, DELAY_BEFORE_SENDING_MSEC);
} else {
- SendTestMessages.testSendMessage7bitNoPaddingUmts(SendTestBroadcastActivity.this);
+ SendTestMessages.testSendMessage7bitNoPaddingUmts(
+ SendTestBroadcastActivity.this, getMessageId(), getCategory());
}
}
});
@@ -257,7 +277,8 @@
Message msg = mDelayHandler.obtainMessage(0, this);
mDelayHandler.sendMessageDelayed(msg, DELAY_BEFORE_SENDING_MSEC);
} else {
- SendTestMessages.testSendMessage7bitMultipageGsm(SendTestBroadcastActivity.this);
+ SendTestMessages.testSendMessage7bitMultipageGsm(SendTestBroadcastActivity.this,
+ getMessageId(), getCategory());
}
}
});
@@ -271,7 +292,8 @@
Message msg = mDelayHandler.obtainMessage(0, this);
mDelayHandler.sendMessageDelayed(msg, DELAY_BEFORE_SENDING_MSEC);
} else {
- SendTestMessages.testSendMessage7bitMultipageUmts(SendTestBroadcastActivity.this);
+ SendTestMessages.testSendMessage7bitMultipageUmts(
+ SendTestBroadcastActivity.this, getMessageId(), getCategory());
}
}
});
@@ -285,7 +307,8 @@
Message msg = mDelayHandler.obtainMessage(0, this);
mDelayHandler.sendMessageDelayed(msg, DELAY_BEFORE_SENDING_MSEC);
} else {
- SendTestMessages.testSendMessage7bitWithLanguage(SendTestBroadcastActivity.this);
+ SendTestMessages.testSendMessage7bitWithLanguage(SendTestBroadcastActivity.this,
+ getMessageId(), getCategory());
}
}
});
@@ -300,7 +323,7 @@
mDelayHandler.sendMessageDelayed(msg, DELAY_BEFORE_SENDING_MSEC);
} else {
SendTestMessages.testSendMessage7bitWithLanguageInBody(
- SendTestBroadcastActivity.this);
+ SendTestBroadcastActivity.this, getMessageId(), getCategory());
}
}
});
@@ -314,7 +337,8 @@
Message msg = mDelayHandler.obtainMessage(0, this);
mDelayHandler.sendMessageDelayed(msg, DELAY_BEFORE_SENDING_MSEC);
} else {
- SendTestMessages.testSendMessage7bitWithLanguageInBodyUmts(SendTestBroadcastActivity.this);
+ SendTestMessages.testSendMessage7bitWithLanguageInBodyUmts(
+ SendTestBroadcastActivity.this, getMessageId(), getCategory());
}
}
});
@@ -327,7 +351,8 @@
Message msg = mDelayHandler.obtainMessage(0, this);
mDelayHandler.sendMessageDelayed(msg, DELAY_BEFORE_SENDING_MSEC);
} else {
- SendTestMessages.testSendMessageUcs2(SendTestBroadcastActivity.this);
+ SendTestMessages.testSendMessageUcs2(SendTestBroadcastActivity.this,
+ getMessageId(), getCategory());
}
}
});
@@ -340,7 +365,8 @@
Message msg = mDelayHandler.obtainMessage(0, this);
mDelayHandler.sendMessageDelayed(msg, DELAY_BEFORE_SENDING_MSEC);
} else {
- SendTestMessages.testSendMessageUcs2Umts(SendTestBroadcastActivity.this);
+ SendTestMessages.testSendMessageUcs2Umts(SendTestBroadcastActivity.this,
+ getMessageId(), getCategory());
}
}
});
@@ -354,7 +380,8 @@
Message msg = mDelayHandler.obtainMessage(0, this);
mDelayHandler.sendMessageDelayed(msg, DELAY_BEFORE_SENDING_MSEC);
} else {
- SendTestMessages.testSendMessageUcs2MultipageUmts(SendTestBroadcastActivity.this);
+ SendTestMessages.testSendMessageUcs2MultipageUmts(
+ SendTestBroadcastActivity.this, getMessageId(), getCategory());
}
}
});
@@ -368,7 +395,8 @@
Message msg = mDelayHandler.obtainMessage(0, this);
mDelayHandler.sendMessageDelayed(msg, DELAY_BEFORE_SENDING_MSEC);
} else {
- SendTestMessages.testSendMessageUcs2WithLanguageInBody(SendTestBroadcastActivity.this);
+ SendTestMessages.testSendMessageUcs2WithLanguageInBody(
+ SendTestBroadcastActivity.this, getMessageId(), getCategory());
}
}
});
@@ -382,7 +410,8 @@
Message msg = mDelayHandler.obtainMessage(0, this);
mDelayHandler.sendMessageDelayed(msg, DELAY_BEFORE_SENDING_MSEC);
} else {
- SendTestMessages.testSendMessageUcs2WithLanguageUmts(SendTestBroadcastActivity.this);
+ SendTestMessages.testSendMessageUcs2WithLanguageUmts(
+ SendTestBroadcastActivity.this, getMessageId(), getCategory());
}
}
});
diff --git a/tests/src/com/android/cellbroadcastreceiver/tests/SendTestMessages.java b/tests/src/com/android/cellbroadcastreceiver/tests/SendTestMessages.java
index e634b23..e85299d 100644
--- a/tests/src/com/android/cellbroadcastreceiver/tests/SendTestMessages.java
+++ b/tests/src/com/android/cellbroadcastreceiver/tests/SendTestMessages.java
@@ -57,7 +57,7 @@
"00000000000000000000000000000000000000000000");
private static final byte[] gsm7BitTest = {
- (byte)0xC0, (byte)0x00, (byte)0x00, (byte)0x32, (byte)0x40, (byte)0x11, (byte)0x41,
+ (byte)0xC0, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x40, (byte)0x11, (byte)0x41,
(byte)0xD0, (byte)0x71, (byte)0xDA, (byte)0x04, (byte)0x91, (byte)0xCB, (byte)0xE6,
(byte)0x70, (byte)0x9D, (byte)0x4D, (byte)0x07, (byte)0x85, (byte)0xD9, (byte)0x70,
(byte)0x74, (byte)0x58, (byte)0x5C, (byte)0xA6, (byte)0x83, (byte)0xDA, (byte)0xE5,
@@ -73,7 +73,7 @@
};
private static final byte[] gsm7BitTestUmts = {
- (byte)0x01, (byte)0x00, (byte)0x32, (byte)0xC0, (byte)0x00, (byte)0x40,
+ (byte)0x01, (byte)0x00, (byte)0x01, (byte)0xC0, (byte)0x00, (byte)0x40,
(byte)0x01,
@@ -172,7 +172,7 @@
};
private static final byte[] gsm7BitTestNoPadding = {
- (byte)0xC0, (byte)0x00, (byte)0x00, (byte)0x32, (byte)0x40, (byte)0x11, (byte)0x41,
+ (byte)0xC0, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x40, (byte)0x11, (byte)0x41,
(byte)0xD0, (byte)0x71, (byte)0xDA, (byte)0x04, (byte)0x91, (byte)0xCB, (byte)0xE6,
(byte)0x70, (byte)0x9D, (byte)0x4D, (byte)0x07, (byte)0x85, (byte)0xD9, (byte)0x70,
(byte)0x74, (byte)0x58, (byte)0x5C, (byte)0xA6, (byte)0x83, (byte)0xDA, (byte)0xE5,
@@ -188,7 +188,7 @@
};
private static final byte[] gsm7BitTestNoPaddingUmts = {
- (byte)0x01, (byte)0x00, (byte)0x32, (byte)0xC0, (byte)0x00, (byte)0x40,
+ (byte)0x01, (byte)0x00, (byte)0x01, (byte)0xC0, (byte)0x00, (byte)0x40,
(byte)0x01,
@@ -211,7 +211,7 @@
};
private static final byte[] gsm7BitTestWithLanguage = {
- (byte)0xC0, (byte)0x00, (byte)0x00, (byte)0x32, (byte)0x04, (byte)0x11, (byte)0x41,
+ (byte)0xC0, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x04, (byte)0x11, (byte)0x41,
(byte)0xD0, (byte)0x71, (byte)0xDA, (byte)0x04, (byte)0x91, (byte)0xCB, (byte)0xE6,
(byte)0x70, (byte)0x9D, (byte)0x4D, (byte)0x07, (byte)0x85, (byte)0xD9, (byte)0x70,
(byte)0x74, (byte)0x58, (byte)0x5C, (byte)0xA6, (byte)0x83, (byte)0xDA, (byte)0xE5,
@@ -227,7 +227,7 @@
};
private static final byte[] gsm7BitTestWithLanguageInBody = {
- (byte)0xC0, (byte)0x00, (byte)0x00, (byte)0x32, (byte)0x10, (byte)0x11, (byte)0x73,
+ (byte)0xC0, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x10, (byte)0x11, (byte)0x73,
(byte)0x7B, (byte)0x23, (byte)0x08, (byte)0x3A, (byte)0x4E, (byte)0x9B, (byte)0x20,
(byte)0x72, (byte)0xD9, (byte)0x1C, (byte)0xAE, (byte)0xB3, (byte)0xE9, (byte)0xA0,
(byte)0x30, (byte)0x1B, (byte)0x8E, (byte)0x0E, (byte)0x8B, (byte)0xCB, (byte)0x74,
@@ -243,7 +243,7 @@
};
private static final byte[] gsm7BitTestWithLanguageInBodyUmts = {
- (byte)0x01, (byte)0x00, (byte)0x32, (byte)0xC0, (byte)0x00, (byte)0x10,
+ (byte)0x01, (byte)0x00, (byte)0x01, (byte)0xC0, (byte)0x00, (byte)0x10,
(byte)0x01,
@@ -266,7 +266,7 @@
};
private static final byte[] gsmUcs2Test = {
- (byte)0xC0, (byte)0x00, (byte)0x00, (byte)0x32, (byte)0x48, (byte)0x11, (byte)0x00,
+ (byte)0xC0, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x48, (byte)0x11, (byte)0x00,
(byte)0x41, (byte)0x00, (byte)0x20, (byte)0x00, (byte)0x55, (byte)0x00, (byte)0x43,
(byte)0x00, (byte)0x53, (byte)0x00, (byte)0x32, (byte)0x00, (byte)0x20, (byte)0x00,
(byte)0x6D, (byte)0x00, (byte)0x65, (byte)0x00, (byte)0x73, (byte)0x00, (byte)0x73,
@@ -282,7 +282,7 @@
};
private static final byte[] gsmUcs2TestUmts = {
- (byte)0x01, (byte)0x00, (byte)0x32, (byte)0xC0, (byte)0x00, (byte)0x48,
+ (byte)0x01, (byte)0x00, (byte)0x01, (byte)0xC0, (byte)0x00, (byte)0x48,
(byte)0x01,
@@ -305,7 +305,7 @@
};
private static final byte[] gsmUcs2TestMultipageUmts = {
- (byte)0x01, (byte)0x00, (byte)0x32, (byte)0xC0, (byte)0x00, (byte)0x48,
+ (byte)0x01, (byte)0x00, (byte)0x01, (byte)0xC0, (byte)0x00, (byte)0x48,
(byte)0x02,
@@ -345,7 +345,7 @@
};
private static final byte[] gsmUcs2TestWithLanguageInBody = {
- (byte)0xC0, (byte)0x00, (byte)0x00, (byte)0x32, (byte)0x11, (byte)0x11, (byte)0x78,
+ (byte)0xC0, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x11, (byte)0x11, (byte)0x78,
(byte)0x3C, (byte)0x00, (byte)0x41, (byte)0x00, (byte)0x20, (byte)0x00, (byte)0x55,
(byte)0x00, (byte)0x43, (byte)0x00, (byte)0x53, (byte)0x00, (byte)0x32, (byte)0x00,
(byte)0x20, (byte)0x00, (byte)0x6D, (byte)0x00, (byte)0x65, (byte)0x00, (byte)0x73,
@@ -361,7 +361,7 @@
};
private static final byte[] gsmUcs2TestWithLanguageInBodyUmts = {
- (byte)0x01, (byte)0x00, (byte)0x32, (byte)0xC0, (byte)0x00, (byte)0x11,
+ (byte)0x01, (byte)0x00, (byte)0x01, (byte)0xC0, (byte)0x00, (byte)0x11,
(byte)0x01,
@@ -385,128 +385,161 @@
private static final SmsCbLocation sEmptyLocation = new SmsCbLocation();
- private static SmsCbMessage createFromPdu(byte[] pdu) {
+ private static SmsCbMessage createFromPdu(byte[] pdu, int serialNumber, int category) {
+ byte[][] pdus = new byte[1][];
+ pdus[0] = pdu;
+ return createFromPdus(pdus, serialNumber, category);
+ }
+
+ private static SmsCbMessage createFromPdus(byte[][] pdus, int serialNumber, int category) {
try {
- byte[][] pdus = new byte[1][];
- pdus[0] = pdu;
+ for (byte[] pdu : pdus) {
+ if (pdu.length <= 88) {
+ // GSM format cell broadcast
+ Log.d(TAG, "setting GSM serial number to " + serialNumber);
+ pdu[0] = (byte) ((serialNumber >>> 8) & 0xff);
+ pdu[1] = (byte) (serialNumber & 0xff);
+ if (category != 0) {
+ Log.d(TAG, "setting GSM message identifier to " + category);
+ pdu[2] = (byte) ((category >>> 8) & 0xff);
+ pdu[3] = (byte) (category & 0xff);
+ }
+ } else {
+ // UMTS format cell broadcast
+ Log.d(TAG, "setting UMTS serial number to " + serialNumber);
+ pdu[3] = (byte) ((serialNumber >>> 8) & 0xff);
+ pdu[4] = (byte) (serialNumber & 0xff);
+ if (category != 0) {
+ Log.d(TAG, "setting UMTS message identifier to " + category);
+ pdu[1] = (byte) ((category >>> 8) & 0xff);
+ pdu[2] = (byte) (category & 0xff);
+ }
+ }
+ }
return GsmSmsCbMessage.createSmsCbMessage(sEmptyLocation, pdus);
} catch (IllegalArgumentException e) {
return null;
}
}
- private static SmsCbMessage createFromPdus(byte[][] pdus) {
- try {
- return GsmSmsCbMessage.createSmsCbMessage(sEmptyLocation, pdus);
- } catch (IllegalArgumentException e) {
- return null;
- }
- }
-
- public static void testSendMessage7bit(Activity activity) {
+ public static void testSendMessage7bit(Activity activity, int serialNumber, int category) {
Intent intent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
- intent.putExtra("message", createFromPdu(gsm7BitTest));
+ intent.putExtra("message", createFromPdu(gsm7BitTest, serialNumber, category));
activity.sendOrderedBroadcast(intent, "android.permission.RECEIVE_SMS");
}
- public static void testSendMessage7bitUmts(Activity activity) {
+ public static void testSendMessage7bitUmts(Activity activity, int serialNumber, int category) {
Intent intent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
- intent.putExtra("message", createFromPdu(gsm7BitTestUmts));
+ intent.putExtra("message", createFromPdu(gsm7BitTestUmts, serialNumber, category));
activity.sendOrderedBroadcast(intent, "android.permission.RECEIVE_SMS");
}
- public static void testSendMessage7bitNoPadding(Activity activity) {
+ public static void testSendMessage7bitNoPadding(Activity activity, int serialNumber,
+ int category) {
Intent intent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
- intent.putExtra("message", createFromPdu(gsm7BitTestNoPadding));
+ intent.putExtra("message", createFromPdu(gsm7BitTestNoPadding, serialNumber, category));
activity.sendOrderedBroadcast(intent, "android.permission.RECEIVE_SMS");
}
- public static void testSendMessage7bitNoPaddingUmts(Activity activity) {
+ public static void testSendMessage7bitNoPaddingUmts(Activity activity, int serialNumber,
+ int category) {
Intent intent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
- intent.putExtra("message", createFromPdu(gsm7BitTestNoPaddingUmts));
+ intent.putExtra("message", createFromPdu(gsm7BitTestNoPaddingUmts, serialNumber, category));
activity.sendOrderedBroadcast(intent, "android.permission.RECEIVE_SMS");
}
- public static void testSendMessage7bitMultipageGsm(Activity activity) {
+ public static void testSendMessage7bitMultipageGsm(Activity activity, int serialNumber,
+ int category) {
Intent intent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
byte[][] pdus = new byte[2][];
pdus[0] = gsm7BitTestMultipage1;
pdus[1] = gsm7BitTestMultipage2;
- intent.putExtra("message", createFromPdus(pdus));
+ intent.putExtra("message", createFromPdus(pdus, serialNumber, category));
activity.sendOrderedBroadcast(intent, "android.permission.RECEIVE_SMS");
}
- public static void testSendMessage7bitMultipageUmts(Activity activity) {
+ public static void testSendMessage7bitMultipageUmts(Activity activity, int serialNumber,
+ int category) {
Intent intent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
- intent.putExtra("message", createFromPdu(gsm7BitTestMultipageUmts));
+ intent.putExtra("message", createFromPdu(gsm7BitTestMultipageUmts, serialNumber, category));
activity.sendOrderedBroadcast(intent, "android.permission.RECEIVE_SMS");
}
- public static void testSendMessage7bitWithLanguage(Activity activity) {
+ public static void testSendMessage7bitWithLanguage(Activity activity, int serialNumber,
+ int category) {
Intent intent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
- intent.putExtra("message", createFromPdu(gsm7BitTestWithLanguage));
+ intent.putExtra("message", createFromPdu(gsm7BitTestWithLanguage, serialNumber, category));
activity.sendOrderedBroadcast(intent, "android.permission.RECEIVE_SMS");
}
- public static void testSendMessage7bitWithLanguageInBody(Activity activity) {
+ public static void testSendMessage7bitWithLanguageInBody(Activity activity, int serialNumber,
+ int category) {
Intent intent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
- intent.putExtra("message", createFromPdu(gsm7BitTestWithLanguageInBody));
+ intent.putExtra("message", createFromPdu(gsm7BitTestWithLanguageInBody, serialNumber,
+ category));
activity.sendOrderedBroadcast(intent, "android.permission.RECEIVE_SMS");
}
- public static void testSendMessage7bitWithLanguageInBodyUmts(Activity activity) {
+ public static void testSendMessage7bitWithLanguageInBodyUmts(Activity activity,
+ int serialNumber, int category) {
Intent intent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
- intent.putExtra("message", createFromPdu(gsm7BitTestWithLanguageInBodyUmts));
+ intent.putExtra("message", createFromPdu(gsm7BitTestWithLanguageInBodyUmts, serialNumber,
+ category));
activity.sendOrderedBroadcast(intent, "android.permission.RECEIVE_SMS");
}
- public static void testSendMessageUcs2(Activity activity) {
+ public static void testSendMessageUcs2(Activity activity, int serialNumber, int category) {
Intent intent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
- intent.putExtra("message", createFromPdu(gsmUcs2Test));
+ intent.putExtra("message", createFromPdu(gsmUcs2Test, serialNumber, category));
activity.sendOrderedBroadcast(intent, "android.permission.RECEIVE_SMS");
}
- public static void testSendMessageUcs2Umts(Activity activity) {
+ public static void testSendMessageUcs2Umts(Activity activity, int serialNumber, int category) {
Intent intent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
- intent.putExtra("message", createFromPdu(gsmUcs2TestUmts));
+ intent.putExtra("message", createFromPdu(gsmUcs2TestUmts, serialNumber, category));
activity.sendOrderedBroadcast(intent, "android.permission.RECEIVE_SMS");
}
- public static void testSendMessageUcs2MultipageUmts(Activity activity) {
+ public static void testSendMessageUcs2MultipageUmts(Activity activity, int serialNumber,
+ int category) {
Intent intent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
- intent.putExtra("message", createFromPdu(gsmUcs2TestMultipageUmts));
+ intent.putExtra("message", createFromPdu(gsmUcs2TestMultipageUmts, serialNumber, category));
activity.sendOrderedBroadcast(intent, "android.permission.RECEIVE_SMS");
}
- public static void testSendMessageUcs2WithLanguageInBody(Activity activity) {
+ public static void testSendMessageUcs2WithLanguageInBody(Activity activity, int serialNumber,
+ int category) {
Intent intent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
- intent.putExtra("message", createFromPdu(gsmUcs2TestWithLanguageInBody));
+ intent.putExtra("message", createFromPdu(gsmUcs2TestWithLanguageInBody, serialNumber,
+ category));
activity.sendOrderedBroadcast(intent, "android.permission.RECEIVE_SMS");
}
- public static void testSendMessageUcs2WithLanguageUmts(Activity activity) {
+ public static void testSendMessageUcs2WithLanguageUmts(Activity activity, int serialNumber,
+ int category) {
Intent intent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
- intent.putExtra("message", createFromPdu(gsmUcs2TestWithLanguageInBodyUmts));
+ intent.putExtra("message", createFromPdu(gsmUcs2TestWithLanguageInBodyUmts, serialNumber,
+ category));
activity.sendOrderedBroadcast(intent, "android.permission.RECEIVE_SMS");
}
- public static void testSendEtwsMessageNormal(Activity activity) {
+ public static void testSendEtwsMessageNormal(Activity activity, int serialNumber) {
Intent intent = new Intent(Intents.SMS_EMERGENCY_CB_RECEIVED_ACTION);
- intent.putExtra("message", createFromPdu(etwsMessageNormal));
+ intent.putExtra("message", createFromPdu(etwsMessageNormal, serialNumber, 0));
activity.sendOrderedBroadcast(intent,
"android.permission.RECEIVE_EMERGENCY_BROADCAST");
}
- public static void testSendEtwsMessageCancel(Activity activity) {
+ public static void testSendEtwsMessageCancel(Activity activity, int serialNumber) {
Intent intent = new Intent(Intents.SMS_EMERGENCY_CB_RECEIVED_ACTION);
- intent.putExtra("message", createFromPdu(etwsMessageCancel));
+ intent.putExtra("message", createFromPdu(etwsMessageCancel, serialNumber, 0));
activity.sendOrderedBroadcast(intent,
"android.permission.RECEIVE_EMERGENCY_BROADCAST");
}
- public static void testSendEtwsMessageTest(Activity activity) {
+ public static void testSendEtwsMessageTest(Activity activity, int serialNumber) {
Intent intent = new Intent(Intents.SMS_EMERGENCY_CB_RECEIVED_ACTION);
- intent.putExtra("message", createFromPdu(etwsMessageTest));
+ intent.putExtra("message", createFromPdu(etwsMessageTest, serialNumber, 0));
activity.sendOrderedBroadcast(intent,
"android.permission.RECEIVE_EMERGENCY_BROADCAST");
}