Re: [Meego-handset] [Patch] Fixed: BMC# 8559 - Non-emergency call (Was: Dialer: Emergency Call Support Patches Try 1)

2011-04-05 Thread Shane Bryan
On Tue, 5 Apr 2011 11:38:29 +0300
Arun Ravindran ext-arun.1.ravind...@nokia.com wrote:

 Hi Shane,
 
  This fixes the behavior where the user is able to make normal call
even if there is no SIM.
As you know the emergency call support is non existent in
   oFono, at least we filter the call attempt here.
  Arun,
 
  OK, I've re-worked your patch for BMC#8559, making changes per my
  previous comments.
 
  If you approve of my revisions, I'll apply this to master.
 
 
 I am fine with your modifications, please push this to master.
 
  One observation I have though is that this is really quite
  un-testable (at least AFAICS) on the master branch because the only
  way right now to put the modem into flight mode is to offline it,
  but this will cause the CallManager instance to become invalid
  since oFono will remove the VoiceCallManager interface in this mode.
 
 The VoiceCallManager interface is created pre_sim, and remains as
 long as the modem is powered on.

Hmm... that does not seem to be what I actually see happening... I'll
need to take a closer look then.

When I run the offline-modem script from the ofono test suite, all
further attempts to work with the modem are failing, including onlining
it.

 
  I don't have an invalid SIM or one with FDN/BDN enabled either.
 
  Do you have other suggestions on how to test this on the master
  branch?
 
 Testing the dialer when the modem is offline is the best way. We are 
 only interested in the user getting a note about what type of calls
 he can make,
 because making emergency call is not yet a functionality in oFono.
 

Understood, just hoping you had found a better or different way of
testing.

Shane...
___
MeeGo-handset mailing list
MeeGo-handset@lists.meego.com
http://lists.meego.com/listinfo/meego-handset


[Meego-handset] [Patch] Fixed: BMC# 8559 - Non-emergency call (Was: Dialer: Emergency Call Support Patches Try 1)

2011-04-04 Thread Shane Bryan
On Wed, 23 Mar 2011 08:47:38 +0200
Arun Ravindran ext-arun.1.ravind...@nokia.com wrote:

 Hi Shane,
 
  On Tue, 15 Mar 2011 14:37:15 +0200
  Arun Ravindranext-arun.1.ravind...@nokia.com  wrote:
 
  Hi Shane/Michael,
 
  We had some time back this discussion while working on BMC#8559.
 
  Not sure how this relates to bug 8559 Normal phone call can be
  started from UI even without SIM card?
 
  Did you mean bug 14320 Unable to make emergency call whether SIM
  card inserted or not?
 
 This fixes the behavior where the user is able to make normal call
 even if there is no SIM.
 As you know the emergency call support is non existent in oFono, at 
 least we filter the call attempt here.

Arun, 

OK, I've re-worked your patch for BMC#8559, making changes per my
previous comments.

If you approve of my revisions, I'll apply this to master.

One observation I have though is that this is really quite un-testable
(at least AFAICS) on the master branch because the only way right now
to put the modem into flight mode is to offline it, but this will
cause the CallManager instance to become invalid since oFono will
remove the VoiceCallManager interface in this mode.

I don't have an invalid SIM or one with FDN/BDN enabled either.

Do you have other suggestions on how to test this on the master branch?

One solution might be to make it part of the headless branch for now.

Thoughts or comments?

Shane...

From fb8a96b97af049dc891d63b794efd61faa7d4185 Mon Sep 17 00:00:00 2001
From: Arun Ravindran ext-arun.1.ravind...@nokia.com
Date: Mon, 4 Apr 2011 16:33:58 -0700
Subject: [PATCH] Fixed:   BMC# 8559 - Non-emergency call can be made without 
SIM card

- Implimented missing online modem property
- Check if modem is both Powered and Online before attempting to dial,
  if not, then requested number must be in the list of allowed
  EmergencyNumbers from oFono
- Exposed new showErrorDialog() method that allows message to be set
- Added notification message when non-emergency call is requested and
  current state prohibits it.

Signed-off-by: Shane Bryan shane.br...@linux.intel.com
---
 src/callmanager.cpp   |   20 +++-
 src/callmanager.h |1 +
 src/dialerapplication.cpp |6 ++
 src/dialerapplication.h   |1 +
 src/dialerpage.cpp|   13 -
 src/dialerpage.h  |1 +
 src/modemproxy.cpp|   15 +++
 src/modemproxy.h  |6 ++
 8 files changed, 61 insertions(+), 2 deletions(-)

diff --git a/src/callmanager.cpp b/src/callmanager.cpp
index 0a92068..1006d3e 100644
--- a/src/callmanager.cpp
+++ b/src/callmanager.cpp
@@ -174,6 +174,24 @@ void CallManager::dial(const PeopleItem *person)
 void CallManager::dial(const QString number)
 {
 TRACE
+ModemProxy* p = ManagerProxy::instance()-modem();
+
+// Nothing to do if the modem is not powered up
+if(!p-powered()) {
+emit callsChanged();
+return;
+}
+
+// If not online (flight mode?), check if the requested number is
+// one of the allowed EmergencyNumbers, in which case, continue.
+// Otherwise, notify that only Emergency calls are permitted.
+if(!p-online()) {
+if(p-powered()  !m_emergencyNumbers.contains(number)) {
+emit callsChanged();
+emit onlyEmergencyCalls();
+return;
+}
+}
 
 ResourceProxy *resource = ManagerProxy::instance()-resource();
 
@@ -823,7 +841,7 @@ void CallManager::propertyChanged(const QString in0, const 
QDBusVariant in1)
 calls = qdbus_castQListQDBusObjectPath (in1.variant());
 setMultipartyCalls(calls);
 } else if (in0 == EmergencyNumbers) {
-qDebug()  QString(TODO: Handle EmergencyNumber...);
+m_emergencyNumbers = qdbus_castQStringList(in1.variant());
 } else
 qDebug()  QString(Unexpected property changed...);
 }
diff --git a/src/callmanager.h b/src/callmanager.h
index 86ee1f6..11f3301 100644
--- a/src/callmanager.h
+++ b/src/callmanager.h
@@ -92,6 +92,7 @@ Q_SIGNALS:
 void callResourceLost(const QString);
 void connected();
 void disconnected();
+void onlyEmergencyCalls();
 
 private Q_SLOTS:
 void updateCallItems();
diff --git a/src/dialerapplication.cpp b/src/dialerapplication.cpp
index da44fff..e781e28 100644
--- a/src/dialerapplication.cpp
+++ b/src/dialerapplication.cpp
@@ -264,6 +264,12 @@ void DialerApplication::messagesWaitingChanged()
 vmail-publish();
 }
 
+int DialerApplication::showErrorDialog(const QString msg)
+{
+setError(msg);
+return showErrorDialog();
+}
+
 int DialerApplication::showErrorDialog()
 {
 TRACE
diff --git a/src/dialerapplication.h b/src/dialerapplication.h
index 02bde70..6dfe627 100644
--- a/src/dialerapplication.h
+++ b/src/dialerapplication.h
@@ -39,6 +39,7 @@ public:
 bool isConnected();
 QString lastError();
 int showErrorDialog();
+int showErrorDialog(const QString msg);
 static DialerApplication *instance();