aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2021-06-02 11:53:47 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-06-02 11:53:47 +0000
commitca2ab19dc76516a311b03d708094662518899c85 (patch)
treea1eeea9ba2c559d974ed8d1bcc67caa5f458aea9
parent7f70b88e9759b2cdbe3c18a8321df569bbb8d509 (diff)
parente8d612de9fce21b81616446c0933c8fa6f8d2cd0 (diff)
downloadContactsProvider-ca2ab19dc76516a311b03d708094662518899c85.tar.gz
Merge "Move broadcast and return to after finalizing the transactions" into sc-dev
-rw-r--r--src/com/android/providers/contacts/ContactsProvider2.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java
index ca6aaad2..4b2b37ae 100644
--- a/src/com/android/providers/contacts/ContactsProvider2.java
+++ b/src/com/android/providers/contacts/ContactsProvider2.java
@@ -2319,12 +2319,12 @@ public class ContactsProvider2 extends AbstractContactsProvider
try {
mDbHelper.get().createSimAccountIdInTransaction(
AccountWithDataSet.get(accountName, accountType, null), simSlot, efType);
- getContext().sendBroadcast(new Intent(SimContacts.ACTION_SIM_ACCOUNTS_CHANGED));
db.setTransactionSuccessful();
- return response;
} finally {
db.endTransaction();
}
+ getContext().sendBroadcast(new Intent(SimContacts.ACTION_SIM_ACCOUNTS_CHANGED));
+ return response;
} else if (SimContacts.REMOVE_SIM_ACCOUNT_METHOD.equals(method)) {
ContactsPermissions.enforceCallingOrSelfPermission(getContext(),
MANAGE_SIM_ACCOUNTS_PERMISSION);
@@ -2338,13 +2338,13 @@ public class ContactsProvider2 extends AbstractContactsProvider
db.beginTransaction();
try {
mDbHelper.get().removeSimAccounts(simSlot);
- getContext().sendBroadcast(new Intent(SimContacts.ACTION_SIM_ACCOUNTS_CHANGED));
scheduleBackgroundTask(BACKGROUND_TASK_UPDATE_ACCOUNTS);
db.setTransactionSuccessful();
- return response;
} finally {
db.endTransaction();
}
+ getContext().sendBroadcast(new Intent(SimContacts.ACTION_SIM_ACCOUNTS_CHANGED));
+ return response;
} else if (SimContacts.QUERY_SIM_ACCOUNTS_METHOD.equals(method)) {
ContactsPermissions.enforceCallingOrSelfPermission(getContext(), READ_PERMISSION);
final Bundle response = new Bundle();