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

Commit c74d5845 authored by Scott Mertz's avatar Scott Mertz
Browse files

ums: support UMS on any volume

Change-Id: I43668a5200d30cef953e0d3e9ded2d8cf0cbbd22
parent cbb0d7c0
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -1396,10 +1396,14 @@ class MountService extends IMountService.Stub
        mContext.registerReceiver(mUserReceiver, userFilter, null, mHandler);

        // Watch for USB changes on primary volume
        final StorageVolume primary = getPrimaryPhysicalVolume();
        if (primary != null && primary.allowMassStorage()) {
        final StorageVolume[] storageVolumes = getVolumeList();
        for(StorageVolume volume : storageVolumes) {
            if (volume.allowMassStorage()) {
                mContext.registerReceiver(
                    mUsbReceiver, new IntentFilter(UsbManager.ACTION_USB_STATE), null, mHandler);
                        mUsbReceiver,
                        new IntentFilter(UsbManager.ACTION_USB_STATE), null, mHandler);
                break;
            }
        }

        // Watch for idle maintenance changes
@@ -1570,9 +1574,6 @@ class MountService extends IMountService.Stub
        waitForReady();
        validatePermission(android.Manifest.permission.MOUNT_UNMOUNT_FILESYSTEMS);

        final StorageVolume primary = getPrimaryPhysicalVolume();
        if (primary == null) return;

        // TODO: Add support for multiple share methods

        for (String path : getShareableVolumes()) {