From ddfe8acf11f351a5887ced8fedf736ee4b108c51 Mon Sep 17 00:00:00 2001 From: Andrzej Zaborowski Date: Fri, 9 Apr 2010 08:48:50 +0200 Subject: Drivers can notify core of SIM insertion / removal Add ofono_sim_inserted_notify function to notify the core of SIM insertion / removal. Make every plugin generate a sim inserted event on start. For devices with removable card, the event should be emitted after the plugin detects such event. For devices that need to wait for SIM card initialization, they can emit this event later. --- plugins/palmpre.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins/palmpre.c') diff --git a/plugins/palmpre.c b/plugins/palmpre.c index 049b9bd7..7d2aeb43 100644 --- a/plugins/palmpre.c +++ b/plugins/palmpre.c @@ -170,13 +170,17 @@ static int palmpre_disable(struct ofono_modem *modem) static void palmpre_pre_sim(struct ofono_modem *modem) { struct palmpre_data *data = ofono_modem_get_data(modem); + struct ofono_sim *sim; DBG("%p", modem); ofono_devinfo_create(modem, 0, "atmodem", data->chat); - ofono_sim_create(modem, OFONO_VENDOR_QUALCOMM_MSM, "atmodem", + sim = ofono_sim_create(modem, OFONO_VENDOR_QUALCOMM_MSM, "atmodem", data->chat); ofono_voicecall_create(modem, 0, "atmodem", data->chat); + + if (sim) + ofono_sim_inserted_notify(sim, TRUE); } static void palmpre_post_sim(struct ofono_modem *modem) -- cgit v1.2.3