code: protected static boolean isOk2Draw(Bitmap bitmap) {
          //ignore this if bitmap is null.
          if (bitmap == null) return true;
  
          if (bitmap.isRecycled()) {
              return false;
          }
          if (Build.VERSION.SDK_INT > 16) {
              if (!bitmap.isPremultiplied() && bitmap.getConfig() == Bitmap.Config.ARGB_8888 &&
                      bitmap.hasAlpha()) {
                  return false;
              }
          }
  
          return true;
      }
docs: Checks if the bitmap is able to be drawn by a {@link Canvas}. If bit map is null it will
  return true as this is fine and will be ignored anyway, while recycled bitmaps will cause an
  Exception thrown