Class HardwareConfigState

java.lang.Object
com.bumptech.glide.load.resource.bitmap.HardwareConfigState

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

    • 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

      @ChecksSdkIntAtLeast(api=28) public static final boolean HARDWARE_BITMAPS_SUPPORTED
      Support for the hardware bitmap config was added in Android O.
    • NO_MAX_FD_COUNT

      @Deprecated public static final int NO_MAX_FD_COUNT
      Deprecated.
      This constant is unused and will be removed in a future version, avoid using it.
      See Also:
  • Method Details

    • getInstance

      public static HardwareConfigState getInstance()
    • blockHardwareBitmaps

      public void blockHardwareBitmaps()
    • unblockHardwareBitmaps

      public void unblockHardwareBitmaps()
    • isHardwareConfigAllowed

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