public static Bitmap getBitmap(AdaptiveIconDrawable adaptiveIconDrawable) {
        Bitmap bitmap = Bitmap.createBitmap(adaptiveIconDrawable.getIntrinsicWidth(),
                adaptiveIconDrawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(bitmap);
        adaptiveIconDrawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
        adaptiveIconDrawable.draw(canvas);
        return bitmap;
    }
Created by guohao4 on 2017/10/24.
Email: Tornaco@163.com
android/modules/module_common/src/main/java/github/tornaco/android/thanos/util/BitmapUtil.java