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

Commit 43cd3aee authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Rename LightsManager.setLights to requestLights" into rvc-dev am:...

Merge "Rename LightsManager.setLights to requestLights" into rvc-dev am: a9caa7d0 am: d58ed365 am: fd4e71b0 am: 071b48fd

Change-Id: I60dab7077710eaee5574579c294cdf52ac74f713
parents e1ab6ac0 071b48fd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2945,7 +2945,7 @@ package android.hardware.lights {
  public final class LightsManager.LightsSession implements java.lang.AutoCloseable {
    method @RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_LIGHTS) public void close();
    method @RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_LIGHTS) public void setLights(@NonNull android.hardware.lights.LightsRequest);
    method @RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_LIGHTS) public void requestLights(@NonNull android.hardware.lights.LightsRequest);
  }
  public final class LightsRequest {
+1 −1
Original line number Diff line number Diff line
@@ -1280,7 +1280,7 @@ package android.hardware.lights {

  public final class LightsManager.LightsSession implements java.lang.AutoCloseable {
    method @RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_LIGHTS) public void close();
    method @RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_LIGHTS) public void setLights(@NonNull android.hardware.lights.LightsRequest);
    method @RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_LIGHTS) public void requestLights(@NonNull android.hardware.lights.LightsRequest);
  }

  public final class LightsRequest {
+21 −6
Original line number Diff line number Diff line
@@ -37,7 +37,8 @@ public final class Light implements Parcelable {
    /**
     * Creates a new light with the given data.
     *
     * @hide */
     * @hide
     */
    public Light(int id, int ordinal, int type) {
        mId = id;
        mOrdinal = ordinal;
@@ -76,8 +77,24 @@ public final class Light implements Parcelable {
                }
            };

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof Light) {
            Light light = (Light) obj;
            return mId == light.mId && mOrdinal == light.mOrdinal && mType == light.mType;
        }
        return false;
    }

    @Override
    public int hashCode() {
        return mId;
    }

    /**
     * Returns the id of the light.
     *
     * <p>This is an opaque value used as a unique identifier for the light.
     */
    public int getId() {
        return mId;
@@ -86,11 +103,9 @@ public final class Light implements Parcelable {
    /**
     * Returns the ordinal of the light.
     *
     * <p>This represents the physical order of the lights on the device. The exact values are
     * device-dependent, but for example, if there are lights in a row, sorting the Light objects
     * by ordinal should match the order in which they appear on the device. If the device has
     * 4 lights, the ordinals could be [1, 2, 3, 4] or [0, 10, 20, 30] or any other values that
     * have the same sort order.
     * <p>This is a sort key that represents the physical order of lights on the device with the
     * same type. In the case of multiple lights arranged in a line, for example, the ordinals
     * could be [1, 2, 3, 4], or [0, 10, 20, 30], or any other values that have the same sort order.
     */
    public int getOrdinal() {
        return mOrdinal;
+1 −1
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ public final class LightsManager {
         * @param request the settings for lights that should change
         */
        @RequiresPermission(Manifest.permission.CONTROL_DEVICE_LIGHTS)
        public void setLights(@NonNull LightsRequest request) {
        public void requestLights(@NonNull LightsRequest request) {
            Preconditions.checkNotNull(request);
            if (!mClosed) {
                try {
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ public final class LightsRequest {
         * Create a LightsRequest object used to override lights on the device.
         *
         * <p>The generated {@link LightsRequest} should be used in
         * {@link LightsManager.Session#setLights(LightsLightsRequest).
         * {@link LightsManager.Session#requestLights(LightsLightsRequest).
         */
        public @NonNull LightsRequest build() {
            return new LightsRequest(mChanges);
Loading