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

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

Issue 1557803002: [Custom Tabs] Implement Bottombar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: respond to dfalcantara@'s comments Created 4 years, 11 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 b2b4c53d2ee19bdcee8a9aa6003a63e5904a60c1..1cc9e632f4614769802d954010c772c5cb4c6bbf 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
@@ -71,6 +71,19 @@ public class IntentUtils {
}
/**
+ * Just like {@link Bundle#getInt(String, int)} but doesn't throw exceptions.
+ */
+ public static int safeGetInt(Bundle bundle, String name, int defaultValue) {
+ try {
+ return bundle.getInt(name, defaultValue);
+ } catch (Throwable t) {
+ // Catches un-parceling exceptions.
+ Log.e(TAG, "getInt failed on bundle " + bundle);
+ return defaultValue;
+ }
+ }
+
+ /**
* Just like {@link Intent#getLongExtra(String, long)} but doesn't throw exceptions.
*/
public static long safeGetLongExtra(Intent intent, String name, long defaultValue) {

Powered by Google App Engine
This is Rietveld 408576698