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

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

LegacyUSB: Squashed commit with updates for 4.2

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

LegacyUSB: Add support for legacy USB implementations

Rebased for ICS 4.0.3

Option to hide Adb notification icon (framework) - authorship belongs to Rick C

Change-Id: Id14f70f7e21b689c08cadef69f69da711c7dc566
parent a6519ca7
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1078,4 +1078,9 @@
         the GPU to handle. -->
    <integer name="config_wallpaperMaxWidth">-1</integer>

    <!-- 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 −0
Original line number Diff line number Diff line
@@ -1837,6 +1837,7 @@
  <java-symbol type="bool" name="config_smsSamsungCdmaAlternateMessageIDEncoding" />
  <java-symbol type="bool" name="config_samsung_stk" />
  <java-symbol type="integer" name="config_wallpaperMaxWidth" />
  <java-symbol type="string" name="config_legacyUmsLunFile" />

  <!-- Hardware Key ReMapping -->
  <java-symbol type="integer" name="config_deviceHardwareKeys" />
+670 −0

File added.

Preview size limit exceeded, changes collapsed.

+7 −0
Original line number Diff line number Diff line
@@ -147,6 +147,13 @@ public class UsbDeviceManager {
        }
    };

    // Dummy constructor to use when extending class
    public UsbDeviceManager() {
        mContext = null;
        mContentResolver = null;
        mHasUsbAccessory = false;
    }

    public UsbDeviceManager(Context context) {
        mContext = context;
        mContentResolver = context.getContentResolver();
+3 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.hardware.usb.IUsbManager;
import android.hardware.usb.UsbAccessory;
import android.hardware.usb.UsbDevice;
@@ -77,6 +78,8 @@ public class UsbService extends IUsbManager.Stub {
        if (new File("/sys/class/android_usb").exists()) {
            mDeviceManager = new UsbDeviceManager(context);
        }
        else if(new File(Resources.getSystem().getString(com.android.internal.R.string.config_legacyUmsLunFile)).exists())
            mDeviceManager = new LegacyUsbDeviceManager(context);

        setCurrentUser(UserHandle.USER_OWNER);