Preventing a crash on rotation of the Display Options activity
The crash occurs if you rotate the Display Options activity
while it is saving. The exception thrown simply tells us
that the dialog is already gone. Swallowing this exception
is benign.
It is a very common monkey crash.
Bug: 2138584
Change-Id: I367f7ee487700c24a4958e65ad957299ab91074c
diff --git a/src/com/android/contacts/ui/ContactsPreferencesActivity.java b/src/com/android/contacts/ui/ContactsPreferencesActivity.java
index 0432aaf..5a89745 100644
--- a/src/com/android/contacts/ui/ContactsPreferencesActivity.java
+++ b/src/com/android/contacts/ui/ContactsPreferencesActivity.java
@@ -1050,7 +1050,13 @@
final Context context = target;
final ProgressDialog dialog = mProgress.get();
- if (dialog != null) dialog.dismiss();
+ if (dialog != null) {
+ try {
+ dialog.dismiss();
+ } catch (Exception e) {
+ Log.e(TAG, "Error dismissing progress dialog", e);
+ }
+ }
target.finish();