Merge "onAccountsUpdated shouldn\'t be called back after listener unregistered"

am: b96673847a

* commit 'b96673847a4680c384b7335df37affc0bba36f3f':
  onAccountsUpdated shouldn't be called back after listener unregistered
This commit is contained in:
Amith Yamasani
2016-02-12 17:58:47 +00:00
committed by android-build-merger

View File

@@ -1916,12 +1916,16 @@ public class AccountManager {
handler.post(new Runnable() {
@Override
public void run() {
try {
listener.onAccountsUpdated(accountsCopy);
} catch (SQLException e) {
// Better luck next time. If the problem was disk-full,
// the STORAGE_OK intent will re-trigger the update.
Log.e(TAG, "Can't update accounts", e);
synchronized (mAccountsUpdatedListeners) {
try {
if (mAccountsUpdatedListeners.containsKey(listener)) {
listener.onAccountsUpdated(accountsCopy);
}
} catch (SQLException e) {
// Better luck next time. If the problem was disk-full,
// the STORAGE_OK intent will re-trigger the update.
Log.e(TAG, "Can't update accounts", e);
}
}
}
});