hfp: Notify core of HF indicators supported by AG
authorDenis Kenzior <denkenz@gmail.com>
Mon, 27 Jan 2014 17:56:44 +0000 (11:56 -0600)
committerDenis Kenzior <denkenz@gmail.com>
Mon, 20 Oct 2014 18:40:28 +0000 (13:40 -0500)
This information was obtained from SLC negotiation

drivers/hfpmodem/handsfree.c

index c85aac2833bfb8d765965311e36e8cc7a560d03f..2e47f71567c24c507d41da3f037d83602f3c61b2 100644 (file)
@@ -232,6 +232,7 @@ static int hfp_handsfree_probe(struct ofono_handsfree *hf,
 {
        struct hfp_slc_info *info = data;
        struct hf_data *hd;
+       unsigned int i;
 
        DBG("");
        hd = g_new0(struct hf_data, 1);
@@ -245,6 +246,14 @@ static int hfp_handsfree_probe(struct ofono_handsfree *hf,
        ofono_handsfree_battchg_notify(hf,
                                        info->cind_val[HFP_INDICATOR_BATTCHG]);
 
+       ofono_handsfree_set_hf_indicators(hf, info->hf_indicators,
+                                               info->num_hf_indicators);
+
+       for (i = 0; i < info->num_hf_indicators; i++)
+               ofono_handsfree_hf_indicator_active_notify(hf,
+                       info->hf_indicators[i],
+                       info->hf_indicator_active_map & (1 << i));
+
        hd->register_source = g_idle_add(hfp_handsfree_register, hf);
 
        return 0;