All of lore.kernel.org
 help / color / mirror / Atom feed
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis <frederic.danis@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH v3 2/2] voicecall: remove usage of em_atd_number
Date: Thu, 21 Jul 2011 16:58:09 +0200	[thread overview]
Message-ID: <1311260289-15708-2-git-send-email-frederic.danis@linux.intel.com> (raw)
In-Reply-To: <1311260289-15708-1-git-send-email-frederic.danis@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2508 bytes --]

as emulator atom can only run with a 'ready' SIM,
use saved number instead of em_atd_number
---
 src/voicecall.c |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index 9160ce8..f4c2358 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -74,7 +74,6 @@ struct ofono_voicecall {
 	ofono_voicecall_cb_t release_queue_done_cb;
 	struct ofono_emulator *pending_em;
 	unsigned int pending_id;
-	char *em_atd_number;
 };
 
 struct voicecall {
@@ -1506,14 +1505,14 @@ static int voicecall_dial(struct ofono_voicecall *vc, const char *number,
 
 	string_to_phone_number(number, &ph);
 
-	vc->driver->dial(vc, &ph, clir, cb, vc);
-
 	if (vc->settings) {
 		g_key_file_set_string(vc->settings, SETTINGS_GROUP,
 					"Number", number);
 		storage_sync(vc->imsi, SETTINGS_STORE, vc->settings);
 	}
 
+	vc->driver->dial(vc, &ph, clir, cb, vc);
+
 	return 0;
 }
 
@@ -3154,13 +3153,18 @@ static void emulator_dial_callback(const struct ofono_error *error, void *data)
 	struct ofono_voicecall *vc = data;
 	gboolean need_to_emit;
 	struct voicecall *v;
+	const char *number;
+	GError *err = NULL;
+
+	number = g_key_file_get_string(vc->settings, SETTINGS_GROUP,
+					"Number", &err);
 
-	v = dial_handle_result(vc, error, vc->em_atd_number, &need_to_emit);
+	v = dial_handle_result(vc, error, number, &need_to_emit);
 
 	if (v == NULL) {
 		struct ofono_modem *modem = __ofono_atom_get_modem(vc->atom);
 
-		if (is_emergency_number(vc, vc->em_atd_number) == TRUE)
+		if (is_emergency_number(vc, number) == TRUE)
 			__ofono_modem_dec_emergency_mode(modem);
 	}
 
@@ -3168,8 +3172,6 @@ static void emulator_dial_callback(const struct ofono_error *error, void *data)
 		ofono_emulator_send_final(vc->pending_em, error);
 
 	vc->pending_em = NULL;
-	g_free(vc->em_atd_number);
-	vc->em_atd_number = NULL;
 
 	notify_emulator_call_status(vc);
 
@@ -3191,7 +3193,6 @@ static void emulator_dial(struct ofono_emulator *em, struct ofono_voicecall *vc,
 	}
 
 	vc->pending_em = em;
-	vc->em_atd_number = g_strdup(number);
 
 	err = voicecall_dial(vc, number, OFONO_CLIR_OPTION_DEFAULT,
 					emulator_dial_callback, vc);
@@ -3200,8 +3201,6 @@ static void emulator_dial(struct ofono_emulator *em, struct ofono_voicecall *vc,
 		return;
 
 	vc->pending_em = NULL;
-	g_free(vc->em_atd_number);
-	vc->em_atd_number = NULL;
 
 	switch (err) {
 	case -ENETDOWN:
-- 
1.7.1


  reply	other threads:[~2011-07-21 14:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-21 14:58 [PATCH v3 1/2] hfp_ag: start server on sim 'ready' state =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-07-21 14:58 ` =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis [this message]
2011-07-22  1:28   ` [PATCH v3 2/2] voicecall: remove usage of em_atd_number Denis Kenzior
2011-07-22  1:28 ` [PATCH v3 1/2] hfp_ag: start server on sim 'ready' state Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1311260289-15708-2-git-send-email-frederic.danis@linux.intel.com \
    --to=frederic.danis@linux.intel.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.