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

Commit 292f8e86 authored by Anton Hansson's avatar Anton Hansson Committed by android-build-merger
Browse files

Merge "Fix AppFuseMountScope.close()" into qt-dev

am: ab09bd96

Change-Id: I5fe3355388f4ca19b1a9571211c67d6c48ddfa57
parents 87c7abf0 ab09bd96
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -2842,8 +2842,9 @@ class StorageManagerService extends IStorageManager.Stub
        }
    }

    /** Not thread safe */
    class AppFuseMountScope extends AppFuseBridge.MountScope {
        boolean opened = false;
        private boolean mMounted = false;

        public AppFuseMountScope(int uid, int mountId) {
            super(uid, mountId);
@@ -2852,8 +2853,9 @@ class StorageManagerService extends IStorageManager.Stub
        @Override
        public ParcelFileDescriptor open() throws NativeDaemonConnectorException {
            try {
                return new ParcelFileDescriptor(
                        mVold.mountAppFuse(uid, mountId));
                final FileDescriptor fd = mVold.mountAppFuse(uid, mountId);
                mMounted = true;
                return new ParcelFileDescriptor(fd);
            } catch (Exception e) {
                throw new NativeDaemonConnectorException("Failed to mount", e);
            }
@@ -2872,9 +2874,9 @@ class StorageManagerService extends IStorageManager.Stub

        @Override
        public void close() throws Exception {
            if (opened) {
            if (mMounted) {
                mVold.unmountAppFuse(uid, mountId);
                opened = false;
                mMounted = false;
            }
        }
    }