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
This commit is contained in:
Zhizhi Liu
2018-02-22 15:33:42 -08:00
parent f658bd75fb
commit df74a5b16f

View File

@@ -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);
}
}