Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(582)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java

Issue 1291083004: [Custom Tabs]Add API for updating action button in service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cr.->cr_ Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 84cbf4bd0a7cb6c7c52353c5e36d5a182b7faeb6..370575f66cf95caf98be2f4cc7eebd7921254fc8 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
@@ -25,7 +25,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";
/** See {@link #isIntentTooLarge(Intent)}. */
private static final int MAX_INTENT_SIZE_THRESHOLD = 750000;
@@ -124,6 +124,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) {

Powered by Google App Engine
This is Rietveld 408576698