Index: chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java |
index a66722fbb97b993774db422ae11a334216a4972f..6a5d3a785205b0492dd05b9f340c0387e58d384c 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java |
@@ -24,7 +24,7 @@ import java.util.List; |
* Utilities dealing with extracting information from intents. |
*/ |
public class IntentUtils { |
- private static final String TAG = "IntentUtils"; |
+ private static final String TAG = "cr.IntentUtils"; |
/** |
* Retrieves a list of components that would handle the given intent. |
@@ -120,6 +120,19 @@ public class IntentUtils { |
} |
/** |
+ * Just like {@link Bundle#getBundle(String)} but doesn't throw exceptions. |
+ */ |
+ public static Bundle safeGetBundle(Bundle bundle, String name) { |
+ try { |
+ return bundle.getBundle(name); |
+ } catch (Throwable t) { |
+ // Catches un-parceling exceptions. |
+ Log.e(TAG, "getBundle failed on bundle " + bundle); |
+ return null; |
+ } |
+ } |
+ |
+ /** |
* Just like {@link Bundle#getParcelable(String)} but doesn't throw exceptions. |
*/ |
public static <T extends Parcelable> T safeGetParcelable(Bundle bundle, String name) { |