@SuppressLint("NewApi")
    @RequiresApi(23)
    public Icon toIcon() {
        Icon icon;
        switch (mType) {
            case TYPE_UNKNOWN:
                // When type is unknown we are just wrapping an icon.
                return (Icon) mObj1;
            case TYPE_BITMAP:
                icon = Icon.createWithBitmap((Bitmap) mObj1);
                break;
            case TYPE_ADAPTIVE_BITMAP:
                if (Build.VERSION.SDK_INT >= 26) {
                    icon = Icon.createWithAdaptiveBitmap((Bitmap) mObj1);
                } else {
                    icon = Icon.createWithBitmap(
                            createLegacyIconFromAdaptiveIcon((Bitmap) mObj1, false));
                }
                break;
            case TYPE_RESOURCE:
                icon = Icon.createWithResource(getResPackage(), mInt1);
                break;
            case TYPE_DATA:
                icon = Icon.createWithData((byte[]) mObj1, mInt1, mInt2);
                break;
            case TYPE_URI:
                icon = Icon.createWithContentUri((String) mObj1);
                break;
            default:
                throw new IllegalArgumentException("Unknown type");
        }
        if (mTintList != null) {
            icon.setTintList(mTintList);
        }
        if (mTintMode != DEFAULT_TINT_MODE) {
            icon.setTintMode(mTintMode);
        }
        return icon;
    }
Convert this compat object to {@link Icon} object.

@return {@link Icon} object
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/compat/IconCompat.java