diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java index 1163add3a4d47..e1d431f678115 100644 --- a/core/java/android/content/ContentProvider.java +++ b/core/java/android/content/ContentProvider.java @@ -1001,7 +1001,7 @@ public abstract class ContentProvider implements ComponentCallbacks { /** * @hide -- until interface has proven itself * - * Call an provider-defined method. This can be used to implement + * Call a provider-defined method. This can be used to implement * interfaces that are cheaper than using a Cursor. * * @param method Method name to call. Opaque to framework. @@ -1013,29 +1013,26 @@ public abstract class ContentProvider implements ComponentCallbacks { } /** - * Shuts down this instance of the ContentProvider. It is useful when writing tests that use - * the ContentProvider. + * Implement this to shut down the ContentProvider instance. You can then + * invoke this method in unit tests. + * *
- * If a unittest starts the ContentProvider in its test(..() methods, it could run into sqlite - * errors "disk I/O error" or "corruption" in the following scenario: - *
- * tearDown() in the unittests should call this method to have ContentProvider gracefully - * shutdown all database connections. + * Implementing shutDown() avoids this conflict by providing a way to + * terminate the ContentProvider. This method can also prevent memory leaks + * from multiple instantiations of the ContentProvider, and it can ensure + * unit test isolation by allowing you to completely clean up the test + * fixture before moving on to the next test. + *
*/ public void shutdown() { Log.w(TAG, "implement ContentProvider shutdown() to make sure all database " +