From fcedfa01907d8a5f804974a4a3585498e8d6c261 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Fri, 19 Sep 2014 13:22:15 +0900 Subject: [PATCH] Speculative fix of IMMS crash This CL is a follow up CL for I6571d464a46453934f0a8f5e790. Do not propagate Resources.NotFoundException to the caller of InputMethodInfo.isDefault(). BUG: 17553712 BUG: 17549437 BUG: 17517332 Change-Id: Ie95880c1f68f49eb63518e69b7dfa20af3ce8737 --- core/java/android/view/inputmethod/InputMethodInfo.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/view/inputmethod/InputMethodInfo.java b/core/java/android/view/inputmethod/InputMethodInfo.java index 0a8e4b9c21815..11d0f4a893617 100644 --- a/core/java/android/view/inputmethod/InputMethodInfo.java +++ b/core/java/android/view/inputmethod/InputMethodInfo.java @@ -27,6 +27,7 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.content.res.Resources; +import android.content.res.Resources.NotFoundException; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.graphics.drawable.Drawable; @@ -421,7 +422,7 @@ public final class InputMethodInfo implements Parcelable { } final Resources res = context.createPackageContext(getPackageName(), 0).getResources(); return res.getBoolean(getIsDefaultResourceId()); - } catch (NameNotFoundException e) { + } catch (NameNotFoundException | NotFoundException e) { return false; } }