diff options
author | Maurice Lam <yukl@google.com> | 2016-03-25 00:26:46 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-03-25 00:26:46 +0000 |
commit | 8d8efd86c72cdecefb133bd3bc3ee676233d2f2e (patch) | |
tree | 7818316d46ec799e0e53baa381561f40ba3e3740 | |
parent | 9b4e2c4788f066d799af15e573c1dc78102fc0d0 (diff) | |
parent | 3aee7b9de403e669e24ce68da1b390ab74288364 (diff) | |
download | setupwizard-8d8efd86c72cdecefb133bd3bc3ee676233d2f2e.tar.gz |
Merge "[SuwLib] Catch RuntimeException during template inflation" into ub-setupwizard-belgarath
-rw-r--r-- | library/main/src/com/android/setupwizardlib/GlifLayout.java | 4 | ||||
-rw-r--r-- | library/main/src/com/android/setupwizardlib/SetupWizardLayout.java | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/library/main/src/com/android/setupwizardlib/GlifLayout.java b/library/main/src/com/android/setupwizardlib/GlifLayout.java index 42ba8f2..89ebb5a 100644 --- a/library/main/src/com/android/setupwizardlib/GlifLayout.java +++ b/library/main/src/com/android/setupwizardlib/GlifLayout.java @@ -124,7 +124,9 @@ public class GlifLayout extends TemplateLayout { } try { return super.onInflateTemplate(inflater, template); - } catch (InflateException e) { + } catch (RuntimeException e) { + // Versions before M throws RuntimeException for unsuccessful attribute resolution + // Versions M+ will throw an InflateException (which extends from RuntimeException) throw new InflateException("Unable to inflate layout. Are you using " + "@style/SuwThemeGlif (or its descendant) as your theme?", e); } diff --git a/library/main/src/com/android/setupwizardlib/SetupWizardLayout.java b/library/main/src/com/android/setupwizardlib/SetupWizardLayout.java index 23a75b9..3906a9b 100644 --- a/library/main/src/com/android/setupwizardlib/SetupWizardLayout.java +++ b/library/main/src/com/android/setupwizardlib/SetupWizardLayout.java @@ -169,7 +169,9 @@ public class SetupWizardLayout extends TemplateLayout { } try { return super.onInflateTemplate(inflater, template); - } catch (InflateException e) { + } catch (RuntimeException e) { + // Versions before M throws RuntimeException for unsuccessful attribute resolution + // Versions M+ will throw an InflateException (which extends from RuntimeException) throw new InflateException("Unable to inflate layout. Are you using " + "@style/SuwThemeMaterial (or its descendant) as your theme?", e); } |