Browser settings refactor

Change-Id: I6fc1b21f7ea692fbe37a17bf900e9b7408a9c077
diff --git a/src/com/android/browser/AutoFillSettingsFragment.java b/src/com/android/browser/AutoFillSettingsFragment.java
index 3a7ae12..e87645e 100644
--- a/src/com/android/browser/AutoFillSettingsFragment.java
+++ b/src/com/android/browser/AutoFillSettingsFragment.java
@@ -53,6 +53,7 @@
 
     // Used to display toast after DB interactions complete.
     private Handler mHandler;
+    private BrowserSettings mSettings;
 
     private final static int PROFILE_SAVED_MSG = 100;
     private final static int PROFILE_DELETED_MSG = 101;
@@ -130,6 +131,7 @@
     @Override
     public void onCreate(Bundle savedState) {
         super.onCreate(savedState);
+        mSettings = BrowserSettings.getInstance();
     }
 
     @Override
@@ -177,7 +179,7 @@
                         mCountryEdit.getText().toString(),
                         mPhoneEdit.getText().toString());
 
-                BrowserSettings.getInstance().setAutoFillProfile(getActivity(), newProfile,
+                mSettings.setAutoFillProfile(newProfile,
                         mHandler.obtainMessage(PROFILE_SAVED_MSG));
                 closeEditor();
             }
@@ -200,7 +202,7 @@
 
                 // Update browser settings and native with a null profile. This will
                 // trigger the current profile to get deleted from the DB.
-                BrowserSettings.getInstance().setAutoFillProfile(getActivity(), null,
+                mSettings.setAutoFillProfile(null,
                         mHandler.obtainMessage(PROFILE_DELETED_MSG));
 
                 updateButtonState();
@@ -215,7 +217,7 @@
         });
 
         // Populate the text boxes with any pre existing AutoFill data.
-        AutoFillProfile activeProfile = BrowserSettings.getInstance().getAutoFillProfile();
+        AutoFillProfile activeProfile = mSettings.getAutoFillProfile();
         if (activeProfile != null) {
             mFullNameEdit.setText(activeProfile.getFullName());
             mEmailEdit.setText(activeProfile.getEmailAddress());