Loading core/api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -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 { core/java/android/companion/virtual/sensor/VirtualSensor.java +6 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -68,8 +69,10 @@ public class VirtualSensor { } /** * Returns the * <a href="https://source.android.com/devices/sensors/sensor-types">type</a> of the sensor. * Returns the type of the sensor. * * @see Sensor#getType() * @see <a href="https://source.android.com/devices/sensors/sensor-types">Sensor types</a> */ public int getType() { return mType; Loading @@ -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) { Loading core/java/android/companion/virtual/sensor/VirtualSensorConfig.java +6 −4 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -77,8 +78,10 @@ public final class VirtualSensorConfig implements Parcelable { } /** * Returns the * <a href="https://source.android.com/devices/sensors/sensor-types">type</a> of the sensor. * Returns the type of the sensor. * * @see Sensor#getType() * @see <a href="https://source.android.com/devices/sensors/sensor-types">Sensor types</a> */ public int getType() { return mType; Loading Loading @@ -150,8 +153,7 @@ public final class VirtualSensorConfig implements Parcelable { /** * Creates a new builder. * * @param type The * <a href="https://source.android.com/devices/sensors/sensor-types">type</a> 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. */ Loading core/java/android/companion/virtual/sensor/VirtualSensorEvent.java +8 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -60,9 +61,11 @@ public final class VirtualSensorEvent implements Parcelable { } /** * Returns the values of this sensor event. The length and contents depend on the * <a href="https://source.android.com/devices/sensors/sensor-types">sensor type</a>. * 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 <a href="https://source.android.com/devices/sensors/sensor-types">Sensor types</a> */ @NonNull public float[] getValues() { Loading Loading @@ -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; Loading Loading
core/api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -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 {
core/java/android/companion/virtual/sensor/VirtualSensor.java +6 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -68,8 +69,10 @@ public class VirtualSensor { } /** * Returns the * <a href="https://source.android.com/devices/sensors/sensor-types">type</a> of the sensor. * Returns the type of the sensor. * * @see Sensor#getType() * @see <a href="https://source.android.com/devices/sensors/sensor-types">Sensor types</a> */ public int getType() { return mType; Loading @@ -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) { Loading
core/java/android/companion/virtual/sensor/VirtualSensorConfig.java +6 −4 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -77,8 +78,10 @@ public final class VirtualSensorConfig implements Parcelable { } /** * Returns the * <a href="https://source.android.com/devices/sensors/sensor-types">type</a> of the sensor. * Returns the type of the sensor. * * @see Sensor#getType() * @see <a href="https://source.android.com/devices/sensors/sensor-types">Sensor types</a> */ public int getType() { return mType; Loading Loading @@ -150,8 +153,7 @@ public final class VirtualSensorConfig implements Parcelable { /** * Creates a new builder. * * @param type The * <a href="https://source.android.com/devices/sensors/sensor-types">type</a> 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. */ Loading
core/java/android/companion/virtual/sensor/VirtualSensorEvent.java +8 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -60,9 +61,11 @@ public final class VirtualSensorEvent implements Parcelable { } /** * Returns the values of this sensor event. The length and contents depend on the * <a href="https://source.android.com/devices/sensors/sensor-types">sensor type</a>. * 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 <a href="https://source.android.com/devices/sensors/sensor-types">Sensor types</a> */ @NonNull public float[] getValues() { Loading Loading @@ -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; Loading