summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorgkipnis <gkipnis@cyngn.com>2016-01-27 13:18:24 -0800
committerSteve Kondik <steve@cyngn.com>2016-08-28 20:42:48 -0700
commit29569850722ecae581307ab728dacf5815c0708d (patch)
treedd173b8e996eab3ba8f7e6a4659b1aea6315644e /src/com
parent744cf5dc4bedfa3a423e773a847c8abf3d375250 (diff)
downloadandroid_packages_apps_Messaging-29569850722ecae581307ab728dacf5815c0708d.tar.gz
android_packages_apps_Messaging-29569850722ecae581307ab728dacf5815c0708d.tar.bz2
android_packages_apps_Messaging-29569850722ecae581307ab728dacf5815c0708d.zip
Framework to Local Blacklist Synchronization Fix
Added db.beginTransaction()/db.endTransaction() before and after a sequence of db accesses that have to be performed atomically Change-Id: I912230afe8a7f58841306ec8ad64819ba00d3405
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/messaging/util/BlacklistSync.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/com/android/messaging/util/BlacklistSync.java b/src/com/android/messaging/util/BlacklistSync.java
index 9cc611e..44253c4 100644
--- a/src/com/android/messaging/util/BlacklistSync.java
+++ b/src/com/android/messaging/util/BlacklistSync.java
@@ -72,12 +72,18 @@ public class BlacklistSync extends AsyncTask<Void, Void, Void> {
// there was no phone number in the local participants database that was
// blacklisted in the framework blacklist database, create a new participant
// and insert him into the local participants database
- ParticipantData participant = ParticipantData
- .getFromRawPhoneBySystemLocale(number);
- BugleDatabaseOperations.getOrCreateParticipantInTransaction(db,
- participant);
- BugleDatabaseOperations.updateDestination(db, number,
- isBlocked, false);
+ db.beginTransaction();
+ try {
+ ParticipantData participant = ParticipantData
+ .getFromRawPhoneBySystemLocale(number);
+ BugleDatabaseOperations.getOrCreateParticipantInTransaction(db,
+ participant);
+ BugleDatabaseOperations.updateDestination(db, number,
+ isBlocked, false);
+ db.setTransactionSuccessful();
+ } finally {
+ db.endTransaction();
+ }
}
}
}