Class HardwareConfigState
- java.lang.Object
-
- com.bumptech.glide.load.resource.bitmap.HardwareConfigState
-
public final class HardwareConfigState extends java.lang.ObjectState and constants for interacting withBitmap.Config.HARDWAREon Android O+.
-
-
Field Summary
Fields Modifier and Type Field Description static booleanBLOCK_HARDWARE_BITMAPS_WHEN_GL_CONTEXT_MIGHT_NOT_BE_INITIALIZEDForce 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.static booleanHARDWARE_BITMAPS_SUPPORTEDSupport for the hardware bitmap config was added in Android O.static intNO_MAX_FD_COUNTThis constant will be removed in a future version without deprecation, avoid using it.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareHardwareBitmapsBlocked()voidblockHardwareBitmaps()static HardwareConfigStategetInstance()booleanisHardwareConfigAllowed(int targetWidth, int targetHeight, boolean isHardwareConfigAllowed, boolean isExifOrientationRequired)voidunblockHardwareBitmaps()
-
-
-
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
-
getInstance
public static HardwareConfigState getInstance()
-
areHardwareBitmapsBlocked
public boolean areHardwareBitmapsBlocked()
-
blockHardwareBitmaps
public void blockHardwareBitmaps()
-
unblockHardwareBitmaps
public void unblockHardwareBitmaps()
-
isHardwareConfigAllowed
public boolean isHardwareConfigAllowed(int targetWidth, int targetHeight, boolean isHardwareConfigAllowed, boolean isExifOrientationRequired)
-
-