diff options
author | Zhizhi Liu <zhizhiliu@google.com> | 2018-02-22 14:26:55 -0800 |
---|---|---|
committer | Zhizhi Liu <zhizhiliu@google.com> | 2018-02-22 16:01:14 -0800 |
commit | f0e1bcb997be93752d1fe081f14b295ead657b12 (patch) | |
tree | 609c49c126a4b2ff710a66ab60d95ada5e7900d7 | |
parent | a9d413528f7a445d5705a60925baa0b0b6c2c8ea (diff) | |
download | SettingsIntelligence-f0e1bcb997be93752d1fe081f14b295ead657b12.tar.gz |
Handle IllegalArgumentException to avoid TvSettings crash.
When the suggested settings summary uri is unknown, TvSettings would crash.
Handle the exception to avoid this.
b/72644591
Test: Using a wrong uri for summary, it won't crash anymore.
Change-Id: I4ee635e066c8f8e8e29e240c8c185795d0fe3d2c
-rw-r--r-- | src/com/android/settings/intelligence/suggestions/model/CandidateSuggestion.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/settings/intelligence/suggestions/model/CandidateSuggestion.java b/src/com/android/settings/intelligence/suggestions/model/CandidateSuggestion.java index a9ea657..b53d16f 100644 --- a/src/com/android/settings/intelligence/suggestions/model/CandidateSuggestion.java +++ b/src/com/android/settings/intelligence/suggestions/model/CandidateSuggestion.java @@ -258,7 +258,13 @@ public class CandidateSuggestion { if (TextUtils.isEmpty(method)) { return null; } - return mContext.getContentResolver().call(uri, method, null /* args */, null /* bundle */); + try { + return mContext.getContentResolver().call(uri, method, null /* args */, + null /* bundle */); + } catch (IllegalArgumentException e){ + Log.d(TAG, "Unknown summary_uri", e); + return null; + } } /** |