Merge "Do not throw IllegalArgumentException in slice manager." into pi-dev
diff --git a/core/java/android/app/slice/SliceManager.java b/core/java/android/app/slice/SliceManager.java
index f682ec1..ad862fc 100644
--- a/core/java/android/app/slice/SliceManager.java
+++ b/core/java/android/app/slice/SliceManager.java
@@ -245,7 +245,8 @@
ContentResolver resolver = mContext.getContentResolver();
try (ContentProviderClient provider = resolver.acquireContentProviderClient(uri)) {
if (provider == null) {
- throw new IllegalArgumentException("Unknown URI " + uri);
+ Log.w(TAG, String.format("Unknown URI: %s", uri));
+ return null;
}
Bundle extras = new Bundle();
extras.putParcelable(SliceProvider.EXTRA_BIND_URI, uri);
@@ -306,7 +307,8 @@
.authority(authority).build();
try (ContentProviderClient provider = resolver.acquireContentProviderClient(uri)) {
if (provider == null) {
- throw new IllegalArgumentException("Unknown URI " + uri);
+ Log.w(TAG, String.format("Unknown URI: %s", uri));
+ return null;
}
Bundle extras = new Bundle();
extras.putParcelable(SliceProvider.EXTRA_INTENT, intent);
@@ -383,7 +385,8 @@
.authority(authority).build();
try (ContentProviderClient provider = resolver.acquireContentProviderClient(uri)) {
if (provider == null) {
- throw new IllegalArgumentException("Unknown URI " + uri);
+ Log.w(TAG, String.format("Unknown URI: %s", uri));
+ return null;
}
Bundle extras = new Bundle();
extras.putParcelable(SliceProvider.EXTRA_INTENT, intent);