Loading api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -1255,6 +1255,7 @@ package android.hardware.display { method public android.hardware.display.BrightnessConfiguration getBrightnessConfiguration(); method public java.util.List<android.hardware.display.BrightnessChangeEvent> getBrightnessEvents(); method public android.hardware.display.BrightnessConfiguration getDefaultBrightnessConfiguration(); method public android.util.Pair<float[], float[]> getMinimumBrightnessCurve(); method public android.graphics.Point getStableDisplaySize(); method public void setBrightnessConfiguration(android.hardware.display.BrightnessConfiguration); method public void setSaturationLevel(float); Loading core/java/android/hardware/display/BrightnessConfiguration.java +6 −2 Original line number Diff line number Diff line Loading @@ -86,7 +86,9 @@ public final class BrightnessConfiguration implements Parcelable { sb.append("(").append(mLux[i]).append(", ").append(mNits[i]).append(")"); } sb.append("], '"); if (mDescription != null) { sb.append(mDescription); } sb.append("'}"); return sb.toString(); } Loading @@ -96,7 +98,9 @@ public final class BrightnessConfiguration implements Parcelable { int result = 1; result = result * 31 + Arrays.hashCode(mLux); result = result * 31 + Arrays.hashCode(mNits); if (mDescription != null) { result = result * 31 + mDescription.hashCode(); } return result; } Loading core/java/android/hardware/display/Curve.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.display; parcelable Curve; core/java/android/hardware/display/Curve.java 0 → 100644 +62 −0 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.display; import android.os.Parcel; import android.os.Parcelable; /** @hide */ public final class Curve implements Parcelable { private final float[] mX; private final float[] mY; public Curve(float[] x, float[] y) { mX = x; mY = y; } public float[] getX() { return mX; } public float[] getY() { return mY; } public static final Creator<Curve> CREATOR = new Creator<Curve>() { public Curve createFromParcel(Parcel in) { float[] x = in.createFloatArray(); float[] y = in.createFloatArray(); return new Curve(x, y); } public Curve[] newArray(int size) { return new Curve[size]; } }; @Override public void writeToParcel(Parcel out, int flags) { out.writeFloatArray(mX); out.writeFloatArray(mY); } @Override public int describeContents() { return 0; } } core/java/android/hardware/display/DisplayManager.java +17 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.content.Context; import android.graphics.Point; import android.media.projection.MediaProjection; import android.os.Handler; import android.util.Pair; import android.util.SparseArray; import android.view.Display; import android.view.Surface; Loading Loading @@ -747,6 +748,22 @@ public final class DisplayManager { mGlobal.setTemporaryAutoBrightnessAdjustment(adjustment); } /** * Returns the minimum brightness curve, which guarantess that any brightness curve that dips * below it is rejected by the system. * This prevent auto-brightness from setting the screen so dark as to prevent the user from * resetting or disabling it, and maps lux to the absolute minimum nits that are still readable * in that ambient brightness. * * @return The minimum brightness curve (as lux values and their corresponding nits values). * * @hide */ @SystemApi public Pair<float[], float[]> getMinimumBrightnessCurve() { return mGlobal.getMinimumBrightnessCurve(); } /** * Listens for changes in available display devices. */ Loading Loading
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -1255,6 +1255,7 @@ package android.hardware.display { method public android.hardware.display.BrightnessConfiguration getBrightnessConfiguration(); method public java.util.List<android.hardware.display.BrightnessChangeEvent> getBrightnessEvents(); method public android.hardware.display.BrightnessConfiguration getDefaultBrightnessConfiguration(); method public android.util.Pair<float[], float[]> getMinimumBrightnessCurve(); method public android.graphics.Point getStableDisplaySize(); method public void setBrightnessConfiguration(android.hardware.display.BrightnessConfiguration); method public void setSaturationLevel(float); Loading
core/java/android/hardware/display/BrightnessConfiguration.java +6 −2 Original line number Diff line number Diff line Loading @@ -86,7 +86,9 @@ public final class BrightnessConfiguration implements Parcelable { sb.append("(").append(mLux[i]).append(", ").append(mNits[i]).append(")"); } sb.append("], '"); if (mDescription != null) { sb.append(mDescription); } sb.append("'}"); return sb.toString(); } Loading @@ -96,7 +98,9 @@ public final class BrightnessConfiguration implements Parcelable { int result = 1; result = result * 31 + Arrays.hashCode(mLux); result = result * 31 + Arrays.hashCode(mNits); if (mDescription != null) { result = result * 31 + mDescription.hashCode(); } return result; } Loading
core/java/android/hardware/display/Curve.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.display; parcelable Curve;
core/java/android/hardware/display/Curve.java 0 → 100644 +62 −0 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.display; import android.os.Parcel; import android.os.Parcelable; /** @hide */ public final class Curve implements Parcelable { private final float[] mX; private final float[] mY; public Curve(float[] x, float[] y) { mX = x; mY = y; } public float[] getX() { return mX; } public float[] getY() { return mY; } public static final Creator<Curve> CREATOR = new Creator<Curve>() { public Curve createFromParcel(Parcel in) { float[] x = in.createFloatArray(); float[] y = in.createFloatArray(); return new Curve(x, y); } public Curve[] newArray(int size) { return new Curve[size]; } }; @Override public void writeToParcel(Parcel out, int flags) { out.writeFloatArray(mX); out.writeFloatArray(mY); } @Override public int describeContents() { return 0; } }
core/java/android/hardware/display/DisplayManager.java +17 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.content.Context; import android.graphics.Point; import android.media.projection.MediaProjection; import android.os.Handler; import android.util.Pair; import android.util.SparseArray; import android.view.Display; import android.view.Surface; Loading Loading @@ -747,6 +748,22 @@ public final class DisplayManager { mGlobal.setTemporaryAutoBrightnessAdjustment(adjustment); } /** * Returns the minimum brightness curve, which guarantess that any brightness curve that dips * below it is rejected by the system. * This prevent auto-brightness from setting the screen so dark as to prevent the user from * resetting or disabling it, and maps lux to the absolute minimum nits that are still readable * in that ambient brightness. * * @return The minimum brightness curve (as lux values and their corresponding nits values). * * @hide */ @SystemApi public Pair<float[], float[]> getMinimumBrightnessCurve() { return mGlobal.getMinimumBrightnessCurve(); } /** * Listens for changes in available display devices. */ Loading