Merge "onAccountsUpdated shouldn't be called back after listener unregistered"
This commit is contained in:
@@ -1857,12 +1857,16 @@ public class AccountManager {
|
||||
handler = (handler == null) ? mMainHandler : handler;
|
||||
handler.post(new Runnable() {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user