Fix: Properly update technologies
authorDenis Kenzior <denkenz@gmail.com>
Thu, 29 Oct 2009 21:38:25 +0000 (16:38 -0500)
committerDenis Kenzior <denkenz@gmail.com>
Thu, 29 Oct 2009 21:38:25 +0000 (16:38 -0500)
When current operator is reported, update the technology list if the
tech information is available

src/network.c

index 22f3aab..9b18522 100644 (file)
@@ -1128,9 +1128,16 @@ static void current_operator_callback(const struct ofono_error *error,
                                        network_operator_compare);
 
        if (op) {
-               set_network_operator_status(op->data, OPERATOR_STATUS_CURRENT);
-               set_network_operator_techs(op->data, current->tech);
-               set_network_operator_name(op->data, current->name);
+               struct network_operator_data *opd = op->data;
+               unsigned int techs = opd->techs;
+
+               if (current->tech != -1) {
+                       techs |= 1 << current->tech;
+                       set_network_operator_techs(opd, techs);
+               }
+
+               set_network_operator_status(opd, OPERATOR_STATUS_CURRENT);
+               set_network_operator_name(opd, current->name);
 
                if (netreg->current_operator == op->data)
                        return;