Loading core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -50947,6 +50947,7 @@ package android.view { method public android.view.Display.Mode[] getSupportedModes(); method @Deprecated public float[] getSupportedRefreshRates(); method @Deprecated public int getWidth(); method @FlaggedApi("com.android.server.display.feature.flags.enable_has_arr_support") public boolean hasArrSupport(); method public boolean isHdr(); method public boolean isHdrSdrRatioAvailable(); method public boolean isMinimalPostProcessingSupported(); core/java/android/view/Display.java +13 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.Manifest.permission.CONTROL_DISPLAY_BRIGHTNESS; import static android.hardware.flags.Flags.FLAG_OVERLAYPROPERTIES_CLASS_API; import static com.android.server.display.feature.flags.Flags.FLAG_HIGHEST_HDR_SDR_RATIO_API; import static com.android.server.display.feature.flags.Flags.FLAG_ENABLE_HAS_ARR_SUPPORT; import android.Manifest; import android.annotation.FlaggedApi; Loading Loading @@ -1265,6 +1266,18 @@ public final class Display { } } /** * Returns whether display supports adaptive refresh rate or not. */ // TODO(b/372526856) Add a link to the documentation for ARR. @FlaggedApi(FLAG_ENABLE_HAS_ARR_SUPPORT) public boolean hasArrSupport() { synchronized (mLock) { updateDisplayInfoLocked(); return mDisplayInfo.hasArrSupport; } } /** * <p> Returns true if the connected display can be switched into a mode with minimal * post processing. </p> Loading core/java/android/view/DisplayInfo.java +12 −0 Original line number Diff line number Diff line Loading @@ -197,6 +197,12 @@ public final class DisplayInfo implements Parcelable { */ public float renderFrameRate; /** * If {@code true} this Display supports adaptive refresh rates. * // TODO(b/372526856) Add a link to the documentation for ARR. */ public boolean hasArrSupport; /** * The default display mode. */ Loading Loading @@ -436,6 +442,7 @@ public final class DisplayInfo implements Parcelable { && rotation == other.rotation && modeId == other.modeId && renderFrameRate == other.renderFrameRate && hasArrSupport == other.hasArrSupport && defaultModeId == other.defaultModeId && userPreferredModeId == other.userPreferredModeId && Arrays.equals(supportedModes, other.supportedModes) Loading Loading @@ -497,6 +504,7 @@ public final class DisplayInfo implements Parcelable { rotation = other.rotation; modeId = other.modeId; renderFrameRate = other.renderFrameRate; hasArrSupport = other.hasArrSupport; defaultModeId = other.defaultModeId; userPreferredModeId = other.userPreferredModeId; supportedModes = Arrays.copyOf(other.supportedModes, other.supportedModes.length); Loading Loading @@ -553,6 +561,7 @@ public final class DisplayInfo implements Parcelable { rotation = source.readInt(); modeId = source.readInt(); renderFrameRate = source.readFloat(); hasArrSupport = source.readBoolean(); defaultModeId = source.readInt(); userPreferredModeId = source.readInt(); int nModes = source.readInt(); Loading Loading @@ -626,6 +635,7 @@ public final class DisplayInfo implements Parcelable { dest.writeInt(rotation); dest.writeInt(modeId); dest.writeFloat(renderFrameRate); dest.writeBoolean(hasArrSupport); dest.writeInt(defaultModeId); dest.writeInt(userPreferredModeId); dest.writeInt(supportedModes.length); Loading Loading @@ -871,6 +881,8 @@ public final class DisplayInfo implements Parcelable { sb.append(modeId); sb.append(", renderFrameRate "); sb.append(renderFrameRate); sb.append(", hasArrSupport "); sb.append(hasArrSupport); sb.append(", defaultMode "); sb.append(defaultModeId); sb.append(", userPreferredModeId "); Loading core/java/android/view/SurfaceControl.java +5 −2 Original line number Diff line number Diff line Loading @@ -1810,6 +1810,7 @@ public final class SurfaceControl implements Parcelable { public DisplayMode[] supportedDisplayModes; public int activeDisplayModeId; public float renderFrameRate; public boolean hasArrSupport; public int[] supportedColorModes; public int activeColorMode; Loading @@ -1827,6 +1828,7 @@ public final class SurfaceControl implements Parcelable { + "supportedDisplayModes=" + Arrays.toString(supportedDisplayModes) + ", activeDisplayModeId=" + activeDisplayModeId + ", renderFrameRate=" + renderFrameRate + ", hasArrSupport=" + hasArrSupport + ", supportedColorModes=" + Arrays.toString(supportedColorModes) + ", activeColorMode=" + activeColorMode + ", hdrCapabilities=" + hdrCapabilities Loading @@ -1846,13 +1848,14 @@ public final class SurfaceControl implements Parcelable { && Arrays.equals(supportedColorModes, that.supportedColorModes) && activeColorMode == that.activeColorMode && Objects.equals(hdrCapabilities, that.hdrCapabilities) && preferredBootDisplayMode == that.preferredBootDisplayMode; && preferredBootDisplayMode == that.preferredBootDisplayMode && hasArrSupport == that.hasArrSupport; } @Override public int hashCode() { return Objects.hash(Arrays.hashCode(supportedDisplayModes), activeDisplayModeId, renderFrameRate, activeColorMode, hdrCapabilities); renderFrameRate, activeColorMode, hdrCapabilities, hasArrSupport); } } Loading core/jni/android_view_SurfaceControl.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -115,6 +115,7 @@ static struct { jfieldID supportedDisplayModes; jfieldID activeDisplayModeId; jfieldID renderFrameRate; jfieldID hasArrSupport; jfieldID supportedColorModes; jfieldID activeColorMode; jfieldID hdrCapabilities; Loading Loading @@ -1453,7 +1454,7 @@ static jobject nativeGetDynamicDisplayInfo(JNIEnv* env, jclass clazz, jlong disp env->SetIntField(object, gDynamicDisplayInfoClassInfo.activeDisplayModeId, info.activeDisplayModeId); env->SetFloatField(object, gDynamicDisplayInfoClassInfo.renderFrameRate, info.renderFrameRate); env->SetBooleanField(object, gDynamicDisplayInfoClassInfo.hasArrSupport, info.hasArrSupport); jintArray colorModesArray = env->NewIntArray(info.supportedColorModes.size()); if (colorModesArray == NULL) { jniThrowException(env, "java/lang/OutOfMemoryError", NULL); Loading Loading @@ -2641,6 +2642,8 @@ int register_android_view_SurfaceControl(JNIEnv* env) GetFieldIDOrDie(env, dynamicInfoClazz, "activeDisplayModeId", "I"); gDynamicDisplayInfoClassInfo.renderFrameRate = GetFieldIDOrDie(env, dynamicInfoClazz, "renderFrameRate", "F"); gDynamicDisplayInfoClassInfo.hasArrSupport = GetFieldIDOrDie(env, dynamicInfoClazz, "hasArrSupport", "Z"); gDynamicDisplayInfoClassInfo.supportedColorModes = GetFieldIDOrDie(env, dynamicInfoClazz, "supportedColorModes", "[I"); gDynamicDisplayInfoClassInfo.activeColorMode = Loading Loading
core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -50947,6 +50947,7 @@ package android.view { method public android.view.Display.Mode[] getSupportedModes(); method @Deprecated public float[] getSupportedRefreshRates(); method @Deprecated public int getWidth(); method @FlaggedApi("com.android.server.display.feature.flags.enable_has_arr_support") public boolean hasArrSupport(); method public boolean isHdr(); method public boolean isHdrSdrRatioAvailable(); method public boolean isMinimalPostProcessingSupported();
core/java/android/view/Display.java +13 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.Manifest.permission.CONTROL_DISPLAY_BRIGHTNESS; import static android.hardware.flags.Flags.FLAG_OVERLAYPROPERTIES_CLASS_API; import static com.android.server.display.feature.flags.Flags.FLAG_HIGHEST_HDR_SDR_RATIO_API; import static com.android.server.display.feature.flags.Flags.FLAG_ENABLE_HAS_ARR_SUPPORT; import android.Manifest; import android.annotation.FlaggedApi; Loading Loading @@ -1265,6 +1266,18 @@ public final class Display { } } /** * Returns whether display supports adaptive refresh rate or not. */ // TODO(b/372526856) Add a link to the documentation for ARR. @FlaggedApi(FLAG_ENABLE_HAS_ARR_SUPPORT) public boolean hasArrSupport() { synchronized (mLock) { updateDisplayInfoLocked(); return mDisplayInfo.hasArrSupport; } } /** * <p> Returns true if the connected display can be switched into a mode with minimal * post processing. </p> Loading
core/java/android/view/DisplayInfo.java +12 −0 Original line number Diff line number Diff line Loading @@ -197,6 +197,12 @@ public final class DisplayInfo implements Parcelable { */ public float renderFrameRate; /** * If {@code true} this Display supports adaptive refresh rates. * // TODO(b/372526856) Add a link to the documentation for ARR. */ public boolean hasArrSupport; /** * The default display mode. */ Loading Loading @@ -436,6 +442,7 @@ public final class DisplayInfo implements Parcelable { && rotation == other.rotation && modeId == other.modeId && renderFrameRate == other.renderFrameRate && hasArrSupport == other.hasArrSupport && defaultModeId == other.defaultModeId && userPreferredModeId == other.userPreferredModeId && Arrays.equals(supportedModes, other.supportedModes) Loading Loading @@ -497,6 +504,7 @@ public final class DisplayInfo implements Parcelable { rotation = other.rotation; modeId = other.modeId; renderFrameRate = other.renderFrameRate; hasArrSupport = other.hasArrSupport; defaultModeId = other.defaultModeId; userPreferredModeId = other.userPreferredModeId; supportedModes = Arrays.copyOf(other.supportedModes, other.supportedModes.length); Loading Loading @@ -553,6 +561,7 @@ public final class DisplayInfo implements Parcelable { rotation = source.readInt(); modeId = source.readInt(); renderFrameRate = source.readFloat(); hasArrSupport = source.readBoolean(); defaultModeId = source.readInt(); userPreferredModeId = source.readInt(); int nModes = source.readInt(); Loading Loading @@ -626,6 +635,7 @@ public final class DisplayInfo implements Parcelable { dest.writeInt(rotation); dest.writeInt(modeId); dest.writeFloat(renderFrameRate); dest.writeBoolean(hasArrSupport); dest.writeInt(defaultModeId); dest.writeInt(userPreferredModeId); dest.writeInt(supportedModes.length); Loading Loading @@ -871,6 +881,8 @@ public final class DisplayInfo implements Parcelable { sb.append(modeId); sb.append(", renderFrameRate "); sb.append(renderFrameRate); sb.append(", hasArrSupport "); sb.append(hasArrSupport); sb.append(", defaultMode "); sb.append(defaultModeId); sb.append(", userPreferredModeId "); Loading
core/java/android/view/SurfaceControl.java +5 −2 Original line number Diff line number Diff line Loading @@ -1810,6 +1810,7 @@ public final class SurfaceControl implements Parcelable { public DisplayMode[] supportedDisplayModes; public int activeDisplayModeId; public float renderFrameRate; public boolean hasArrSupport; public int[] supportedColorModes; public int activeColorMode; Loading @@ -1827,6 +1828,7 @@ public final class SurfaceControl implements Parcelable { + "supportedDisplayModes=" + Arrays.toString(supportedDisplayModes) + ", activeDisplayModeId=" + activeDisplayModeId + ", renderFrameRate=" + renderFrameRate + ", hasArrSupport=" + hasArrSupport + ", supportedColorModes=" + Arrays.toString(supportedColorModes) + ", activeColorMode=" + activeColorMode + ", hdrCapabilities=" + hdrCapabilities Loading @@ -1846,13 +1848,14 @@ public final class SurfaceControl implements Parcelable { && Arrays.equals(supportedColorModes, that.supportedColorModes) && activeColorMode == that.activeColorMode && Objects.equals(hdrCapabilities, that.hdrCapabilities) && preferredBootDisplayMode == that.preferredBootDisplayMode; && preferredBootDisplayMode == that.preferredBootDisplayMode && hasArrSupport == that.hasArrSupport; } @Override public int hashCode() { return Objects.hash(Arrays.hashCode(supportedDisplayModes), activeDisplayModeId, renderFrameRate, activeColorMode, hdrCapabilities); renderFrameRate, activeColorMode, hdrCapabilities, hasArrSupport); } } Loading
core/jni/android_view_SurfaceControl.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -115,6 +115,7 @@ static struct { jfieldID supportedDisplayModes; jfieldID activeDisplayModeId; jfieldID renderFrameRate; jfieldID hasArrSupport; jfieldID supportedColorModes; jfieldID activeColorMode; jfieldID hdrCapabilities; Loading Loading @@ -1453,7 +1454,7 @@ static jobject nativeGetDynamicDisplayInfo(JNIEnv* env, jclass clazz, jlong disp env->SetIntField(object, gDynamicDisplayInfoClassInfo.activeDisplayModeId, info.activeDisplayModeId); env->SetFloatField(object, gDynamicDisplayInfoClassInfo.renderFrameRate, info.renderFrameRate); env->SetBooleanField(object, gDynamicDisplayInfoClassInfo.hasArrSupport, info.hasArrSupport); jintArray colorModesArray = env->NewIntArray(info.supportedColorModes.size()); if (colorModesArray == NULL) { jniThrowException(env, "java/lang/OutOfMemoryError", NULL); Loading Loading @@ -2641,6 +2642,8 @@ int register_android_view_SurfaceControl(JNIEnv* env) GetFieldIDOrDie(env, dynamicInfoClazz, "activeDisplayModeId", "I"); gDynamicDisplayInfoClassInfo.renderFrameRate = GetFieldIDOrDie(env, dynamicInfoClazz, "renderFrameRate", "F"); gDynamicDisplayInfoClassInfo.hasArrSupport = GetFieldIDOrDie(env, dynamicInfoClazz, "hasArrSupport", "Z"); gDynamicDisplayInfoClassInfo.supportedColorModes = GetFieldIDOrDie(env, dynamicInfoClazz, "supportedColorModes", "[I"); gDynamicDisplayInfoClassInfo.activeColorMode = Loading