Added auto link support
Automatic convert URL, email, and phone number in alert messages
into link.
Test: manual
bug: 35702389
Change-Id: I6ab740d6cda08601f07854f48975fe4f02c2b42e
diff --git a/res/layout/cell_broadcast_alert.xml b/res/layout/cell_broadcast_alert.xml
index a211f56..f6da51e 100644
--- a/res/layout/cell_broadcast_alert.xml
+++ b/res/layout/cell_broadcast_alert.xml
@@ -78,7 +78,8 @@
android:paddingLeft="16dip"
android:paddingRight="16dip"
android:paddingTop="8dip"
- android:paddingBottom="8dip"/>
+ android:paddingBottom="8dip"
+ android:autoLink="email|phone|web" />
</ScrollView>
</LinearLayout>
diff --git a/tests/testapp/src/com/android/cellbroadcastreceiver/tests/SendCdmaCmasMessages.java b/tests/testapp/src/com/android/cellbroadcastreceiver/tests/SendCdmaCmasMessages.java
index 112db37..4626e4f 100644
--- a/tests/testapp/src/com/android/cellbroadcastreceiver/tests/SendCdmaCmasMessages.java
+++ b/tests/testapp/src/com/android/cellbroadcastreceiver/tests/SendCdmaCmasMessages.java
@@ -25,7 +25,7 @@
import android.telephony.SmsCbCmasInfo;
import android.telephony.SmsCbLocation;
import android.telephony.SmsCbMessage;
-import com.android.internal.telephony.PhoneConstants;
+
import com.android.internal.telephony.cdma.sms.SmsEnvelope;
/**
@@ -33,9 +33,6 @@
*/
public class SendCdmaCmasMessages {
- private static final String TEST_TEXT = "This is a test CDMA cell broadcast message..."
- + "678901234567890123456789012345678901234567890";
-
private static final String PRES_ALERT =
"THE PRESIDENT HAS ISSUED AN EMERGENCY ALERT. CHECK LOCAL MEDIA FOR MORE DETAILS";
@@ -46,12 +43,11 @@
+ " - NEW JERSEY UNTIL 415 PM MST";
private static final String AMBER_ALERT =
- "AMBER ALERT:Mountain View,CA VEH'07 Blue Honda Civic CA LIC 5ABC123";
+ "AMBER ALERT:Mountain View,CA VEH'07 Blue Honda Civic CA LIC 5ABC123. "
+ + "Check https://www.amberalert.gov/active.htm for more information.";
private static final String MONTHLY_TEST_ALERT = "This is a test of the emergency alert system."
- + " This is only a test. 89012345678901234567890";
-
- private static final String IS91_TEXT = "IS91 SHORT MSG"; // max length 14 chars
+ + " This is only a test. Call (123)456-7890.";
public static void testSendCmasPresAlert(Activity activity, int messageId) {
SmsCbMessage cbMessage = createCmasSmsMessage(