History log of /packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyBackupAgent.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
620d2adfd35e6b8b16a86d5ecd60718ffa1e774a 22-May-2017 Tom Taylor <tomtaylor@google.com> 38380566 Notifiy the default sms app when restoration is complete

* When the TelephonyBackupAgent is done restoring all the messages
from the backup file set, notify the default sms app with a null uri.
That triggers the sms app to do a full sync from the telephony db.

Test: Used the following manual steps to an initiate a restore:
adb shell bmgr list transports
adb shell bmgr transport android/com.android.internal.backup.LocalTransport
adb push ~/Downloads/com.android.providers.telephony /data/cache/backup/1/_full/com.android.providers.telephony
adb shell bmgr restore 1 com.android.providers.telephony
Then verified in the logs that:
1) The telephony restore triggered sending an intent to the default
sms app:
05-23 10:28:54.241 1711 5987 D SmsProvider: notifyIfNotDefaultSmsApp - called from null, notifying
2) The default sms app (bugle) received the intent:
05-23 10:28:54.271 4975 4975 V Bugle : TelephonyChangeReceiver.onReceive Intent { act=android.provider.action.EXTERNAL_PROVIDER_CHANGE flg=0x20000010 cmp=com.google.android.apps.messaging/.shared.receiver.TelephonyChangeReceiver }
3) Bugle recognized the intent as one without a uri, hence triggering
a full sync:
05-23 10:28:54.273 4975 4995 I BugleDataModel: ProcessTelephonyChangeAction: external telephony provider change null
05-23 10:28:54.276 4975 4995 I BugleDataModel: ProcessTelephonyChangeAction: not single message change, force full sync
4) Verified in the app the messages were restored.

Change-Id: I16592d1173e92333fca2e4820862fc737eebe6b4
/packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyBackupAgent.java
618b16ce37ffe3981f92df1947d53e4d3e30eb60 12-Apr-2017 Tom Taylor <tomtaylor@google.com> 32394618, 36899165, 37245921 Fix unread and text_only flags

* Update the TelephonyProvider's backup/restore agent to set the
default "read" flag as 1, or has-been-read. When restoring an mms,
set the text_only flag appropriately. Finally, back up the text in
all mms messages, even if the text is part of a message that contains
an attachment.

Test: updated the unit tests.

Bug: 32394618
Bug: 36899165
Bug: 37245921
Change-Id: If5197b22fd0558764dd1c379d720915e9c38e8b7
/packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyBackupAgent.java
785f9214b0da4bacf4c78ae90f08c535ab04c5a5 27-Mar-2017 Tom Taylor <tomtaylor@google.com> 36367212, 36366196 Restore MMS attachments from backup file

* Update the TelephonyProvider's backup/restore agent to handle
restoring mms attachments. This change also includes restoring the
original SMIL, and backing up and restoring the "read" flag for both
sms and mms messages. Also, added a "call" method to the MmsSmsProvider
to return a boolean when a restore is in progress.

Test: updated the unit tests to test the new fields. Manually tested
a restore file to verify an mms with image was restored and imported
by bugle correctly.

Bug: 36367212
Bug: 36366196
Change-Id: If78bbe60a922aeb4373d45f9c82fa434806b13d9
/packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyBackupAgent.java
56117b955dda1c134473a4fed4b0a73fb1c6cea2 27-Apr-2016 Roman Sorokin <rsorokin@google.com> Fixed crash loop of the Telephony in case of bad restore.

If exception occured it caused the service to crash and then restart
again. Since it did not delete the old files exception occured again
etc.
Now it deletes file if there is any exception;

Bug: 28382746
Change-Id: Ifcec6242e6cad23fa6e6c697248c6d6a98dfca89
/packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyBackupAgent.java
2d3a779b41d5a553c8615a906ee97da29907313e 13-Apr-2016 Roman Sorokin <rsorokin@google.com> Make SMS restore robust to device reboots.

Since we put actual message restore into the separate service it's
possible it will be interrupted by e.g. device reboot. We should
check if there are still files to restore on providers start.

Bug: 28165505
Change-Id: I593a30f0c1a955170a158f2540a542e00d049b17
/packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyBackupAgent.java
3aa281731a6f25cd36b88bca809b13d3f581d05f 01-Apr-2016 Roman Sorokin <rsorokin@google.com> Additional columns in pdu table and threads table to backup

Added columns
1. pdu.tr_id
2. threads.archived

'archived' is backed up along with the first SMS message from the
archived thread.

Bug: 27928438

Change-Id: I4e7ea885ecc7424f96442d0fda9ddad424514ace
/packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyBackupAgent.java
c2231c02010a2a5915e4d09ed5fbabd0bba65078 29-Mar-2016 Roman Sorokin <rsorokin@google.com> Hold wakelock for SMS/MMS restore service.

Since we start to put the message into the providers after
onRestoreFinished in the separate service we have to hold a wakelock for
it.

Bug: 27225193
Change-Id: I2b1fa219b13ebd45816d44b9dacb3b7177c5fe84
/packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyBackupAgent.java
9037d648d61f3d90726e43296f0b12c532e1f934 22-Mar-2016 Roman Sorokin <rsorokin@google.com> Switched TelephonyBackupAgent to ContentResolver

It used instances of content providers (SMS, MMS). Since now it's loaded
not in the restricted state it could safely use ContentResolver.

Also took all the functions out of the static scope into the object scope.

Bug: 27791017

Change-Id: I468bb4859bddb0fba1db388101bd1ddecfc3ce0c
/packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyBackupAgent.java
21736c3871d5c4cd3a6322d65d635057d0a61937 17-Feb-2016 Roman Sorokin <rsorokin@google.com> Speed up of message backup/restore

- Use BufferedWriter for backing up
- Use bulkInsert into sms provider on restore
- On restore the agent stores files onto disk and then launch deferred service to restore messages.
- Cache threadId db request on backup and restore.
- Made backups incremental

Also added unit test for hitting the quota on backup.

Bug: 27225193
Bug: 26870249

Change-Id: Ia8875fe692ba33039e58189dcdcca82f207768f1
/packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyBackupAgent.java
76422e0ed1bc5b68f857094a05b5fec8b507f36e 15-Feb-2016 Roman Sorokin <rsorokin@google.com> Fixed duplication conversation on restore
Made recipients storage for mms same as for sms.

Bug: 27073155
Change-Id: Iee3c24819d3df0461213352342e6b53e3e71e213
/packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyBackupAgent.java
1d42223c7e497b5513fa0cc5e65ffc405b432989 12-Feb-2016 Roman Sorokin <rsorokin@google.com> Fixed tests for TelephonyBackupAgent

Bug: 26739475

Change-Id: Ie0a5abee9ff29ad57b4e1a974e8c5bc7a36aed5e
/packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyBackupAgent.java
ff82fdf627ab69a160eb354673cef1696df55f5c 27-Jan-2016 Matthew Williams <mjwilliams@google.com> Merge "Support for onQuotaExceeded in TelephonyBackupAgent."
8f63351b0fb1598b6add38bc3c20148b7c65e731 19-Jan-2016 Roman Sorokin <rsorokin@google.com> Support for onQuotaExceeded in TelephonyBackupAgent.

Bug: 26533986
Change-Id: I8661bae4a9d334d7bf4150048bf883f1215b9740
/packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyBackupAgent.java
a632476534b877cdad602a27fe8ba01892d0bd83 26-Jan-2016 Roman Sorokin <rsorokin@google.com> Fixing addresses backup/restore for SMS.
We were trying to parse "address" field in order to get the recipients
and generate threadId. Problem was that parsing went bad in some cases.
In this CL we backup sms_recipients fetched from content://mms-sms/canonical-address
and use it on restore to generate threadId.

Will fix the tests later.

Bug:26739475
Change-Id: I1b50bbdc8afbdf254d27df9d23fc938847768d41
/packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyBackupAgent.java
8b39acf181c547e87161873112d6c52a581fc778 16-Dec-2015 Roman Sorokin <rsorokin@google.com> Implemention of the telephony provider backup agent to cover SMS backup

Known issues:
- Are we ok with restarting com.android.phone on restore?

Bug: 26079978
Bug: 26532098
Change-Id: I87452c0d993c14fe70b12f310bdc52a0ccd2ff1d
/packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyBackupAgent.java