Merge "Remove unnecessary MessageObserver"
This commit is contained in:
commit
d98b42e767
@ -203,7 +203,6 @@ public class ExchangeService extends Service implements Runnable {
|
||||
private AccountObserver mAccountObserver;
|
||||
private MailboxObserver mMailboxObserver;
|
||||
private SyncedMessageObserver mSyncedMessageObserver;
|
||||
private MessageObserver mMessageObserver;
|
||||
private EasSyncStatusObserver mSyncStatusObserver;
|
||||
private Object mStatusChangeListener;
|
||||
private EasAccountsUpdatedListener mAccountsUpdatedListener;
|
||||
@ -892,22 +891,6 @@ public class ExchangeService extends Service implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
private class MessageObserver extends ContentObserver {
|
||||
|
||||
public MessageObserver(Handler handler) {
|
||||
super(handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChange(boolean selfChange) {
|
||||
// A rather blunt instrument here. But we don't have information about the URI that
|
||||
// triggered this, though it must have been an insert
|
||||
if (!selfChange) {
|
||||
kick(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static public IEmailServiceCallback callback() {
|
||||
return sCallbackProxy;
|
||||
}
|
||||
@ -1876,8 +1859,6 @@ public class ExchangeService extends Service implements Runnable {
|
||||
mSyncedMessageObserver = new SyncedMessageObserver(mHandler);
|
||||
mResolver.registerContentObserver(Message.SYNCED_CONTENT_URI, true,
|
||||
mSyncedMessageObserver);
|
||||
mMessageObserver = new MessageObserver(mHandler);
|
||||
mResolver.registerContentObserver(Message.CONTENT_URI, true, mMessageObserver);
|
||||
mSyncStatusObserver = new EasSyncStatusObserver();
|
||||
mStatusChangeListener =
|
||||
ContentResolver.addStatusChangeListener(
|
||||
@ -1974,10 +1955,6 @@ public class ExchangeService extends Service implements Runnable {
|
||||
resolver.unregisterContentObserver(mSyncedMessageObserver);
|
||||
mSyncedMessageObserver = null;
|
||||
}
|
||||
if (mMessageObserver != null) {
|
||||
resolver.unregisterContentObserver(mMessageObserver);
|
||||
mMessageObserver = null;
|
||||
}
|
||||
if (mAccountObserver != null) {
|
||||
resolver.unregisterContentObserver(mAccountObserver);
|
||||
mAccountObserver = null;
|
||||
|
Loading…
Reference in New Issue
Block a user