From d843ee85de0e07a186fbba758d1069d2ca598a76 Mon Sep 17 00:00:00 2001 From: Sunny Shao Date: Thu, 30 May 2019 11:22:39 +0800 Subject: [PATCH] Fixed the IllegalStateException on removing account According the log, I found that there are a lot of DeadObjectException and gms servervice restart. The system became unstable during this period, so add try/catch to avoid the exception of the Settings. Fixes: 133253227 Test: make RunSettingsRoboTests -j56 ROBOTEST_FILTER=com.android.settings.accounts make RunSettingsRoboTests -j56 ROBOTEST_FILTER=com.android.settings.core make RunSettingsRoboTests -j56 ROBOTEST_FILTER=com.android.settings.dashboard Change-Id: I8534e8f7118234f6346607415698f9f91c3e5ffb --- .../accounts/RemoveAccountPreferenceController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/accounts/RemoveAccountPreferenceController.java b/src/com/android/settings/accounts/RemoveAccountPreferenceController.java index 1bc30d03130..5c6e6bb4e72 100644 --- a/src/com/android/settings/accounts/RemoveAccountPreferenceController.java +++ b/src/com/android/settings/accounts/RemoveAccountPreferenceController.java @@ -191,7 +191,11 @@ public class RemoveAccountPreferenceController extends AbstractPreferenceControl } final RemoveAccountFailureDialog dialog = new RemoveAccountFailureDialog(); dialog.setTargetFragment(parent, 0); - dialog.show(parent.getFragmentManager(), FAILED_REMOVAL_DIALOG); + try { + dialog.show(parent.getFragmentManager(), FAILED_REMOVAL_DIALOG); + } catch (IllegalStateException e) { + Log.w(TAG, "Can't show RemoveAccountFailureDialog. " + e.getMessage()); + } } @Override