Merge "Fix ContentObserver unregister issue"

am: 09b6988e27

Change-Id: I242e87b53f603a05ba7c4069662456457a3d980a
This commit is contained in:
Fyodor Kupolov
2017-07-06 18:21:54 +00:00
committed by android-build-merger

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);
}
}