diff options
author | Scott Kennedy <skennedy@google.com> | 2015-03-01 15:29:25 -0800 |
---|---|---|
committer | Scott Kennedy <skennedy@google.com> | 2015-03-01 15:29:58 -0800 |
commit | 9f78f6528f1afad260be51d2058c37717851e3a2 (patch) | |
tree | 767fc966afa2b48cabe87b016e2c92a83a4e247d /core | |
parent | 3062e57072145ba5e71ba8b2cf565d3453db04a7 (diff) | |
download | frameworks_base-9f78f6528f1afad260be51d2058c37717851e3a2.zip frameworks_base-9f78f6528f1afad260be51d2058c37717851e3a2.tar.gz frameworks_base-9f78f6528f1afad260be51d2058c37717851e3a2.tar.bz2 |
Mark arg and extras @Nullable in ContentProvider#call()
Change-Id: I431b01323fe76c744520c72661d30f6b9cb6b7f1
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/content/ContentProvider.java | 6 | ||||
-rw-r--r-- | core/java/android/content/ContentResolver.java | 4 | ||||
-rw-r--r-- | core/java/android/content/IContentProvider.java | 4 |
3 files changed, 10 insertions, 4 deletions
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<ContentProviderOperation> 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; |