Even though you've got the Receivers set up to get the system broadcasts, you still need to store the messages retrieved from them; for example:
ContentValues values = new ContentValues();
values.put(Telephony.Sms.Inbox.ADDRESS, smsMessage.getDisplayOriginatingAddress());
values.put(Telephony.Sms.Inbox.BODY, smsBody);
values.put(Telephony.Sms.Inbox.DATE, System.currentTimeMillis());
values.put(Telephony.Sms.Inbox.PROTOCOL, smsMessage.getProtocolIdentifier());
values.put(Telephony.Sms.Inbox.READ, 0);
values.put(Telephony.Sms.Inbox.SEEN, 0);
values.put(Telephony.Sms.Inbox.SERVICE_CENTER, smsMessage.getServiceCenterAddress());
values.put(Telephony.Sms.THREAD_ID, Telephony.Threads.getOrCreateThreadId(context, address));
Uri insertUri = context.getContentResolver().insert(Telephony.Sms.Inbox.CONTENT_URI, values);
Starting with KitKat, the default SMS app is responsible for writing all incoming messages to the Provider, so when your app is the default on those versions, you definitely need to save the messages from the SMS_DELIVER
broadcasts.
Pre-KitKat, there was no such thing as a default SMS app, so the user had to ensure to have at least one messaging app, often pre-installed, that would handle saving messages voluntarily, but it was kind of a free-for-all. If you're supporting those versions, you might need to handle inserting messages there too, if no other app is doing it.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…