How can we get Block Bundle Type for block in code? I am trying to override block content by using hook_preprocess_block(&amp;$variables). I was expecting to find bundle type in $variable, but not getting anything related to this.

Here is kint display of $variable inside the function - 

More Info - This is a block type (say content_slider) created from Drupal UI &amp; a block (say content_slider_homepage) is added.
This is how I would do it:

use \Drupal\block_content\BlockContentInterface;


/**
 * Implements HOOK_preprocess_block().
 *
 * @param $variables
 */
function mymodule_preprocess_block(&amp;$variables) {
  $content = $variables['elements']['content'];
  if (isset($content['#block_content']) &amp;&amp; $content['#block_content'] instanceof BlockContentInterface) {

    if ($content['#block_content']-&gt;bundle() == 'xxx') {
      // ...
    }

  }
}