Update VsockConnectionProvider docs
This is mostly AI-powered-copy-pasting docs from other methods onto
these to make them more clear if you don't read the whole file.
Fixes: 404512505
Test: N/A
Change-Id: Ied3a3c10c31068621dcdfc6806a0287203d28a92
diff --git a/libs/framework-virtualization/src/android/system/virtualmachine/VirtualMachine.java b/libs/framework-virtualization/src/android/system/virtualmachine/VirtualMachine.java
index b8b4ace..eba6fcc 100644
--- a/libs/framework-virtualization/src/android/system/virtualmachine/VirtualMachine.java
+++ b/libs/framework-virtualization/src/android/system/virtualmachine/VirtualMachine.java
@@ -1981,6 +1981,12 @@
@SystemApi
@SuppressLint("UnflaggedApi") // already existing functionality exposed, users should flag
public interface VsockConnectionProvider {
+ /**
+ * Returns a connection, either from {@link #connectVsock} or from
+ * the VM owner which would call {@link #connectVsock} on your behalf.
+ *
+ * <p>Each call should return a new connection.
+ */
@NonNull
@SuppressLint("UnflaggedApi") // already existing functionality exposed, users should flag
public ParcelFileDescriptor addConnection() throws VirtualMachineException;
@@ -2042,8 +2048,21 @@
/**
* Convert existing vsock connection to a binder connection.
*
+ * <p>See {@linkplain #connectToVsockServer} for details. This method allows
+ * you to create the connects independently from upgrading them to the
+ * binder connection. Specifically:
+ *
* <p>connectToVsockServer = connectToVsock + binderFromPreconnectedClient
*
+ * <p>This method is useful if you want to pass the vsock connection to
+ * another process before establishing the RPC binder connection, so that
+ * you can create a direct connection.
+ *
+ * @args
+ * provider: a provider that provides the vsock connection. This
+ * provider should return connections from
+ * {@link #connectVsock}, from the VM owner.
+ *
* @hide
*/
@SystemApi