diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index f7ed47a..5b6d24a 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -880,6 +880,46 @@
                 android:resource="@id/application_settings" />
         </activity-alias>
 
+        <activity android:name="Settings$UsbSettingsActivity"
+                android:theme="@android:style/Theme.Holo"
+                android:label="@string/storage_title_usb"
+                android:clearTaskOnLaunch="true">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <action android:name="android.settings.STORAGE_USB_SETTINGS" />
+                <action android:name="com.android.settings.STORAGE_USB_SETTINGS" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+                android:value="com.android.settings.deviceinfo.UsbSettings" />
+            <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
+                android:resource="@id/storage_settings" />
+            <meta-data android:name="com.android.settings.PARENT_FRAGMENT_TITLE"
+                android:resource="@string/storage_settings_title" />
+            <meta-data android:name="com.android.settings.PARENT_FRAGMENT_CLASS"
+                android:value="com.android.settings.Settings$StorageSettingsActivity" />
+        </activity>
+
+        <activity-alias android:name="UsbSettings"
+                  android:clearTaskOnLaunch="true"
+                  android:exported="true"
+                  android:label="@string/storage_title_usb"
+                  android:targetActivity="Settings$DevelopmentSettingsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <action android:name="android.settings.STORAGE_USB_SETTINGS" />
+                <action android:name="com.android.settings.STORAGE_USB_SETTINGS" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+                android:value="com.android.settings.deviceinfo.UsbSettings" />
+            <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
+                android:resource="@id/storage_settings" />
+            <meta-data android:name="com.android.settings.PARENT_FRAGMENT_TITLE"
+                android:resource="@string/storage_settings_title" />
+            <meta-data android:name="com.android.settings.PARENT_FRAGMENT_CLASS"
+                android:value="com.android.settings.Settings$StorageSettingsActivity" />
+        </activity-alias>
 
         <!-- Bluetooth stuff -->
 
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 9bc81d3..364ae3e 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1724,6 +1724,17 @@
     <!-- SD card eject progress text   -->
     <string name="sd_ejecting_summary">Unmount in progress</string>
 
+    <!-- Storage setting.  Menu option for USB transfer settings [CHAR LIMIT=30]-->
+    <string name="storage_menu_usb">USB transfer settings</string>
+    <!-- Storage setting.  Title for USB transfer settings [CHAR LIMIT=30]-->
+    <string name="storage_title_usb">USB transfer settings</string>
+    <!-- Storage setting.  Label for MTP setting [CHAR LIMIT=30]-->
+    <string name="usb_label_mtp">Connect as a media device (MTP)</string>
+    <!-- Storage setting.  Label for PTP setting [CHAR LIMIT=30]-->
+    <string name="usb_label_ptp">Connect as a camera (PTP)</string>
+    <!-- Storage setting.  Label for installer CD [CHAR LIMIT=30]-->
+    <string name="usb_label_installer_cd">Install file transfer tools</string>
+
     <!-- Phone info screen, section titles: -->
     <string name="battery_status_title">Battery status</string>
     <!-- Phone info screen, section titles: -->
diff --git a/res/xml/usb_settings.xml b/res/xml/usb_settings.xml
new file mode 100644
index 0000000..e2a950d
--- /dev/null
+++ b/res/xml/usb_settings.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+        android:title="@string/location_settings_title">
+
+    <CheckBoxPreference
+        android:key="usb_mtp"
+        android:title="@string/usb_label_mtp"
+        />
+
+    <CheckBoxPreference
+        android:key="usb_ptp"
+        android:title="@string/usb_label_ptp"
+        />
+
+</PreferenceScreen>
diff --git a/src/com/android/settings/deviceinfo/Memory.java b/src/com/android/settings/deviceinfo/Memory.java
index 94ad3e6..3205a3e 100644
--- a/src/com/android/settings/deviceinfo/Memory.java
+++ b/src/com/android/settings/deviceinfo/Memory.java
@@ -34,8 +34,12 @@
 import android.os.storage.StorageManager;
 import android.os.storage.StorageVolume;
 import android.preference.Preference;
+import android.preference.PreferenceActivity;
 import android.preference.PreferenceScreen;
 import android.util.Log;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
 import android.widget.Toast;
 
 import com.android.settings.R;
@@ -47,6 +51,8 @@
     private static final int DLG_CONFIRM_UNMOUNT = 1;
     private static final int DLG_ERROR_UNMOUNT = 2;
 
+    private static final int MENU_ID_USB = Menu.FIRST;
+
     private Resources mResources;
 
     // The mountToggle Preference that has last been clicked.
@@ -88,6 +94,9 @@
         }
 
         StorageVolume[] storageVolumes = mStorageManager.getVolumeList();
+        // mass storage is enabled if primary volume supports it
+        boolean massStorageEnabled = (storageVolumes.length > 0
+                && storageVolumes[0].allowMassStorage());
         int length = storageVolumes.length;
         mStorageVolumePreferenceCategories = new StorageVolumePreferenceCategory[length];
         for (int i = 0; i < length; i++) {
@@ -99,6 +108,9 @@
             getPreferenceScreen().addPreference(storagePreferenceCategory);
             storagePreferenceCategory.init();
         }
+
+        // only show options menu if we are not using the legacy USB mass storage support
+        setHasOptionsMenu(!massStorageEnabled);
     }
 
     @Override
@@ -153,6 +165,31 @@
         super.onDestroy();
     }
 
+    @Override
+    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+        menu.add(Menu.NONE, MENU_ID_USB, 0, R.string.storage_menu_usb)
+                //.setIcon(com.android.internal.R.drawable.stat_sys_data_usb)
+                .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        switch (item.getItemId()) {
+            case MENU_ID_USB:
+                if (getActivity() instanceof PreferenceActivity) {
+                    ((PreferenceActivity) getActivity()).startPreferencePanel(
+                            UsbSettings.class.getCanonicalName(),
+                            null,
+                            R.string.storage_title_usb, null,
+                            this, 0);
+                } else {
+                    startFragment(this, UsbSettings.class.getCanonicalName(), -1, null);
+                }
+                return true;
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
     private synchronized IMountService getMountService() {
        if (mMountService == null) {
            IBinder service = ServiceManager.getService("mount");
diff --git a/src/com/android/settings/deviceinfo/UsbSettings.java b/src/com/android/settings/deviceinfo/UsbSettings.java
new file mode 100644
index 0000000..5da13af
--- /dev/null
+++ b/src/com/android/settings/deviceinfo/UsbSettings.java
@@ -0,0 +1,150 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.deviceinfo;
+
+import android.content.ContentQueryMap;
+import android.content.ContentResolver;
+import android.content.Context;
+import android.hardware.usb.UsbManager;
+import android.os.Bundle;
+import android.os.storage.StorageManager;
+import android.os.storage.StorageVolume;
+import android.preference.CheckBoxPreference;
+import android.preference.Preference;
+import android.preference.PreferenceScreen;
+import android.provider.Settings;
+import android.util.Log;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+
+import com.android.settings.R;
+import com.android.settings.SettingsPreferenceFragment;
+
+import java.io.File;
+
+/**
+ * USB storage settings.
+ */
+public class UsbSettings extends SettingsPreferenceFragment {
+
+    private static final String TAG = "UsbSettings";
+
+    private static final String KEY_MTP = "usb_mtp";
+    private static final String KEY_PTP = "usb_ptp";
+    private static final String KEY_INSTALLER_CD = "usb_installer_cd";
+    private static final int MENU_ID_INSTALLER_CD = Menu.FIRST;
+
+    private UsbManager mUsbManager;
+    private String mInstallerImagePath;
+    private CheckBoxPreference mMtp;
+    private CheckBoxPreference mPtp;
+
+    private PreferenceScreen createPreferenceHierarchy() {
+        PreferenceScreen root = getPreferenceScreen();
+        if (root != null) {
+            root.removeAll();
+        }
+        addPreferencesFromResource(R.xml.usb_settings);
+        root = getPreferenceScreen();
+
+        mMtp = (CheckBoxPreference)root.findPreference(KEY_MTP);
+        mPtp = (CheckBoxPreference)root.findPreference(KEY_PTP);
+
+        return root;
+    }
+
+    @Override
+    public void onCreate(Bundle icicle) {
+        super.onCreate(icicle);
+        mUsbManager = (UsbManager)getSystemService(Context.USB_SERVICE);
+        mInstallerImagePath = getString(com.android.internal.R.string.config_isoImagePath);
+        if (!(new File(mInstallerImagePath)).exists()) {
+            mInstallerImagePath = null;
+        }
+        setHasOptionsMenu(mInstallerImagePath != null);
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+
+        // Make sure we reload the preference hierarchy since some of these settings
+        // depend on others...
+        createPreferenceHierarchy();
+        updateToggles();
+    }
+
+    private void updateToggles() {
+        if (mUsbManager.isFunctionEnabled(UsbManager.USB_FUNCTION_MTP)) {
+            mMtp.setChecked(true);
+            mPtp.setChecked(false);
+        } else if (mUsbManager.isFunctionEnabled(UsbManager.USB_FUNCTION_PTP)) {
+            mMtp.setChecked(false);
+            mPtp.setChecked(true);
+        } else  {
+            mMtp.setChecked(false);
+            mPtp.setChecked(false);
+        }
+    }
+
+    @Override
+    public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
+        Log.d(TAG, "onPreferenceTreeClick " + preference);
+
+        // temporary hack - using check boxes as radio buttons
+        // don't allow unchecking them
+        if (preference instanceof CheckBoxPreference) {
+            CheckBoxPreference checkBox = (CheckBoxPreference)preference;
+            if (!checkBox.isChecked()) {
+                checkBox.setChecked(true);
+                return true;
+            }
+        }
+
+        if (preference == mMtp) {
+            mUsbManager.setCurrentFunction(UsbManager.USB_FUNCTION_MTP, true);
+            mPtp.setChecked(false);
+        } else if (preference == mPtp) {
+            mUsbManager.setCurrentFunction(UsbManager.USB_FUNCTION_PTP, true);
+            mMtp.setChecked(false);
+        }
+
+        return true;
+    }
+
+    @Override
+    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+        menu.add(Menu.NONE, MENU_ID_INSTALLER_CD, 0, R.string.usb_label_installer_cd)
+                //.setIcon(com.android.internal.R.drawable.stat_sys_data_usb)
+                .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        switch (item.getItemId()) {
+            case MENU_ID_INSTALLER_CD:
+                // installer CD is never default
+                mUsbManager.setCurrentFunction(UsbManager.USB_FUNCTION_MASS_STORAGE, false);
+                mUsbManager.setMassStorageBackingFile(mInstallerImagePath);
+                mMtp.setChecked(false);
+                mPtp.setChecked(false);
+                return true;
+        }
+        return super.onOptionsItemSelected(item);
+    }
+}
