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

Commit 3c682cab authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove StorageManager#mountAppFuse hidden API."

parents bde6044b baa01168
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -286,7 +286,6 @@ interface IStorageManager {
    void prepareUserStorage(in String volumeUuid, int userId, int serialNumber, int flags) = 66;
    void destroyUserStorage(in String volumeUuid, int userId, int flags) = 67;
    boolean isConvertibleToFBE() = 68;
    ParcelFileDescriptor mountAppFuse(in String name) = 69;
    void addUserKeyAuth(int userId, int serialNumber, in byte[] token, in byte[] secret) = 70;
    void fixateNewestUserKeyAuth(int userId) = 71;
    void fstrim(int flags) = 72;
+0 −10
Original line number Diff line number Diff line
@@ -1318,16 +1318,6 @@ public class StorageManager {
        return path;
    }

    /** {@hide} */
    public ParcelFileDescriptor mountAppFuse(String name) {
        try {
            return mStorageManager.mountAppFuse(name);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }


    /** {@hide} */
    @VisibleForTesting
    public @NonNull ParcelFileDescriptor openProxyFileDescriptor(
+0 −32
Original line number Diff line number Diff line
@@ -2991,38 +2991,6 @@ class StorageManagerService extends IStorageManager.Stub
        }
    }

    @Override
    public ParcelFileDescriptor mountAppFuse(final String name) throws RemoteException {
        try {
            final int uid = Binder.getCallingUid();
            final int pid = Binder.getCallingPid();
            final NativeDaemonEvent event =
                    mConnector.execute("appfuse", "mount", uid, pid, name);
            if (event.getFileDescriptors() == null) {
                throw new RemoteException("AppFuse FD from vold is null.");
            }
            return ParcelFileDescriptor.fromFd(
                    event.getFileDescriptors()[0],
                    mHandler,
                    new ParcelFileDescriptor.OnCloseListener() {
                        @Override
                        public void onClose(IOException e) {
                            try {
                                final NativeDaemonEvent event = mConnector.execute(
                                        "appfuse", "unmount", uid, pid, name);
                            } catch (NativeDaemonConnectorException unmountException) {
                                Log.e(TAG, "Failed to unmount appfuse.");
                            }
                        }
                    });
        } catch (NativeDaemonConnectorException e) {
            throw e.rethrowAsParcelableException();
        } catch (IOException e) {
            throw new RemoteException(e.getMessage());
        }
    }


    class CloseableHolder<T extends AutoCloseable> implements AutoCloseable {
        @Nullable T mCloseable;