Remove StorageManager#mountAppFuse hidden API.
The API should be replaced with StorageManager#openProxyFileDescriptor. Bug: 32891253 Test: build Change-Id: Ibbf8b64f3a39900a1f05a52132aa931491d6fd48
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user