Only close the AutoFill editor when we're actually done with it

We need the activity to still be alive when the PROFILE_SAVED
callback occurs so that we can get the context to display the toast.
So don't close the editor until we've shown the toast.

Bug: 4615099
Change-Id: I61fee12258193815efb999c576309fef9ac33d23
diff --git a/src/com/android/browser/AutoFillSettingsFragment.java b/src/com/android/browser/AutoFillSettingsFragment.java
index b282789..141de34 100644
--- a/src/com/android/browser/AutoFillSettingsFragment.java
+++ b/src/com/android/browser/AutoFillSettingsFragment.java
@@ -120,6 +120,7 @@
                 case PROFILE_SAVED_MSG:
                     Toast.makeText(getActivity(), R.string.autofill_profile_successful_save,
                             Toast.LENGTH_SHORT).show();
+                    closeEditor();
                     break;
 
                 case PROFILE_DELETED_MSG:
@@ -215,7 +216,6 @@
 
                 mSettings.setAutoFillProfile(newProfile,
                         mHandler.obtainMessage(PROFILE_SAVED_MSG));
-                closeEditor();
             }
         });