From 73e0689d8a78e102ece66e0e1ee6dfb2431526f1 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Mon, 31 Jan 2022 15:47:34 -0500 Subject: getDisplayDecorationSupport: return more detailed info Call the updated native version of getDisplayDecorationSupport (added in I961051c0a660b596039ac04b546040764ee20d34), and convert the NDK struct into a Java class. Depend on the graphics AIDLs, which now have Java backends. A future CL will update SysUI to call the new API. Add a PixelFormat for R_8 to correspond to the native version. This will allow SysUI to use COLOR_MODE_A8 when the HAL reports R_8. If64fd6924960f592b7a211371bc2ca6536ae34f7 demonstrates using this. Bug: 216644902 Test: manual Change-Id: I0e34c6d6e369fda0a96231ab38c3bd5f3bfe3e06 --- graphics/java/android/graphics/PixelFormat.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'graphics/java/android') diff --git a/graphics/java/android/graphics/PixelFormat.java b/graphics/java/android/graphics/PixelFormat.java index dde757b4eb01..3ec5b9cc7dae 100644 --- a/graphics/java/android/graphics/PixelFormat.java +++ b/graphics/java/android/graphics/PixelFormat.java @@ -29,7 +29,7 @@ public class PixelFormat { /** @hide */ @Retention(RetentionPolicy.SOURCE) - @IntDef({RGBA_8888, RGBX_8888, RGBA_F16, RGBA_1010102, RGB_888, RGB_565}) + @IntDef({RGBA_8888, RGBX_8888, RGBA_F16, RGBA_1010102, RGB_888, RGB_565, R_8}) public @interface Format { } // NOTE: these constants must match the values from graphics/common/x.x/types.hal @@ -93,6 +93,9 @@ public class PixelFormat { /** @hide */ public static final int HSV_888 = 0x37; + /** @hide */ + public static final int R_8 = 0x38; + /** * @deprecated use {@link android.graphics.ImageFormat#JPEG * ImageFormat.JPEG} instead. @@ -142,6 +145,10 @@ public class PixelFormat { info.bitsPerPixel = 64; info.bytesPerPixel = 8; break; + case R_8: + info.bitsPerPixel = 8; + info.bytesPerPixel = 1; + break; default: throw new IllegalArgumentException("unknown pixel format " + format); } @@ -235,6 +242,8 @@ public class PixelFormat { return "HSV_888"; case JPEG: return "JPEG"; + case R_8: + return "R_8"; default: return Integer.toString(format); } -- cgit v1.2.3-59-g8ed1b