DO NOT MERGE ANYWHERE - Hack to disable MTP mode on Clockwork devices.
Android currently forces USB into MTP mode if there was no modes specified. This causes issues on Clockwork devices as they do not support MTP. The hack stops this behaviour, and also sets MTP mode back to none. Bug: 25547826 Bug: 25582050 Bug: 25244201 Change-Id: I772e35d0a5db51b17e9d71c59e6a157dabb1d296
This commit is contained in:
@@ -332,9 +332,11 @@ public class UsbDeviceManager {
|
||||
// Restore default functions.
|
||||
mCurrentFunctions = SystemProperties.get(USB_CONFIG_PROPERTY,
|
||||
UsbManager.USB_FUNCTION_NONE);
|
||||
if (UsbManager.USB_FUNCTION_NONE.equals(mCurrentFunctions)) {
|
||||
mCurrentFunctions = UsbManager.USB_FUNCTION_MTP;
|
||||
// HACK START FOR DEVICES WITHOUT SUPPORT MTP, WATCH ONLY, DO NOT MERGE BACK TO AOSP
|
||||
if (UsbManager.USB_FUNCTION_MTP.equals(mCurrentFunctions)) {
|
||||
mCurrentFunctions = UsbManager.USB_FUNCTION_NONE;
|
||||
}
|
||||
// HACK ENDS (mkwan@ added 2015-11-16)
|
||||
mCurrentFunctionsApplied = mCurrentFunctions.equals(
|
||||
SystemProperties.get(USB_STATE_PROPERTY));
|
||||
mAdbEnabled = UsbManager.containsFunction(getDefaultFunctions(),
|
||||
@@ -838,9 +840,11 @@ public class UsbDeviceManager {
|
||||
private String getDefaultFunctions() {
|
||||
String func = SystemProperties.get(USB_PERSISTENT_CONFIG_PROPERTY,
|
||||
UsbManager.USB_FUNCTION_NONE);
|
||||
if (UsbManager.USB_FUNCTION_NONE.equals(func)) {
|
||||
func = UsbManager.USB_FUNCTION_MTP;
|
||||
// HACK START FOR DEVICES WITHOUT SUPPORT MTP, WATCH ONLY, DO NOT MERGE BACK TO AOSP
|
||||
if (UsbManager.USB_FUNCTION_MTP.equals(func)) {
|
||||
func = UsbManager.USB_FUNCTION_NONE;
|
||||
}
|
||||
// HACK ENDS (mkwan@ added 2015-11-16)
|
||||
return func;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user