Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7617773 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix issue #28431297: Crash in system process

Don't allow null URIs to get put into the notification path.

Change-Id: I4f68f438960c8a90c7b417feaa2e19968a3a200a
parent b59beffa
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1748,7 +1748,7 @@ public abstract class ContentResolver {
     *
     * @hide
     */
    public void notifyChange(Uri uri, ContentObserver observer, boolean syncToNetwork,
    public void notifyChange(@NonNull Uri uri, ContentObserver observer, boolean syncToNetwork,
            @UserIdInt int userHandle) {
        try {
            getContentService().notifyChange(
@@ -1765,7 +1765,7 @@ public abstract class ContentResolver {
     *
     * @hide
     */
    public void notifyChange(Uri uri, ContentObserver observer, @NotifyFlags int flags,
    public void notifyChange(@NonNull Uri uri, ContentObserver observer, @NotifyFlags int flags,
            @UserIdInt int userHandle) {
        try {
            getContentService().notifyChange(
+4 −0
Original line number Diff line number Diff line
@@ -352,6 +352,10 @@ public final class ContentService extends IContentService.Stub {
        if (DEBUG) Slog.d(TAG, "Notifying update of " + uri + " for user " + userHandle
                + " from observer " + observer + ", flags " + Integer.toHexString(flags));

        if (uri == null) {
            throw new NullPointerException("Uri must not be null");
        }

        final int uid = Binder.getCallingUid();
        final int pid = Binder.getCallingPid();
        final int callingUserHandle = UserHandle.getCallingUserId();