diff options
| author | 2021-02-26 19:13:25 -0800 | |
|---|---|---|
| committer | 2021-03-05 09:29:50 -0800 | |
| commit | 65ef0fafea46f631eff0ab59ae5569b200bf8580 (patch) | |
| tree | 350f99d20749f78d294c8a403473de031903ec0f | |
| parent | 4973cb868bf4bc39b6b8125590cdad9aa339487a (diff) | |
Add LightsRequest.Builder#setLight back to SystemApi as Deprecated.
LightRequest.Builder#setLight was renamed to
LightRequest.Builder#addLight, as metalava check enforce the check for a
getter. ApiChecker CTS test still check the method with API 28, 29, 30 and will fail on:
missing_method: android.hardware.lights.LightsRequest.Builder#setLight(android.hardware.lights.Light, android.hardware.lights.LightState) Error: No method with correct signature found.
Add the method back to SystemApi and annotate it as deprecated.
Bug: 181019981
Test: atest android.signature.cts.api.system.SignatureTest#testSignature
Change-Id: Id05f11ad77c01e26e62eaece78ffc875ec5e72df
| -rw-r--r-- | core/api/system-current.txt | 4 | ||||
| -rw-r--r-- | core/java/android/hardware/lights/LightsRequest.java | 15 |
2 files changed, 19 insertions, 0 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 59bc9bda1205..fd0394fea3e1 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -3440,6 +3440,10 @@ package android.hardware.lights { field @Deprecated public static final int LIGHT_TYPE_MICROPHONE = 8; // 0x8 } + public static final class LightsRequest.Builder { + method @Deprecated @NonNull public android.hardware.lights.LightsRequest.Builder setLight(@NonNull android.hardware.lights.Light, @NonNull android.hardware.lights.LightState); + } + } package android.hardware.location { diff --git a/core/java/android/hardware/lights/LightsRequest.java b/core/java/android/hardware/lights/LightsRequest.java index 2626a461aaf5..6fb0eb5df59a 100644 --- a/core/java/android/hardware/lights/LightsRequest.java +++ b/core/java/android/hardware/lights/LightsRequest.java @@ -17,6 +17,7 @@ package android.hardware.lights; import android.annotation.NonNull; +import android.annotation.SystemApi; import android.util.SparseArray; import com.android.internal.util.Preconditions; @@ -94,6 +95,20 @@ public final class LightsRequest { } /** + * Overrides the color and intensity of a given light. + * + * @param light the light to modify + * @param state the desired color and intensity of the light * + * @deprecated Use {@link #addLight(Light, LightState)} instead. + * @hide + */ + @SystemApi + @Deprecated + public @NonNull Builder setLight(@NonNull Light light, @NonNull LightState state) { + return addLight(light, state); + } + + /** * Removes the override for the color and intensity of a given light. * * @param light the light to modify |