OSDN Git Service

Added error handling to settings suggestions list
authorSalvador Martinez <dehboxturtle@google.com>
Thu, 4 Aug 2016 20:37:52 +0000 (13:37 -0700)
committerSalvador Martinez <dehboxturtle@google.com>
Wed, 24 Aug 2016 16:43:22 +0000 (16:43 +0000)
The suggestions list in the summary page of the
settings app could sometimes cause a crash due to
an uncaught exception. Tis fixed now.

Bug: 30656840
Change-Id: If79f53e6a8c17a81653228d613797e94c473d410
(cherry picked from commit 60d92b3b8390e33e069f343d6a425ab07c498d3d)

packages/SettingsLib/src/com/android/settingslib/SuggestionParser.java

index 741b0ea..21786c9 100644 (file)
@@ -28,7 +28,6 @@ import android.util.Xml;
 import android.provider.Settings;
 import android.accounts.Account;
 import android.accounts.AccountManager;
-import android.content.ContentValues;
 import android.content.pm.PackageManager;
 import android.content.res.Resources;
 import android.view.InflateException;
@@ -176,6 +175,9 @@ public class SuggestionParser {
         } catch (PackageManager.NameNotFoundException e) {
             Log.w(TAG, "Cannot find resources for " + suggestion.intent.getComponent());
             return false;
+        } catch (Resources.NotFoundException e) {
+            Log.w(TAG, "Cannot find resources for " + suggestion.intent.getComponent(), e);
+            return false;
         }
     }