OSDN Git Service

Better documentation on permission checking in ContentProvider.call().
authorDianne Hackborn <hackbod@google.com>
Wed, 13 Mar 2013 01:37:07 +0000 (18:37 -0700)
committerDianne Hackborn <hackbod@google.com>
Wed, 13 Mar 2013 22:48:12 +0000 (15:48 -0700)
Change-Id: I4a85fd17362c2a32e2b1365fcc07ef0336521616

core/java/android/content/ContentProvider.java

index 8aef405..4968268 100644 (file)
@@ -1256,6 +1256,13 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
      * interfaces that are cheaper and/or unnatural for a table-like
      * model.
      *
+     * <p class="note"><strong>WARNING:</strong> The framework does no permission checking
+     * on this entry into the content provider besides the basic ability for the application
+     * to get access to the provider at all.  For example, it has no idea whether the call
+     * being executed may read or write data in the provider, so can't enforce those
+     * individual permissions.  Any implementation of this method <strong>must</strong>
+     * do its own permission checks on incoming calls to make sure they are allowed.</p>
+     *
      * @param method method name to call.  Opaque to framework, but should not be {@code null}.
      * @param arg provider-defined String argument.  May be {@code null}.
      * @param extras provider-defined Bundle argument.  May be {@code null}.