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

Commit 9f78f652 authored by Scott Kennedy's avatar Scott Kennedy
Browse files

Mark arg and extras @Nullable in ContentProvider#call()

Change-Id: I431b01323fe76c744520c72661d30f6b9cb6b7f1
parent 3062e570
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@ package android.content;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.Manifest.permission.INTERACT_ACROSS_USERS;
import static android.Manifest.permission.INTERACT_ACROSS_USERS;


import android.annotation.Nullable;
import android.app.AppOpsManager;
import android.app.AppOpsManager;
import android.content.pm.PathPermission;
import android.content.pm.PathPermission;
import android.content.pm.ProviderInfo;
import android.content.pm.ProviderInfo;
@@ -364,7 +365,8 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
        }
        }


        @Override
        @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);
            final String original = setCallingPackage(callingPkg);
            try {
            try {
                return ContentProvider.this.call(method, arg, extras);
                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
     * @return provider-defined return value.  May be {@code null}, which is also
     *   the default for providers which don't implement any call methods.
     *   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;
        return null;
    }
    }


+3 −1
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@
package android.content;
package android.content;


import android.accounts.Account;
import android.accounts.Account;
import android.annotation.Nullable;
import android.app.ActivityManagerNative;
import android.app.ActivityManagerNative;
import android.app.ActivityThread;
import android.app.ActivityThread;
import android.app.AppGlobals;
import android.app.AppGlobals;
@@ -1357,7 +1358,8 @@ public abstract class ContentResolver {
     * @throws NullPointerException if uri or method is null
     * @throws NullPointerException if uri or method is null
     * @throws IllegalArgumentException if uri is not known
     * @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) {
        if (uri == null) {
            throw new NullPointerException("uri == null");
            throw new NullPointerException("uri == null");
        }
        }
+3 −1
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package android.content;
package android.content;


import android.annotation.Nullable;
import android.content.res.AssetFileDescriptor;
import android.content.res.AssetFileDescriptor;
import android.database.Cursor;
import android.database.Cursor;
import android.net.Uri;
import android.net.Uri;
@@ -56,7 +57,8 @@ public interface IContentProvider extends IInterface {
    public ContentProviderResult[] applyBatch(String callingPkg,
    public ContentProviderResult[] applyBatch(String callingPkg,
            ArrayList<ContentProviderOperation> operations)
            ArrayList<ContentProviderOperation> operations)
                    throws RemoteException, OperationApplicationException;
                    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;
            throws RemoteException;
    public ICancellationSignal createCancellationSignal() throws RemoteException;
    public ICancellationSignal createCancellationSignal() throws RemoteException;