Merge "Fix ContentObserver unregister issue"

This commit is contained in:
Fyodor Kupolov
2017-07-06 18:07:04 +00:00
committed by Gerrit Code Review

View File

@@ -193,6 +193,11 @@ public abstract class ContentObserver {
*/
private void dispatchChange(boolean selfChange, Uri uri, int userId) {
if (mHandler == null) {
synchronized (mLock) {
if (mTransport == null) {
return;
}
}
onChange(selfChange, uri, userId);
} else {
mHandler.post(new NotificationRunnable(selfChange, uri, userId));
@@ -213,6 +218,11 @@ public abstract class ContentObserver {
@Override
public void run() {
synchronized (mLock) {
if (mTransport == null) {
return;
}
}
ContentObserver.this.onChange(mSelfChange, mUri, mUserId);
}
}