Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df74a5b1 authored by Zhizhi Liu's avatar Zhizhi Liu
Browse files

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
parent f658bd75
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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);
        }
    }