Fix issue #28431297: Crash in system process

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

Change-Id: I4f68f438960c8a90c7b417feaa2e19968a3a200a
This commit is contained in:
Dianne Hackborn
2016-04-27 17:03:52 -07:00
parent b59beffa89
commit e761777323
2 changed files with 6 additions and 2 deletions

View File

@@ -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(

View File

@@ -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();