diff options
| author | 2016-06-15 16:57:32 -0700 | |
|---|---|---|
| committer | 2016-06-15 16:57:36 -0700 | |
| commit | 3138a9938b19d596b1581a538eb019f134903d06 (patch) | |
| tree | 47815209a9317d28331153817b4a9c71437a7dc5 | |
| parent | 91131f459c490d735ccc57392c6e4ccac667826e (diff) | |
Don't dispatch Uris with appended user handle
This change fixes a bug where we started appending the user id
to the changing Uri for observers to know what user's Uri changed.
This is problematic as it changes the Uri structure expected by
observers. Also there are no public APIs to factor out the user
id from the Uri. If a system component needs to know for which
user a Uri changed it can use ContentObserver#onChange(boolean,
Uri, int) where the last argument is the user id.
bug:19312280
Change-Id: I5f0982ac3c8d6b6eab060bab65d3b53182660ac7
| -rw-r--r-- | services/core/java/com/android/server/content/ContentService.java | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/services/core/java/com/android/server/content/ContentService.java b/services/core/java/com/android/server/content/ContentService.java index 1b2ccd7e43ad..58b46bc9bd1e 100644 --- a/services/core/java/com/android/server/content/ContentService.java +++ b/services/core/java/com/android/server/content/ContentService.java @@ -393,18 +393,9 @@ public final class ContentService extends IContentService.Stub { for (int i=0; i<numCalls; i++) { ObserverCall oc = calls.get(i); try { - // If the uri does not belong to the same user as the observer: we must add - // the userId to the uri. Otherewise the observer would think the uri belongs - // to his user. - final Uri tempUri; - if (oc.mObserverUserId != userHandle) { - tempUri = ContentProvider.maybeAddUserId(uri, userHandle); - } else { - tempUri = uri; - } - oc.mObserver.onChange(oc.mSelfChange, tempUri, userHandle); + oc.mObserver.onChange(oc.mSelfChange, uri, userHandle); if (DEBUG) Slog.d(TAG, "Notified " + oc.mObserver + " of " + "update at " - + tempUri); + + uri); } catch (RemoteException ex) { synchronized (mRootNode) { Log.w(TAG, "Found dead observer, removing"); |