parent
dad47808e9
commit
863c6bb04f
@ -168,7 +168,7 @@ public class SyncManager extends Service implements Runnable {
|
|||||||
private SyncedMessageObserver mSyncedMessageObserver;
|
private SyncedMessageObserver mSyncedMessageObserver;
|
||||||
private MessageObserver mMessageObserver;
|
private MessageObserver mMessageObserver;
|
||||||
private EasSyncStatusObserver mSyncStatusObserver;
|
private EasSyncStatusObserver mSyncStatusObserver;
|
||||||
private EasAccountsUpdatedListener mAccountsUpdatedListener = new EasAccountsUpdatedListener();
|
private EasAccountsUpdatedListener mAccountsUpdatedListener;
|
||||||
private Handler mHandler = new Handler();
|
private Handler mHandler = new Handler();
|
||||||
|
|
||||||
private ContentResolver mResolver;
|
private ContentResolver mResolver;
|
||||||
@ -700,7 +700,9 @@ public class SyncManager extends Service implements Runnable {
|
|||||||
resolver.unregisterContentObserver(mMessageObserver);
|
resolver.unregisterContentObserver(mMessageObserver);
|
||||||
|
|
||||||
// Don't leak the Intent associated with this listener
|
// Don't leak the Intent associated with this listener
|
||||||
|
if (mAccountsUpdatedListener != null) {
|
||||||
AccountManager.get(this).removeOnAccountsUpdatedListener(mAccountsUpdatedListener);
|
AccountManager.get(this).removeOnAccountsUpdatedListener(mAccountsUpdatedListener);
|
||||||
|
}
|
||||||
|
|
||||||
// Clear pending alarms
|
// Clear pending alarms
|
||||||
clearAlarms();
|
clearAlarms();
|
||||||
@ -1147,6 +1149,7 @@ public class SyncManager extends Service implements Runnable {
|
|||||||
mResolver.registerContentObserver(Message.CONTENT_URI, true, mMessageObserver);
|
mResolver.registerContentObserver(Message.CONTENT_URI, true, mMessageObserver);
|
||||||
ContentResolver.addStatusChangeListener(ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS,
|
ContentResolver.addStatusChangeListener(ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS,
|
||||||
mSyncStatusObserver);
|
mSyncStatusObserver);
|
||||||
|
mAccountsUpdatedListener = new EasAccountsUpdatedListener();
|
||||||
AccountManager.get(this).addOnAccountsUpdatedListener(mAccountsUpdatedListener,
|
AccountManager.get(this).addOnAccountsUpdatedListener(mAccountsUpdatedListener,
|
||||||
mHandler, true);
|
mHandler, true);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user