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

Commit f486e515 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Auto-Share SdCard on PC on insertion if ums was ON when it was removed"

parents f895471b ac373b9d
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -854,12 +854,14 @@ class MountService extends IMountService.Stub
            }

            if (code == VoldResponseCode.VolumeDiskInserted) {
                if(!isUsbMassStorageConnected())
                    new Thread("MountService#VolumeDiskInserted") {
                        @Override
                        public void run() {
                            try {
                                int rc;
                            if ((rc = doMountVolume(path)) != StorageResultCode.OperationSucceeded) {
                                if ((rc = doMountVolume(path)) !=
                                        StorageResultCode.OperationSucceeded) {
                                    Slog.w(TAG, String.format("Insertion mount failed (%d)", rc));
                                }
                            } catch (Exception ex) {
@@ -940,6 +942,8 @@ class MountService extends IMountService.Stub
                updatePublicVolumeState(volume, Environment.MEDIA_UNMOUNTED);
                action = Intent.ACTION_MEDIA_UNMOUNTED;
            }
            if(isUsbMassStorageConnected() && volume.allowMassStorage())
                doShareUnshareVolume(path, "ums", true);
        } else if (newState == VolumeState.Pending) {
        } else if (newState == VolumeState.Checking) {
            if (DEBUG_EVENTS) Slog.i(TAG, "updating volume state checking");