This patch was generated by the following semantic patch
(http://coccinelle.lip6.fr/)
// <smpl>
@fix disable is_null,isnt_null1@
expression *E;
@@
- !E
+ E == NULL
// </smpl>
Just before sending a CMGR for +CMTI notification, use need to
optionally send a CPMS to select the proper storage. This should be
done in a separate function for potential re-use by CDSI
The Novatel based devices with Qualcomm chips seems to have various
problems. First they advertise CNMI mode 2, but don't support it. And
second they don't support CNMA acknowledgement with a PDU. So fall back
to acks without PDU.
Any timeouts set must be removed using g_source_remove. Failure to do
so results in sigsegvs when the modem is randomly removed during the
initialization cycle.
On modems that don't support +CMT (or for class 2 SMSes) the messages are
stored in the modem and then read and deleted from there in two separate
steps with no warranty that deletion succeeds or (more likely) power is
cut before the deletion happens. Over time the memory may become full
and if we don't want to deal with this condition we need to check on
startup if there are messages we haven't deleted.
We can't differentiate between those messages and those the user already
had on the SIM / modem before installing ofono or switching phones, so we
might want to deliver messages with REC READ status with some kind of
indication that these are potentially old so the UI doesn't emit spurious
alerts. We don't do this now and just deliver as usual.
The G1 doesn't support mode2, despite advertising it.
The G1 chokes w/ an "Error 303" when we specify NMI mode 2. Adding a
quirk to drop that mode from the supported list (just use mode 1) allows
the G1 to properly deal with SMS.
Some Nokia modems only support "MT" as the incoming sms store.
Presumably the modem has some intelligence to pick the right store
depending on the SMS class. This means that oFono must now track
what the current store is, and issue a CPMS, CMGR & CMGD when a
CMTI notification arrives.