Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -9490,6 +9490,7 @@ package android.content { method @Nullable public android.database.Cursor query(@NonNull android.net.Uri, @Nullable String[], @Nullable String, @Nullable String[], @Nullable String, @Nullable android.os.CancellationSignal); method @Nullable public android.database.Cursor query(@NonNull android.net.Uri, @Nullable String[], @Nullable android.os.Bundle, @Nullable android.os.CancellationSignal); method public boolean refresh(android.net.Uri, @Nullable android.os.Bundle, @Nullable android.os.CancellationSignal); method @NonNull public final android.content.Context requireContext(); method public final void restoreCallingIdentity(@NonNull android.content.ContentProvider.CallingIdentity); method protected final void setPathPermissions(@Nullable android.content.pm.PathPermission[]); method protected final void setReadPermission(@Nullable String); core/java/android/content/ContentProvider.java +17 −0 Original line number Diff line number Diff line Loading @@ -833,6 +833,23 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall return mContext; } /** * Retrieves a Non-Nullable Context this provider is running in, this is intended to be called * after {@link #onCreate}. When called before context was created, an IllegalStateException * will be thrown. * <p> * Note A provider must be declared in the manifest and created automatically by the system, * and context is only available after {@link #onCreate} is called. */ @NonNull public final Context requireContext() { final Context ctx = getContext(); if (ctx == null) { throw new IllegalStateException("Cannot find context from the provider."); } return ctx; } /** * Set the calling package, returning the current value (or {@code null}) * which can be used later to restore the previous state. Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -9490,6 +9490,7 @@ package android.content { method @Nullable public android.database.Cursor query(@NonNull android.net.Uri, @Nullable String[], @Nullable String, @Nullable String[], @Nullable String, @Nullable android.os.CancellationSignal); method @Nullable public android.database.Cursor query(@NonNull android.net.Uri, @Nullable String[], @Nullable android.os.Bundle, @Nullable android.os.CancellationSignal); method public boolean refresh(android.net.Uri, @Nullable android.os.Bundle, @Nullable android.os.CancellationSignal); method @NonNull public final android.content.Context requireContext(); method public final void restoreCallingIdentity(@NonNull android.content.ContentProvider.CallingIdentity); method protected final void setPathPermissions(@Nullable android.content.pm.PathPermission[]); method protected final void setReadPermission(@Nullable String);
core/java/android/content/ContentProvider.java +17 −0 Original line number Diff line number Diff line Loading @@ -833,6 +833,23 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall return mContext; } /** * Retrieves a Non-Nullable Context this provider is running in, this is intended to be called * after {@link #onCreate}. When called before context was created, an IllegalStateException * will be thrown. * <p> * Note A provider must be declared in the manifest and created automatically by the system, * and context is only available after {@link #onCreate} is called. */ @NonNull public final Context requireContext() { final Context ctx = getContext(); if (ctx == null) { throw new IllegalStateException("Cannot find context from the provider."); } return ctx; } /** * Set the calling package, returning the current value (or {@code null}) * which can be used later to restore the previous state. Loading