diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java
index 8ae5888..943a4e6 100644
--- a/src/com/android/settings/DevelopmentSettings.java
+++ b/src/com/android/settings/DevelopmentSettings.java
@@ -766,22 +766,24 @@
                 Log.e(TAG, "No WebView providers available");
                 return;
             }
-            String[] options = new String[providers.length];
-            String[] values = new String[providers.length];
+            ArrayList<String> options = new ArrayList<String>();
+            ArrayList<String> values = new ArrayList<String>();
             for(int n = 0; n < providers.length; n++) {
-                options[n] = providers[n].description;
-                values[n] = providers[n].packageName;
+                if (isPackageEnabled(providers[n].packageName)) {
+                    options.add(providers[n].description);
+                    values.add(providers[n].packageName);
+                }
             }
-            mWebViewProvider.setEntries(options);
-            mWebViewProvider.setEntryValues(values);
+            mWebViewProvider.setEntries(options.toArray(new String[options.size()]));
+            mWebViewProvider.setEntryValues(values.toArray(new String[values.size()]));
 
             String value = mWebViewUpdateService.getCurrentWebViewPackageName();
             if (value == null) {
                 value = "";
             }
 
-            for (int i = 0; i < values.length; i++) {
-                if (value.contentEquals(values[i])) {
+            for (int i = 0; i < values.size(); i++) {
+                if (value.contentEquals(values.get(i))) {
                     mWebViewProvider.setValueIndex(i);
                     return;
                 }
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index b6ac0c0..b875823 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -460,18 +460,22 @@
     @Override
     public SharedPreferences getSharedPreferences(String name, int mode) {
         if (name.equals(getPackageName() + "_preferences")) {
-            String tag = getClass().getName();
-            if (getIntent() != null && getIntent().hasExtra(EXTRA_SHOW_FRAGMENT)) {
-                tag = getIntent().getStringExtra(EXTRA_SHOW_FRAGMENT);
-            }
-            if (tag.startsWith("com.android.settings.")) {
-                tag = tag.replace("com.android.settings.", "");
-            }
-            return new SharedPreferencesLogger(this, tag);
+            return new SharedPreferencesLogger(this, getMetricsTag());
         }
         return super.getSharedPreferences(name, mode);
     }
 
+    private String getMetricsTag() {
+        String tag = getClass().getName();
+        if (getIntent() != null && getIntent().hasExtra(EXTRA_SHOW_FRAGMENT)) {
+            tag = getIntent().getStringExtra(EXTRA_SHOW_FRAGMENT);
+        }
+        if (tag.startsWith("com.android.settings.")) {
+            tag = tag.replace("com.android.settings.", "");
+        }
+        return tag;
+    }
+
     private static boolean isShortCutIntent(final Intent intent) {
         Set<String> categories = intent.getCategories();
         return (categories != null) && categories.contains("com.android.settings.SHORTCUT");
@@ -610,6 +614,9 @@
             mActionBar.setHomeButtonEnabled(mDisplayHomeAsUpEnabled);
         }
         mSwitchBar = (SwitchBar) findViewById(R.id.switch_bar);
+        if (mSwitchBar != null) {
+            mSwitchBar.setMetricsTag(getMetricsTag());
+        }
 
         // see if we should show Back/Next buttons
         if (intent.getBooleanExtra(EXTRA_PREFS_SHOW_BUTTON_BAR, false)) {
diff --git a/src/com/android/settings/widget/SwitchBar.java b/src/com/android/settings/widget/SwitchBar.java
index 019103f..adf1ce0 100644
--- a/src/com/android/settings/widget/SwitchBar.java
+++ b/src/com/android/settings/widget/SwitchBar.java
@@ -34,6 +34,7 @@
 import android.widget.Switch;
 import android.widget.TextView;
 
+import com.android.internal.logging.MetricsLogger;
 import com.android.settings.R;
 import com.android.settingslib.RestrictedLockUtils;
 
@@ -64,6 +65,8 @@
     private boolean mDisabledByAdmin = false;
     private EnforcedAdmin mEnforcedAdmin = null;
 
+    private String mMetricsTag;
+
     private ArrayList<OnSwitchChangeListener> mSwitchChangeListeners =
             new ArrayList<OnSwitchChangeListener>();
 
@@ -125,6 +128,10 @@
         setVisibility(View.GONE);
     }
 
+    public void setMetricsTag(String tag) {
+        mMetricsTag = tag;
+    }
+
     public void setTextViewLabel(boolean isChecked) {
         mLabel = getResources()
                 .getString(isChecked ? R.string.switch_on_text : R.string.switch_off_text);
@@ -217,9 +224,11 @@
     @Override
     public void onClick(View v) {
         if (mDisabledByAdmin) {
+            MetricsLogger.histogram(mContext, mMetricsTag + "/switch_bar|restricted", 1);
             RestrictedLockUtils.sendShowAdminSupportDetailsIntent(mContext, mEnforcedAdmin);
         } else {
             final boolean isChecked = !mSwitch.isChecked();
+            MetricsLogger.histogram(mContext, mMetricsTag + "/switch_bar|" + isChecked, 1);
             setChecked(isChecked);
         }
     }
