Class HardwareConfigState


  • public final class HardwareConfigState
    extends java.lang.Object
    State and constants for interacting with Bitmap.Config.HARDWARE on Android O+.
    • Field Detail

      • BLOCK_HARDWARE_BITMAPS_WHEN_GL_CONTEXT_MIGHT_NOT_BE_INITIALIZED

        public static final boolean BLOCK_HARDWARE_BITMAPS_WHEN_GL_CONTEXT_MIGHT_NOT_BE_INITIALIZED
        Force the state to wait until a call to allow hardware Bitmaps to be used when they'd otherwise be eligible to work around a framework issue pre Q that can cause a native crash when allocating a hardware Bitmap in this specific circumstance. See b/126573603#comment12 for details.
      • HARDWARE_BITMAPS_SUPPORTED

        public static final boolean HARDWARE_BITMAPS_SUPPORTED
        Support for the hardware bitmap config was added in Android O.
      • NO_MAX_FD_COUNT

        public static final int NO_MAX_FD_COUNT
        This constant will be removed in a future version without deprecation, avoid using it.
        See Also:
        Constant Field Values
    • Method Detail

      • areHardwareBitmapsBlocked

        public boolean areHardwareBitmapsBlocked()
      • blockHardwareBitmaps

        public void blockHardwareBitmaps()
      • unblockHardwareBitmaps

        public void unblockHardwareBitmaps()
      • isHardwareConfigAllowed

        public boolean isHardwareConfigAllowed​(int targetWidth,
                                               int targetHeight,
                                               boolean isHardwareConfigAllowed,
                                               boolean isExifOrientationRequired)