Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4dbaf3ee authored by Tom Giordano's avatar Tom Giordano Committed by Gerrit Code Review
Browse files

LegacyUSB: add overlay for UMS lun and use existence of lun to enable legacy USB

Change-Id: Id14f70f7e21b689c08cadef69f69da711c7dc566
parent 1578863d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -868,7 +868,9 @@

    <!-- CM CHANGES START HERE -->

    <!-- Use legacy USB device manager. -->
    <bool name="config_usesLegacyUsbDeviceManager">false</bool>
    <!-- LUN file to be used by legacy USB manager.
         The existence of this file will be used to determine in the
         legacy USB manager should be started. -->
    <string name="config_legacyUmsLunFile">/sys/devices/platform/usb_mass_storage/lun0/file</string>

</resources>
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ public class LegacyUsbDeviceManager extends UsbDeviceManager {
    private static final String FUNCTIONS_PATH =
            "/sys/devices/virtual/usb_composite/";
    private static final String MASS_STORAGE_FILE_PATH =
            "/sys/devices/platform/msm_hsusb/gadget/lun0/file";
            Resources.getSystem().getString(com.android.internal.R.string.config_legacyUmsLunFile);

    private static final int MSG_UPDATE_STATE = 0;
    private static final int MSG_ENABLE_ADB = 1;
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ public class UsbService extends IUsbManager.Stub {
        if (new File("/sys/class/android_usb").exists()) {
            mDeviceManager = new UsbDeviceManager(context, mSettingsManager);
        }
        else if(Resources.getSystem().getBoolean(com.android.internal.R.bool.config_usesLegacyUsbDeviceManager))
        else if(new File(Resources.getSystem().getString(com.android.internal.R.string.config_legacyUmsLunFile)).exists())
            mDeviceManager = new LegacyUsbDeviceManager(context, mSettingsManager);
    }