code: public static Bitmap screenshot(int width, int height) {
          if (METHOD_screenshot_II == null) {
              Log.e(TAG, "screenshot method was not found.");
              return null;
          }
  
          return (Bitmap) CompatUtils.invoke(null, null, METHOD_screenshot_II, width, height);
      }
docs: Copy the current screen contents into a bitmap and return it. Use width =
  0 and height = 0 to obtain an unscaled screenshot.
  
  @param width The desired width of the returned bitmap; the raw screen
  will be scaled down to this size.
  @param height The desired height of the returned bitmap; the raw screen
  will be scaled down to this size.