From df74a5b16fbc7ab7553bc520cc46a9879b65543a Mon Sep 17 00:00:00 2001 From: Zhizhi Liu Date: Thu, 22 Feb 2018 15:33:42 -0800 Subject: [PATCH] Make SuggestionController guard RuntimeException. The crash happens when SettingsIntelligence throws IllegalArgumentException(it is handled in the other CL). To make sure SuggestionController are not influenced by this kind of exceptions and thus propagate to TvSettings, do a double check here. b/72644591 Test: By using a wrong uri for suggested settings, it won't crash TvSettings. Change-Id: I3b4d4630f3630c046320f8f4b9c5e0032907976d --- .../settingslib/suggestions/SuggestionController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/SettingsLib/src/com/android/settingslib/suggestions/SuggestionController.java b/packages/SettingsLib/src/com/android/settingslib/suggestions/SuggestionController.java index f740f7c01ce13..b0451b7ad2eab 100644 --- a/packages/SettingsLib/src/com/android/settingslib/suggestions/SuggestionController.java +++ b/packages/SettingsLib/src/com/android/settingslib/suggestions/SuggestionController.java @@ -107,7 +107,7 @@ public class SuggestionController { } catch (NullPointerException e) { Log.w(TAG, "mRemote service detached before able to query", e); return null; - } catch (RemoteException e) { + } catch (RemoteException | RuntimeException e) { Log.w(TAG, "Error when calling getSuggestion()", e); return null; } @@ -120,7 +120,7 @@ public class SuggestionController { } try { mRemoteService.dismissSuggestion(suggestion); - } catch (RemoteException e) { + } catch (RemoteException | RuntimeException e) { Log.w(TAG, "Error when calling dismissSuggestion()", e); } } @@ -133,7 +133,7 @@ public class SuggestionController { try { mRemoteService.launchSuggestion(suggestion); - } catch (RemoteException e) { + } catch (RemoteException | RuntimeException e) { Log.w(TAG, "Error when calling launchSuggestion()", e); } }