From 9f78f6528f1afad260be51d2058c37717851e3a2 Mon Sep 17 00:00:00 2001 From: Scott Kennedy Date: Sun, 1 Mar 2015 15:29:25 -0800 Subject: Mark arg and extras @Nullable in ContentProvider#call() Change-Id: I431b01323fe76c744520c72661d30f6b9cb6b7f1 --- core/java/android/content/ContentProvider.java | 6 ++++-- core/java/android/content/ContentResolver.java | 4 +++- core/java/android/content/IContentProvider.java | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'core') diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java index 0cff4c0..393cf8e 100644 --- a/core/java/android/content/ContentProvider.java +++ b/core/java/android/content/ContentProvider.java @@ -19,6 +19,7 @@ package android.content; import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.Manifest.permission.INTERACT_ACROSS_USERS; +import android.annotation.Nullable; import android.app.AppOpsManager; import android.content.pm.PathPermission; import android.content.pm.ProviderInfo; @@ -364,7 +365,8 @@ public abstract class ContentProvider implements ComponentCallbacks2 { } @Override - public Bundle call(String callingPkg, String method, String arg, Bundle extras) { + public Bundle call( + String callingPkg, String method, @Nullable String arg, @Nullable Bundle extras) { final String original = setCallingPackage(callingPkg); try { return ContentProvider.this.call(method, arg, extras); @@ -1742,7 +1744,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 { * @return provider-defined return value. May be {@code null}, which is also * the default for providers which don't implement any call methods. */ - public Bundle call(String method, String arg, Bundle extras) { + public Bundle call(String method, @Nullable String arg, @Nullable Bundle extras) { return null; } diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java index a09fee9..17a8eb7 100644 --- a/core/java/android/content/ContentResolver.java +++ b/core/java/android/content/ContentResolver.java @@ -17,6 +17,7 @@ package android.content; import android.accounts.Account; +import android.annotation.Nullable; import android.app.ActivityManagerNative; import android.app.ActivityThread; import android.app.AppGlobals; @@ -1357,7 +1358,8 @@ public abstract class ContentResolver { * @throws NullPointerException if uri or method is null * @throws IllegalArgumentException if uri is not known */ - public final Bundle call(Uri uri, String method, String arg, Bundle extras) { + public final Bundle call( + Uri uri, String method, @Nullable String arg, @Nullable Bundle extras) { if (uri == null) { throw new NullPointerException("uri == null"); } diff --git a/core/java/android/content/IContentProvider.java b/core/java/android/content/IContentProvider.java index f858406..4afe38b 100644 --- a/core/java/android/content/IContentProvider.java +++ b/core/java/android/content/IContentProvider.java @@ -16,6 +16,7 @@ package android.content; +import android.annotation.Nullable; import android.content.res.AssetFileDescriptor; import android.database.Cursor; import android.net.Uri; @@ -56,7 +57,8 @@ public interface IContentProvider extends IInterface { public ContentProviderResult[] applyBatch(String callingPkg, ArrayList operations) throws RemoteException, OperationApplicationException; - public Bundle call(String callingPkg, String method, String arg, Bundle extras) + public Bundle call( + String callingPkg, String method, @Nullable String arg, @Nullable Bundle extras) throws RemoteException; public ICancellationSignal createCancellationSignal() throws RemoteException; -- cgit v1.1