Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mms-engine
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mer-core
mms-engine
Commits
1bf86f0e
Commit
1bf86f0e
authored
Mar 07, 2016
by
Slava Monich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[mms-nemo] There's no need to retry ofono_connctx_activate() calls
ligofono 1.0.11 does it for us.
parent
d5188393
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
47 deletions
+9
-47
mms-connman-nemo/src/mms_connection_nemo.c
mms-connman-nemo/src/mms_connection_nemo.c
+7
-45
rpm/mms-engine.spec
rpm/mms-engine.spec
+2
-2
No files found.
mms-connman-nemo/src/mms_connection_nemo.c
View file @
1bf86f0e
...
...
@@ -18,16 +18,12 @@
#include <gofono_connmgr.h>
#include <gofono_connctx.h>
#include <gofono_error.h>
/* Logging */
#define MMS_LOG_MODULE_NAME mms_connection_log
#include "mms_connman_nemo_log.h"
MMS_LOG_MODULE_DEFINE
(
"mms-connection-nemo"
);
#define RETRY_DELAY_SEC (1)
#define MAX_RETRY_COUNT (100)
enum
mm_handler_id
{
MM_HANDLER_VALID
,
MM_HANDLER_MMS_IMSI
,
...
...
@@ -59,8 +55,6 @@ typedef struct mms_connection_nemo {
gulong
mm_handler_id
[
MM_HANDLER_COUNT
];
gulong
context_handler_id
[
CONTEXT_HANDLER_COUNT
];
gulong
connmgr_handler_id
[
CONNMGR_HANDLER_COUNT
];
guint
retry_id
;
int
retry_count
;
char
*
imsi
;
char
*
path
;
}
MMSConnectionNemo
;
...
...
@@ -165,14 +159,11 @@ void
mms_connection_nemo_cancel
(
MMSConnectionNemo
*
self
)
{
if
(
self
->
retry_id
)
{
g_source_remove
(
self
->
retry_id
);
self
->
retry_id
=
0
;
}
if
((
self
->
connection
.
state
<=
MMS_CONNECTION_STATE_OPENING
&&
mms_connection_nemo_set_state
(
self
,
MMS_CONNECTION_STATE_FAILED
))
||
mms_connection_nemo_set_state
(
self
,
MMS_CONNECTION_STATE_CLOSED
))
{
MMS_DEBUG
(
"Cancelled %s"
,
self
->
connection
.
imsi
);
if
(
self
->
connection
.
state
<=
MMS_CONNECTION_STATE_OPENING
&&
mms_connection_nemo_set_state
(
self
,
MMS_CONNECTION_STATE_FAILED
))
{
MMS_DEBUG
(
"Connection %s cancelled"
,
self
->
connection
.
imsi
);
}
else
{
mms_connection_nemo_set_state
(
self
,
MMS_CONNECTION_STATE_CLOSED
);
}
}
...
...
@@ -253,20 +244,6 @@ mms_connection_nemo_mms_center_changed(
}
}
static
gboolean
mms_connection_nemo_activate_retry
(
gpointer
arg
)
{
MMSConnectionNemo
*
self
=
MMS_CONNECTION_NEMO
(
arg
);
OfonoConnCtx
*
context
=
self
->
context
;
MMS_ASSERT
(
self
->
retry_id
);
self
->
retry_id
=
0
;
MMS_DEBUG
(
"Activating %s again"
,
ofono_connctx_path
(
context
));
ofono_connctx_activate
(
context
);
return
G_SOURCE_REMOVE
;
}
static
void
mms_connection_nemo_activate_failed
(
...
...
@@ -276,17 +253,7 @@ mms_connection_nemo_activate_failed(
{
MMSConnectionNemo
*
self
=
MMS_CONNECTION_NEMO
(
arg
);
MMS_ASSERT
(
self
->
context
==
context
);
MMS_ASSERT
(
!
self
->
retry_id
);
if
(
error
->
domain
==
OFONO_ERROR
&&
error
->
code
==
OFONO_ERROR_BUSY
&&
self
->
retry_count
<
MAX_RETRY_COUNT
)
{
self
->
retry_count
++
;
MMS_DEBUG
(
"Retry %d in %d sec"
,
self
->
retry_count
,
RETRY_DELAY_SEC
);
self
->
retry_id
=
g_timeout_add_seconds
(
RETRY_DELAY_SEC
,
mms_connection_nemo_activate_retry
,
self
);
}
else
{
mms_connection_nemo_cancel
(
self
);
}
mms_connection_nemo_cancel
(
self
);
}
static
...
...
@@ -537,8 +504,7 @@ mms_connection_nemo_mm_valid_changed(
OfonoExtModemManager
*
mm
,
void
*
arg
)
{
MMSConnectionNemo
*
self
=
MMS_CONNECTION_NEMO
(
arg
);
MMS_VERBOSE_
(
"%p %d"
,
self
,
mm
->
valid
);
MMS_VERBOSE_
(
"%p %d"
,
arg
,
mm
->
valid
);
if
(
mm
->
valid
)
{
mms_connection_nemo_request_sim
(
arg
);
}
...
...
@@ -599,10 +565,6 @@ mms_connection_nemo_dispose(
MMS_VERBOSE_
(
"%p %s"
,
self
,
self
->
imsi
);
MMS_ASSERT
(
!
mms_connection_is_active
(
&
self
->
connection
));
mms_connection_nemo_disconnect
(
self
);
if
(
self
->
retry_id
)
{
g_source_remove
(
self
->
retry_id
);
self
->
retry_id
=
0
;
}
if
(
self
->
context
)
{
if
(
mms_connection_is_active
(
&
self
->
connection
)
&&
self
->
context
->
active
)
{
...
...
rpm/mms-engine.spec
View file @
1bf86f0e
...
...
@@ -8,7 +8,7 @@ URL: https://git.merproject.org/mer-core/mms-engine
Source0: %{name}-%{version}.tar.bz2
Requires: dbus
Requires: ofono
Requires: libgofono >= 1.0.
5
Requires: libgofono >= 1.0.
11
Requires: libgofonoext >= 1.0.4
#Requires: ImageMagick
...
...
@@ -22,7 +22,7 @@ BuildRequires: pkgconfig(gmime-2.6)
BuildRequires: pkgconfig(glib-2.0) >= 2.32
BuildRequires: pkgconfig(libsoup-2.4) >= 2.38
BuildRequires: pkgconfig(libwspcodec) >= 2.2
BuildRequires: pkgconfig(libgofono) >= 1.0.
5
BuildRequires: pkgconfig(libgofono) >= 1.0.
11
BuildRequires: pkgconfig(libgofonoext) >= 1.0.4
BuildRequires: pkgconfig(libglibutil)
BuildRequires: pkgconfig(Qt5Gui)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment