summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dianne Hackborn <hackbod@google.com> 2013-09-11 11:02:24 -0700
committer Dianne Hackborn <hackbod@google.com> 2013-09-11 11:04:21 -0700
commitb3ac67a0ece71bcf484dd92914dc3599dadffb05 (patch)
treeb709567e57399e4432995aebd43f70b1cf4733ef
parentec7a6ea84578be91e04a54331ea4ca63e7fb69e1 (diff)
More on issue #10130785: Restore silence and vibrate settings...
...in settings > sound ContentResolver.uncanonicalize needs to be able to fail. Change-Id: I347ef60fc3619aae203b87079579597c60be8b90
-rw-r--r--core/java/android/content/ContentProvider.java6
-rw-r--r--core/java/android/content/ContentResolver.java10
2 files changed, 10 insertions, 6 deletions
diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java
index 343841934223..0a1d3f9afc5a 100644
--- a/core/java/android/content/ContentProvider.java
+++ b/core/java/android/content/ContentProvider.java
@@ -918,8 +918,10 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
*
* @param url The Uri to remove any canonicalization from.
*
- * @return Return the non-canonical representation of <var>url</var>, or return
- * the <var>url</var> as-is if there is nothing to do. Never return null.
+ * @return Return the non-canonical representation of <var>url</var>, return
+ * the <var>url</var> as-is if there is nothing to do, or return null if
+ * the data identified by the canonical representation can not be found in
+ * the current environment.
*/
public Uri uncanonicalize(Uri url) {
return url;
diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java
index e91460407522..f3c4df9852b5 100644
--- a/core/java/android/content/ContentResolver.java
+++ b/core/java/android/content/ContentResolver.java
@@ -548,14 +548,16 @@ public abstract class ContentResolver {
* it to its local non-canonical form. This can be useful in some cases where
* you know that you will only be using the Uri in the current environment and
* want to avoid any possible overhead when using it with the content
- * provider.
+ * provider or want to verify that the referenced data exists at all in the
+ * new environment.
*
* @param url The canonical {@link Uri} that is to be convered back to its
* non-canonical form.
*
- * @return Returns the non-canonical representation of <var>url</var>. This
- * function never returns null; if there is no conversion to be done, it returns
- * the same Uri that was provided.
+ * @return Returns the non-canonical representation of <var>url</var>. This will
+ * return null if data identified by the canonical Uri can not be found in
+ * the current environment; callers must always check for null and deal with
+ * that by appropriately falling back to an alternative.
*
* @see #canonicalize
*/