diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 2e2ee23ab3416..eb2d2ca895881 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -3097,7 +3097,7 @@ package android.companion.virtual.sensor {
public class VirtualSensor {
method @NonNull public String getName();
method public int getType();
- method @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public void sendSensorEvent(@NonNull android.companion.virtual.sensor.VirtualSensorEvent);
+ method @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public void sendEvent(@NonNull android.companion.virtual.sensor.VirtualSensorEvent);
}
public static interface VirtualSensor.SensorStateChangeCallback {
diff --git a/core/java/android/companion/virtual/sensor/VirtualSensor.java b/core/java/android/companion/virtual/sensor/VirtualSensor.java
index a184481bdf99d..58a5387c56517 100644
--- a/core/java/android/companion/virtual/sensor/VirtualSensor.java
+++ b/core/java/android/companion/virtual/sensor/VirtualSensor.java
@@ -20,6 +20,7 @@ import android.annotation.NonNull;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.companion.virtual.IVirtualDevice;
+import android.hardware.Sensor;
import android.os.IBinder;
import android.os.RemoteException;
@@ -68,8 +69,10 @@ public class VirtualSensor {
}
/**
- * Returns the
- * type of the sensor.
+ * Returns the type of the sensor.
+ *
+ * @see Sensor#getType()
+ * @see Sensor types
*/
public int getType() {
return mType;
@@ -87,7 +90,7 @@ public class VirtualSensor {
* Send a sensor event to the system.
*/
@RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE)
- public void sendSensorEvent(@NonNull VirtualSensorEvent event) {
+ public void sendEvent(@NonNull VirtualSensorEvent event) {
try {
mVirtualDevice.sendSensorEvent(mToken, event);
} catch (RemoteException e) {
diff --git a/core/java/android/companion/virtual/sensor/VirtualSensorConfig.java b/core/java/android/companion/virtual/sensor/VirtualSensorConfig.java
index 7982fa59daf3e..eb2f9dde48dbf 100644
--- a/core/java/android/companion/virtual/sensor/VirtualSensorConfig.java
+++ b/core/java/android/companion/virtual/sensor/VirtualSensorConfig.java
@@ -23,6 +23,7 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
+import android.hardware.Sensor;
import android.os.Parcel;
import android.os.Parcelable;
@@ -77,8 +78,10 @@ public final class VirtualSensorConfig implements Parcelable {
}
/**
- * Returns the
- * type of the sensor.
+ * Returns the type of the sensor.
+ *
+ * @see Sensor#getType()
+ * @see Sensor types
*/
public int getType() {
return mType;
@@ -150,8 +153,7 @@ public final class VirtualSensorConfig implements Parcelable {
/**
* Creates a new builder.
*
- * @param type The
- * type of the sensor.
+ * @param type The type of the sensor, matching {@link Sensor#getType}.
* @param name The name of the sensor. Must be unique among all sensors with the same type
* that belong to the same virtual device.
*/
diff --git a/core/java/android/companion/virtual/sensor/VirtualSensorEvent.java b/core/java/android/companion/virtual/sensor/VirtualSensorEvent.java
index 8f8860ed5e6e0..01b49750572de 100644
--- a/core/java/android/companion/virtual/sensor/VirtualSensorEvent.java
+++ b/core/java/android/companion/virtual/sensor/VirtualSensorEvent.java
@@ -18,6 +18,7 @@ package android.companion.virtual.sensor;
import android.annotation.NonNull;
import android.annotation.SystemApi;
+import android.hardware.Sensor;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.SystemClock;
@@ -60,9 +61,11 @@ public final class VirtualSensorEvent implements Parcelable {
}
/**
- * Returns the values of this sensor event. The length and contents depend on the
- * sensor type.
+ * Returns the values of this sensor event. The length and contents depend on the sensor type.
+ *
* @see android.hardware.SensorEvent#values
+ * @see Sensor#getType()
+ * @see Sensor types
*/
@NonNull
public float[] getValues() {
@@ -90,7 +93,9 @@ public final class VirtualSensorEvent implements Parcelable {
/**
* Creates a new builder.
- * @param values the values of the sensor event. @see android.hardware.SensorEvent#values
+ *
+ * @param values the values of the sensor event.
+ * @see android.hardware.SensorEvent#values
*/
public Builder(@NonNull float[] values) {
mValues = values;