Loading core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ package android { ctor public Manifest.permission(); field public static final String ACCEPT_HANDOVER = "android.permission.ACCEPT_HANDOVER"; field public static final String ACCESS_BACKGROUND_LOCATION = "android.permission.ACCESS_BACKGROUND_LOCATION"; field public static final String ACCESS_BLOBS_ACROSS_USERS = "android.permission.ACCESS_BLOBS_ACROSS_USERS"; field public static final String ACCESS_CHECKIN_PROPERTIES = "android.permission.ACCESS_CHECKIN_PROPERTIES"; field public static final String ACCESS_COARSE_LOCATION = "android.permission.ACCESS_COARSE_LOCATION"; field public static final String ACCESS_FINE_LOCATION = "android.permission.ACCESS_FINE_LOCATION"; core/api/system-current.txt +0 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ package android { public static final class Manifest.permission { field public static final String ACCESS_AMBIENT_LIGHT_STATS = "android.permission.ACCESS_AMBIENT_LIGHT_STATS"; field public static final String ACCESS_BLOBS_ACROSS_USERS = "android.permission.ACCESS_BLOBS_ACROSS_USERS"; field public static final String ACCESS_BROADCAST_RADIO = "android.permission.ACCESS_BROADCAST_RADIO"; field public static final String ACCESS_CACHE_FILESYSTEM = "android.permission.ACCESS_CACHE_FILESYSTEM"; field public static final String ACCESS_CONTEXT_HUB = "android.permission.ACCESS_CONTEXT_HUB"; core/java/android/hardware/display/BrightnessInfo.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 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 BrightnessInfo; core/java/android/hardware/display/BrightnessInfo.java 0 → 100644 +109 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 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.annotation.IntDef; import android.os.Parcel; import android.os.Parcelable; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * Data about the current brightness state. * {@see android.view.Display.getBrightnessInfo()} * * @hide */ public final class BrightnessInfo implements Parcelable { @IntDef(prefix = {"HIGH_BRIGHTNESS_MODE_"}, value = { HIGH_BRIGHTNESS_MODE_OFF, HIGH_BRIGHTNESS_MODE_SUNLIGHT }) @Retention(RetentionPolicy.SOURCE) public @interface HighBrightnessMode {} /** * High brightness mode is OFF. The high brightness range is not currently accessible to the * user. */ public static final int HIGH_BRIGHTNESS_MODE_OFF = 0; /** * High brightness mode is ON due to high ambient light (sunlight). The high brightness range is * currently accessible to the user. */ public static final int HIGH_BRIGHTNESS_MODE_SUNLIGHT = 1; /** Brightness */ public final float brightness; /** Current minimum supported brightness. */ public final float brightnessMinimum; /** Current maximum supported brightness. */ public final float brightnessMaximum; /** * Current state of high brightness mode. * Can be any of HIGH_BRIGHTNESS_MODE_* values. */ public final int highBrightnessMode; public BrightnessInfo(float brightness, float brightnessMinimum, float brightnessMaximum, @HighBrightnessMode int highBrightnessMode) { this.brightness = brightness; this.brightnessMinimum = brightnessMinimum; this.brightnessMaximum = brightnessMaximum; this.highBrightnessMode = highBrightnessMode; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeFloat(brightness); dest.writeFloat(brightnessMinimum); dest.writeFloat(brightnessMaximum); dest.writeInt(highBrightnessMode); } public static final @android.annotation.NonNull Creator<BrightnessInfo> CREATOR = new Creator<BrightnessInfo>() { @Override public BrightnessInfo createFromParcel(Parcel source) { return new BrightnessInfo(source); } @Override public BrightnessInfo[] newArray(int size) { return new BrightnessInfo[size]; } }; private BrightnessInfo(Parcel source) { brightness = source.readFloat(); brightnessMinimum = source.readFloat(); brightnessMaximum = source.readFloat(); highBrightnessMode = source.readInt(); } } core/java/android/hardware/display/DisplayManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -418,6 +418,7 @@ public final class DisplayManager { EVENT_FLAG_DISPLAY_ADDED, EVENT_FLAG_DISPLAY_CHANGED, EVENT_FLAG_DISPLAY_REMOVED, EVENT_FLAG_DISPLAY_BRIGHTNESS }) @Retention(RetentionPolicy.SOURCE) public @interface EventsMask {} Loading Loading @@ -449,6 +450,17 @@ public final class DisplayManager { */ public static final long EVENT_FLAG_DISPLAY_CHANGED = 1L << 2; /** * Event flag to register for a display's brightness changes. This notification is sent * through the {@link DisplayListener#onDisplayChanged} callback method. New brightness * values can be retrieved via {@link android.view.Display#getBrightnessInfo()}. * * @see #registerDisplayListener(DisplayListener, Handler, long) * * @hide */ public static final long EVENT_FLAG_DISPLAY_BRIGHTNESS = 1L << 3; /** @hide */ public DisplayManager(Context context) { mContext = context; Loading Loading @@ -583,6 +595,7 @@ public final class DisplayManager { * @see #EVENT_FLAG_DISPLAY_ADDED * @see #EVENT_FLAG_DISPLAY_CHANGED * @see #EVENT_FLAG_DISPLAY_REMOVED * @see #EVENT_FLAG_DISPLAY_BRIGHTNESS * @see #registerDisplayListener(DisplayListener, Handler) * @see #unregisterDisplayListener * Loading Loading
core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ package android { ctor public Manifest.permission(); field public static final String ACCEPT_HANDOVER = "android.permission.ACCEPT_HANDOVER"; field public static final String ACCESS_BACKGROUND_LOCATION = "android.permission.ACCESS_BACKGROUND_LOCATION"; field public static final String ACCESS_BLOBS_ACROSS_USERS = "android.permission.ACCESS_BLOBS_ACROSS_USERS"; field public static final String ACCESS_CHECKIN_PROPERTIES = "android.permission.ACCESS_CHECKIN_PROPERTIES"; field public static final String ACCESS_COARSE_LOCATION = "android.permission.ACCESS_COARSE_LOCATION"; field public static final String ACCESS_FINE_LOCATION = "android.permission.ACCESS_FINE_LOCATION";
core/api/system-current.txt +0 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ package android { public static final class Manifest.permission { field public static final String ACCESS_AMBIENT_LIGHT_STATS = "android.permission.ACCESS_AMBIENT_LIGHT_STATS"; field public static final String ACCESS_BLOBS_ACROSS_USERS = "android.permission.ACCESS_BLOBS_ACROSS_USERS"; field public static final String ACCESS_BROADCAST_RADIO = "android.permission.ACCESS_BROADCAST_RADIO"; field public static final String ACCESS_CACHE_FILESYSTEM = "android.permission.ACCESS_CACHE_FILESYSTEM"; field public static final String ACCESS_CONTEXT_HUB = "android.permission.ACCESS_CONTEXT_HUB";
core/java/android/hardware/display/BrightnessInfo.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 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 BrightnessInfo;
core/java/android/hardware/display/BrightnessInfo.java 0 → 100644 +109 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 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.annotation.IntDef; import android.os.Parcel; import android.os.Parcelable; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * Data about the current brightness state. * {@see android.view.Display.getBrightnessInfo()} * * @hide */ public final class BrightnessInfo implements Parcelable { @IntDef(prefix = {"HIGH_BRIGHTNESS_MODE_"}, value = { HIGH_BRIGHTNESS_MODE_OFF, HIGH_BRIGHTNESS_MODE_SUNLIGHT }) @Retention(RetentionPolicy.SOURCE) public @interface HighBrightnessMode {} /** * High brightness mode is OFF. The high brightness range is not currently accessible to the * user. */ public static final int HIGH_BRIGHTNESS_MODE_OFF = 0; /** * High brightness mode is ON due to high ambient light (sunlight). The high brightness range is * currently accessible to the user. */ public static final int HIGH_BRIGHTNESS_MODE_SUNLIGHT = 1; /** Brightness */ public final float brightness; /** Current minimum supported brightness. */ public final float brightnessMinimum; /** Current maximum supported brightness. */ public final float brightnessMaximum; /** * Current state of high brightness mode. * Can be any of HIGH_BRIGHTNESS_MODE_* values. */ public final int highBrightnessMode; public BrightnessInfo(float brightness, float brightnessMinimum, float brightnessMaximum, @HighBrightnessMode int highBrightnessMode) { this.brightness = brightness; this.brightnessMinimum = brightnessMinimum; this.brightnessMaximum = brightnessMaximum; this.highBrightnessMode = highBrightnessMode; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeFloat(brightness); dest.writeFloat(brightnessMinimum); dest.writeFloat(brightnessMaximum); dest.writeInt(highBrightnessMode); } public static final @android.annotation.NonNull Creator<BrightnessInfo> CREATOR = new Creator<BrightnessInfo>() { @Override public BrightnessInfo createFromParcel(Parcel source) { return new BrightnessInfo(source); } @Override public BrightnessInfo[] newArray(int size) { return new BrightnessInfo[size]; } }; private BrightnessInfo(Parcel source) { brightness = source.readFloat(); brightnessMinimum = source.readFloat(); brightnessMaximum = source.readFloat(); highBrightnessMode = source.readInt(); } }
core/java/android/hardware/display/DisplayManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -418,6 +418,7 @@ public final class DisplayManager { EVENT_FLAG_DISPLAY_ADDED, EVENT_FLAG_DISPLAY_CHANGED, EVENT_FLAG_DISPLAY_REMOVED, EVENT_FLAG_DISPLAY_BRIGHTNESS }) @Retention(RetentionPolicy.SOURCE) public @interface EventsMask {} Loading Loading @@ -449,6 +450,17 @@ public final class DisplayManager { */ public static final long EVENT_FLAG_DISPLAY_CHANGED = 1L << 2; /** * Event flag to register for a display's brightness changes. This notification is sent * through the {@link DisplayListener#onDisplayChanged} callback method. New brightness * values can be retrieved via {@link android.view.Display#getBrightnessInfo()}. * * @see #registerDisplayListener(DisplayListener, Handler, long) * * @hide */ public static final long EVENT_FLAG_DISPLAY_BRIGHTNESS = 1L << 3; /** @hide */ public DisplayManager(Context context) { mContext = context; Loading Loading @@ -583,6 +595,7 @@ public final class DisplayManager { * @see #EVENT_FLAG_DISPLAY_ADDED * @see #EVENT_FLAG_DISPLAY_CHANGED * @see #EVENT_FLAG_DISPLAY_REMOVED * @see #EVENT_FLAG_DISPLAY_BRIGHTNESS * @see #registerDisplayListener(DisplayListener, Handler) * @see #unregisterDisplayListener * Loading