Revert: Add checkbox to enable PTP USB mode.

Change-Id: I7c00c3c3c5da66a31a68fe0767302d2cdda526a1
Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Mike Lockwood
2010-08-31 14:38:44 -04:00
parent 73e70721b0
commit bbef4f9a7d
3 changed files with 0 additions and 27 deletions

View File

@@ -1456,9 +1456,6 @@
<!-- SD card & phone storage settings item title that will result in the phone unmounting the SD card. This will be done before the user phyiscally removes the SD card from the phone. Kind of like the "Safely remove" on some operating systems. -->
<string name="sd_eject_summary" product="default">Unmount the SD card so you can safely remove it</string>
<!-- SD card & phone storage settings item title for toggling PTP mode on and off. When PTP mode is on the device will appear on the USB bus as a PTP camera device instead of an MTP music player. -->
<string name="ptp_mode">Enable PTP mode</string>
<!-- SD card & phone storage settings item summary for toggling PTP mode on and off. When PTP mode is on the device will appear on the USB bus as a PTP camera device instead of an MTP music player. -->
<string name="ptp_mode_summary">Appear on USB as a PTP camera device instead of an MTP device</string>
<!-- SD card & phone storage settings item summary that is displayed when no SD card is inserted. This version of the string can probably never come up on current hardware. [CHAR LIMIT=25] -->
<string name="sd_insert_summary" product="nosdcard">Insert USB storage for mounting</string>

View File

@@ -53,9 +53,6 @@
android:icon="@color/memory_avail"
android:title="@string/memory_available"
android:summary="00"/>
<CheckBoxPreference android:key="ptp_mode_toggle"
android:title="@string/ptp_mode"
android:summary="@string/ptp_mode_summary"/>
</PreferenceCategory>
</PreferenceScreen>

View File

@@ -51,11 +51,9 @@ import android.os.StatFs;
import android.os.storage.IMountService;
import android.os.storage.StorageEventListener;
import android.os.storage.StorageManager;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;
import android.provider.Settings;
import android.text.format.Formatter;
import android.util.Log;
import android.widget.Toast;
@@ -78,8 +76,6 @@ public class Memory extends SettingsPreferenceFragment implements OnCancelListen
private static final String MEMORY_SD_GROUP = "memory_sd";
private static final String PTP_MODE_TOGGLE = "ptp_mode_toggle";
private static final String MEMORY_INTERNAL_SIZE = "memory_internal_size";
private static final String MEMORY_INTERNAL_AVAIL = "memory_internal_avail";
@@ -123,8 +119,6 @@ public class Memory extends SettingsPreferenceFragment implements OnCancelListen
boolean mSdMountToggleAdded = true;
private CheckBoxPreference mPtpModeToggle;
// Access using getMountService()
private IMountService mMountService = null;
@@ -391,16 +385,6 @@ public class Memory extends SettingsPreferenceFragment implements OnCancelListen
mSdMountPreferenceGroup.removePreference(mSdMountToggle);
}
mPtpModeToggle = (CheckBoxPreference)findPreference(PTP_MODE_TOGGLE);
if (UsbManager.isFunctionSupported(UsbManager.USB_FUNCTION_MTP)) {
mPtpModeToggle.setChecked(Settings.System.getInt(
getContentResolver(),
Settings.System.USE_PTP_INTERFACE, 0) != 0);
} else {
// hide the PTP mode toggle checkbox if MTP is not supported
getPreferenceScreen().removePreference(mPtpModeToggle);
}
mInternalSize = findPreference(MEMORY_INTERNAL_SIZE);
mInternalAvail = findPreference(MEMORY_INTERNAL_AVAIL);
mInternalMediaUsage = findPreference(MEMORY_INTERNAL_MEDIA);
@@ -485,11 +469,6 @@ public class Memory extends SettingsPreferenceFragment implements OnCancelListen
intent.setClass(getActivity(), com.android.settings.MediaFormat.class);
startActivity(intent);
return true;
} else if (preference == mPtpModeToggle) {
Settings.System.putInt(getContentResolver(),
Settings.System.USE_PTP_INTERFACE,
mPtpModeToggle.isChecked() ? 1 : 0);
return true;
}
return false;