---
 src/cbs.c |   35 ++++++-----------------------------
 1 files changed, 6 insertions(+), 29 deletions(-)

diff --git a/src/cbs.c b/src/cbs.c
index d99f250..36cca48 100644
--- a/src/cbs.c
+++ b/src/cbs.c
@@ -98,7 +98,6 @@ static void cbs_dispatch_base_station_id(struct ofono_cbs 
*cbs, const char *id)
 }
 
 static void cbs_dispatch_emergency(struct ofono_cbs *cbs, const char *message,
-                                       enum etws_topic_type topic,
                                        gboolean alert, gboolean popup)
 {
        DBusConnection *conn = ofono_dbus_get_connection();
@@ -107,29 +106,6 @@ static void cbs_dispatch_emergency(struct ofono_cbs *cbs, 
const char *message,
        DBusMessageIter iter;
        DBusMessageIter dict;
        dbus_bool_t boolean;
-       const char *emergency_str;
-
-       if (topic == ETWS_TOPIC_TYPE_TEST) {
-               ofono_error("Explicitly ignoring ETWS Test messages");
-               return;
-       }
-
-       switch (topic) {
-       case ETWS_TOPIC_TYPE_EARTHQUAKE:
-               emergency_str = "Earthquake";
-               break;
-       case ETWS_TOPIC_TYPE_TSUNAMI:
-               emergency_str = "Tsunami";
-               break;
-       case ETWS_TOPIC_TYPE_EARTHQUAKE_TSUNAMI:
-               emergency_str = "Earthquake+Tsunami";
-               break;
-       case ETWS_TOPIC_TYPE_EMERGENCY:
-               emergency_str = "Other";
-               break;
-       default:
-               return;
-       };
 
        signal = dbus_message_new_signal(path, OFONO_CELL_BROADCAST_INTERFACE,
                                                "EmergencyBroadcast");
@@ -144,9 +120,6 @@ static void cbs_dispatch_emergency(struct ofono_cbs *cbs, 
const char *message,
                                        OFONO_PROPERTIES_ARRAY_SIGNATURE,
                                                &dict);
 
-       ofono_dbus_dict_append(&dict, "EmergencyType",
-                               DBUS_TYPE_STRING, &emergency_str);
-
        boolean = alert;
        ofono_dbus_dict_append(&dict, "EmergencyAlert",
                                DBUS_TYPE_BOOLEAN, &boolean);
@@ -251,6 +224,11 @@ void ofono_cbs_notify(struct ofono_cbs *cbs, const 
unsigned char *pdu,
                gboolean alert = FALSE;
                gboolean popup = FALSE;
 
+               if (c.message_identifier == ETWS_TOPIC_TYPE_TEST) {
+                       ofono_error("Explicitly ignoring ETWS Test messages");
+                       goto out;
+               }
+
                /* 3GPP 23.041 9.4.1.2.1: Alert is encoded in bit 9 */
                if (c.message_code & (1 << 9))
                        alert = TRUE;
@@ -259,8 +237,7 @@ void ofono_cbs_notify(struct ofono_cbs *cbs, const unsigned 
char *pdu,
                if (c.message_code & (1 << 8))
                        popup = TRUE;
 
-               cbs_dispatch_emergency(cbs, message,
-                                       c.message_identifier, alert, popup);
+               cbs_dispatch_emergency(cbs, message, alert, popup);
                goto out;
        }
 
-- 
1.7.0.4

_______________________________________________
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono

Reply via email to