For handled commands, in case the terminal response is not reported by
the modem, we must set the cancel_cmd variable so the command is
canceled properly.
This patch also modifies the behavior so that pending_cmd is freed,
since stk_proactive_command_cancel expects cancel_cmd to be set if
pending_cmd is not NULL.
Fix PTS test TP/TWC/BV-03-I [Call Waiting- Hold Active/Retrieve
Waiting Call or Held].
PTS test fails after receiving intermediate update of callheld indicator
with value 0 (no held call) before it receives update to value 1
(active and held calls). This is due to the non-atomic update of calls
status after call swap (moving first call to active state before moving
second one to hold state).
HFP 1.5 spec specifies that an update of callheld indicator to 1 should
be sent after AT+CHLD=2 command.
As oFono emulator sends +CIEV only if the indicator value changes, we
need to use an intermediate state for callheld indicator (2, all calls on
hold).
So, in case of multiple active calls, or an active call with an active
mutiparty call, force update of callheld indicator to 2.
It is not safe to call dial_request_user_cancel directly. This is
because there might be a situation where the SIM requested the calls to
be dropped first. If we're still executing the release_all_active
request and someone calls hangup -> crash.
Instead it is safer to throttle the hangup requests until the call is
actually dialing.
In similar fashion, we should not allow hanging up a specific call if a
dial request is active, unless that call is part of the SIM dial
request. Note that by default this is not known until the driver's dial
implementation returns and the call is in the dialing (or alerting /
connected) state.
Make sure that only a single request from (possibly multiple) emulators
is ever sent to the voicecall driver. In the beginning it wasn't clear
whether this will be necessary, however several command implementations
already implemented basic throttling (+CHUP, ATD, CHLD=3, CHLD=2x) and
it made sense to make this more formal.
The other constraint is the abrupt removal of the emulator atom while an
operation is pending. This case must be handled gracefully. See next
commit.
During test TP/TCA/BV-05-I [Terminate Ongoing Call – While Call Waiting]
PTS fails if multiple +CCWA are sent (waiting for 1st phone number when
waiting one becomes incoming, intead of 2nd phone number).
So, send only 1 +CCWA.
Update RING timer management to be started as soon as an incoming call
exists, and retrieve +CLIP info for incoming or waiting call (in case
of waiting call becoming incoming call, call indicator changes before
internal call status is updated)
Force to send +CCWA (if needed) on reception of AT+CCWA=1
The Send DTMF command is special in its use of DisplayAction method of
STK agent. This allows the user to send a 'User Terminated Session'
response to the SIM. If the user performs this action, then any pending
DTMFs should also be canceled as soon as possible.
respond_on_exit flag is set by commands which are dispatched to the
agent, so that if the agent exits prematurely, a 'User Terminated
Session' response is sent to the SIM.
There were a couple of corner cases not quite handled correctly:
- During Set Up Call, if the user confirmation phase succeeded and the
call was dispatched to voicecall atom successfully, and the agent
exited at this point, then no terminal response would be sent until
the call succeeded / failed. Now the agent termination results in an
'User Terminated Session' response being sent immediately, but the
call setup proceeding.
==20365== Invalid read of size 8
==20365== at 0x4B3501: sim_fs_free (simfs.c:114)
==20365== by 0x493CEC: sim_remove (sim.c:2485)
==20365== by 0x4703D7: modem_change_state (modem.c:410)
==20365== by 0x470664: set_powered (modem.c:848)
==20365== by 0x4706BA: __ofono_modem_shutdown (modem.c:2137)
==20365== by 0x46F2C5: signal_cb (main.c:76)
==20365== by 0x52F555E: g_io_unix_dispatch (giounix.c:166)
==20365== by 0x52A0AAB: g_main_dispatch (gmain.c:2440)
==20365== by 0x52A203B: g_main_context_dispatch (gmain.c:3013)
==20365== by 0x52A2501: g_main_context_iterate (gmain.c:3091)
==20365== by 0x52A2C98: g_main_loop_run (gmain.c:3299)
==20365== by 0x46F0D3: main (main.c:243)
==20365== Address 0x63ff998 is 8 bytes inside a block of size 16 free'd
==20365== at 0x4C2612D: free (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==20365== by 0x52AA4A1: g_free (gmem.c:263)
==20365== by 0x52C433D: g_slice_free1 (gslice.c:907)
==20365== by 0x52C58D0: g_slist_free_1 (gslist.c:192)
==20365== by 0x52C5C5F: g_slist_remove (gslist.c:465)
==20365== by 0x4B342A: sim_fs_context_free (simfs.c:192)
==20365== by 0x4B3500: sim_fs_free (simfs.c:117)
==20365== by 0x493CEC: sim_remove (sim.c:2485)
==20365== by 0x4703D7: modem_change_state (modem.c:410)
==20365== by 0x470664: set_powered (modem.c:848)
==20365== by 0x4706BA: __ofono_modem_shutdown (modem.c:2137)
==20365== by 0x46F2C5: signal_cb (main.c:76)
==20287== Invalid read of size 4
==20287== at 0x52B5C6B: g_queue_peek_nth_link (gqueue.c:704)
==20287== by 0x52B5F57: g_queue_peek_nth (gqueue.c:848)
==20287== by 0x4B33ED: sim_fs_context_free (simfs.c:170)
==20287== by 0x4B34F8: sim_fs_free (simfs.c:116)
==20287== by 0x493CEC: sim_remove (sim.c:2485)
==20287== by 0x4703D7: modem_change_state (modem.c:410)
==20287== by 0x470664: set_powered (modem.c:848)
==20287== by 0x4706BA: __ofono_modem_shutdown (modem.c:2137)
==20287== by 0x46F2C5: signal_cb (main.c:76)
==20287== by 0x52F555E: g_io_unix_dispatch (giounix.c:166)
==20287== by 0x52A0AAB: g_main_dispatch (gmain.c:2440)
==20287== by 0x52A203B: g_main_context_dispatch (gmain.c:3013)
==20287== Address 0x63fae70 is 16 bytes inside a block of size 24
free'd
==20287== at 0x4C2612D: free (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==20287== by 0x52AA4A1: g_free (gmem.c:263)
==20287== by 0x52C433D: g_slice_free1 (gslice.c:907)
==20287== by 0x52B4E96: g_queue_free (gqueue.c:60)
==20287== by 0x4B34E0: sim_fs_free (simfs.c:107)
==20287== by 0x493CEC: sim_remove (sim.c:2485)
==20287== by 0x4703D7: modem_change_state (modem.c:410)
==20287== by 0x470664: set_powered (modem.c:848)
==20287== by 0x4706BA: __ofono_modem_shutdown (modem.c:2137)
==20287== by 0x46F2C5: signal_cb (main.c:76)
==20287== by 0x52F555E: g_io_unix_dispatch (giounix.c:166)
==20287== by 0x52A0AAB: g_main_dispatch (gmain.c:2440)
In certain circumstances, when the image has been cached but EFimg has
not been read yet, we might end up accessing an unitialized variable.
Fix this by always failing if EFimg has not been read yet.
A contextual change to __ofono_modem_find_atom has caused us to enter
into offline mode prematurely. find_atom was changed to return only the
atoms that were registered, however the modem really has to know whether
the sim atom is created (not registered) in order to know whether to
wait for the SIM to be initialized or not.
There is a potential case where the EFecc is being refreshed due to a
SIM refresh and a Network ECC list is updated. In this case we might
report a set of numbers that is not yet complete. Take care of this
case.
If the network list of ECC numbers is updated when we have no SIM, or
when the SIM numbers have not yet been read, or there is an error during
EFecc read, then the default_no_sim numbers are never added to the ECC
list.
In case set_online is missing, we should set online mode directly. If
we're already online then set our state to Online, otherwise check if we
should get Online.
voicecalls_release_queue uses struct ofono_call instead of
struct voicecall (which is used in "calls" list parameter and
function voicecalls_release_next)
manager_tone() converts all tone chars to uppercase. Since everywhere we
check for both 'p' and 'P' for a pause, tone_queue() should also check
both before claiming the string is invalid.
Using the enum which has a value of zero (PENDING) by default created
some problems. Use a slightly modified version of the logic and consume
less storage to boot.
Refactor tx_finished() and create a function to remove an entry from the
tx queue. This function will be used also when a message is cancelled.
Thus, handle the case in which state is MESSAGE_STATE_CANCELLED as well.
Based on patch from Yang Gu <gyagp0@gmail.com>
If sending of SMS fails, then oFono core will try to resend it after
n * 5 seconds(n = retry count). Due to this, conformance test case
27.22.8 sequence 1.4 fails(refer 31.124 spec). Plan is to limit the
failue codes for which the retry will be done. This patch allows the
retry if the failure is only due to network timeout. For all the
other failure cases, retry is not done.
Wait until driver gives us a file descriptor to start watching for
client exit. This fixes a race when client exits before the driver
calls location_reporting_enable_cb().
We should not tear down the SIM state if PIN2 is being asked for, or if
PIN2 is blocked and PUK2 is being asked.
We also want to continue with SIM initialization if the modem requires
PIN2 / PUK2 for some reason.
It handles client ATD*99# request and then initiate the PPP negotiation.
IP forward through the new ppp interface is not done yet.
Initially based on patches from Zhenhua Zhang <zhenhua.zhang@intel.com>
When a user tries to lock/unlock/change a PIN and enters it wrongly
several times, it is possible to lock themselves out. In this case we
should drop to a pre-sim state, wait for the user to enter the PUK and
re-init the sim.